[twitter] ensure videos have a 'filename'

This usually gets set when invoking the 'ytdl' downloader, but when
that fails, the error message would use 'None' as filename.
This commit is contained in:
Mike Fährmann
2020-04-24 22:34:19 +02:00
parent c4371a6970
commit 3eab07739f

View File

@@ -63,13 +63,11 @@ class TwitterExtractor(Extractor):
url = self._video_from_tweet(data["tweet_id"])
if not url:
continue
ext = text.ext_from_url(url)
if ext == "m3u8":
text.nameext_from_url(url, data)
if data["extension"] == "m3u8":
url = "ytdl:" + url
data["extension"] = "mp4"
data["_ytdl_extra"] = {"protocol": "m3u8_native"}
else:
data["extension"] = ext
data["num"] = 1
yield Message.Url, url, data