diff options
| author | 2021-06-05 20:55:36 -0400 | |
|---|---|---|
| committer | 2021-06-05 20:55:36 -0400 | |
| commit | 8a644b7a06c504263a478d3681eed10b4161b5be (patch) | |
| tree | b3d668588e5c0be8c75467e50499f73ff9ec7c05 /gallery_dl/extractor/weibo.py | |
| parent | e7eb1f9779f2e223575ab23a6bc1abf2222e7d27 (diff) | |
New upstream version 1.17.5.upstream/1.17.5
Diffstat (limited to 'gallery_dl/extractor/weibo.py')
| -rw-r--r-- | gallery_dl/extractor/weibo.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/gallery_dl/extractor/weibo.py b/gallery_dl/extractor/weibo.py index a325f87..0b6a153 100644 --- a/gallery_dl/extractor/weibo.py +++ b/gallery_dl/extractor/weibo.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2019-2020 Mike Fährmann +# Copyright 2019-2021 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -27,16 +27,21 @@ class WeiboExtractor(Extractor): self.videos = self.config("videos", True) def items(self): - yield Message.Version, 1 + original_retweets = (self.retweets == "original") for status in self.statuses(): - files = self._files_from_status(status) if self.retweets and "retweeted_status" in status: - files = itertools.chain( - files, - self._files_from_status(status["retweeted_status"]), - ) + if original_retweets: + status = status["retweeted_status"] + files = self._files_from_status(status) + else: + files = itertools.chain( + self._files_from_status(status), + self._files_from_status(status["retweeted_status"]), + ) + else: + files = self._files_from_status(status) for num, file in enumerate(files, 1): if num == 1: @@ -143,6 +148,11 @@ class WeiboStatusExtractor(WeiboExtractor): }), # non-numeric status ID (#664) ("https://weibo.com/3314883543/Iy7fj4qVg"), + # original retweets (#1542) + ("https://m.weibo.cn/detail/4600272267522211", { + "options": (("retweets", "original"),), + "keyword": {"status": {"id": "4600167083287033"}}, + }), ("https://m.weibo.cn/status/4339748116375525"), ("https://m.weibo.cn/5746766133/4339748116375525"), ) |
