diff options
| author | 2025-12-20 05:49:04 -0500 | |
|---|---|---|
| committer | 2025-12-20 05:49:04 -0500 | |
| commit | a24ec1647aeac35a63b744ea856011ad6e06be3b (patch) | |
| tree | ae94416de786aeddd05d99559098f7f16bb103a6 /gallery_dl/extractor/weibo.py | |
| parent | 33f8a8a37a9cba738ef25fb99955f0730da9eb48 (diff) | |
New upstream version 1.31.1.upstream/1.31.1
Diffstat (limited to 'gallery_dl/extractor/weibo.py')
| -rw-r--r-- | gallery_dl/extractor/weibo.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gallery_dl/extractor/weibo.py b/gallery_dl/extractor/weibo.py index 3c0f077..abec0f7 100644 --- a/gallery_dl/extractor/weibo.py +++ b/gallery_dl/extractor/weibo.py @@ -34,6 +34,7 @@ class WeiboExtractor(Extractor): def _init(self): self.livephoto = self.config("livephoto", True) self.retweets = self.config("retweets", False) + self.longtext = self.config("text", False) self.videos = self.config("videos", True) self.movies = self.config("movies", False) self.gifs = self.config("gifs", True) @@ -98,10 +99,14 @@ class WeiboExtractor(Extractor): files = [] self._extract_status(status, files) - status["date"] = text.parse_datetime( + if self.longtext and status.get("isLongText") and \ + status["text"].endswith('class="expand">展开</span>'): + status = self._status_by_id(status["id"]) + + status["date"] = self.parse_datetime( status["created_at"], "%a %b %d %H:%M:%S %z %Y") status["count"] = len(files) - yield Message.Directory, status + yield Message.Directory, "", status num = 0 for file in files: @@ -190,7 +195,8 @@ class WeiboExtractor(Extractor): return video def _status_by_id(self, status_id): - url = f"{self.root}/ajax/statuses/show?id={status_id}" + url = (f"{self.root}/ajax/statuses/show" + f"?id={status_id}&isGetLongText=true") return self.request_json(url) def _user_id(self): |
