summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/weibo.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/weibo.py')
-rw-r--r--gallery_dl/extractor/weibo.py12
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):