diff options
| author | 2020-05-03 00:06:40 -0400 | |
|---|---|---|
| committer | 2020-05-03 00:06:40 -0400 | |
| commit | 90e50db2e3c38f523bb5195d295290b06e5cedb0 (patch) | |
| tree | 4759dc0faea79f83fa5074e2d0bd82b18a9caaea /gallery_dl/extractor/weibo.py | |
| parent | d5b96ce44b7809f5ae01e3e9d70a1d58fe21ccf5 (diff) | |
New upstream version 1.13.6upstream/1.13.6
Diffstat (limited to 'gallery_dl/extractor/weibo.py')
| -rw-r--r-- | gallery_dl/extractor/weibo.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gallery_dl/extractor/weibo.py b/gallery_dl/extractor/weibo.py index 9539c2f..aa9bdae 100644 --- a/gallery_dl/extractor/weibo.py +++ b/gallery_dl/extractor/weibo.py @@ -23,6 +23,7 @@ class WeiboExtractor(Extractor): def __init__(self, match): Extractor.__init__(self, match) self.retweets = self.config("retweets", True) + self.videos = self.config("videos", True) def items(self): yield Message.Version, 1 @@ -52,7 +53,7 @@ class WeiboExtractor(Extractor): yield Message.Url, image["url"], data num += 1 - if "page_info" in obj and "media_info" in obj["page_info"]: + if self.videos and "media_info" in obj.get("page_info", ()): info = obj["page_info"]["media_info"] url = info.get("stream_url_hd") or info.get("stream_url") @@ -70,6 +71,7 @@ class WeiboExtractor(Extractor): data["extension"] = "mp4" data["_ytdl_extra"] = {"protocol": "m3u8_native"} yield Message.Url, url, data + num += 1 if self.retweets and "retweeted_status" in obj: obj = obj["retweeted_status"] |
