[weibo] fix retweets (#2825, #3874, #5263)

- handle 快转 retweets
- disable 'retweets' by default
- skip all retweet media when 'retweets' are disabled
- extract all retweet media when 'retweets' is set to "original"
This commit is contained in:
Mike Fährmann
2024-03-06 19:09:59 +01:00
parent 0676a9d6ec
commit ace16f00f5
3 changed files with 43 additions and 11 deletions

View File

@@ -80,11 +80,11 @@ __tests__ = (
"#category": ("", "weibo", "home"),
"#class" : weibo.WeiboHomeExtractor,
"#range" : "1-30",
"#count" : 30,
"#count" : 0,
},
{
"#url" : "https://weibo.com/1758989602?tabtype=feed",
"#url" : "https://weibo.com/2553930725?tabtype=feed",
"#category": ("", "weibo", "feed"),
"#class" : weibo.WeiboFeedExtractor,
"#range" : "1-30",
@@ -194,6 +194,28 @@ __tests__ = (
"#class" : weibo.WeiboStatusExtractor,
},
{
"#url" : "https://weibo.cn/detail/4600272267522211",
"#comment" : "retweet",
"#category": ("", "weibo", "status"),
"#class" : weibo.WeiboStatusExtractor,
"#count" : 0,
},
{
"#url" : "https://weibo.cn/detail/4600272267522211",
"#comment" : "retweet",
"#category": ("", "weibo", "status"),
"#class" : weibo.WeiboStatusExtractor,
"#options" : {"retweets": True},
"#count" : 2,
"status": {
"id" : 4600272267522211,
"retweeted_status": {"id": 4600167083287033},
},
},
{
"#url" : "https://m.weibo.cn/detail/4600272267522211",
"#comment" : "original retweets (#1542)",