mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
[twitter] extend 'replies' option (#1254)
Allow setting 'replies to '"self"' to only download from self-replies.
This commit is contained in:
parent
f9096584ab
commit
e5a93e113f
@ -1899,6 +1899,9 @@ Default
|
|||||||
Description
|
Description
|
||||||
Fetch media from replies to other Tweets.
|
Fetch media from replies to other Tweets.
|
||||||
|
|
||||||
|
If this value is ``"self"``, only consider replies where
|
||||||
|
reply and original Tweet are from the same user.
|
||||||
|
|
||||||
|
|
||||||
extractor.twitter.retweets
|
extractor.twitter.retweets
|
||||||
--------------------------
|
--------------------------
|
||||||
|
@ -50,12 +50,17 @@ class TwitterExtractor(Extractor):
|
|||||||
if not self.retweets and "retweeted_status_id_str" in tweet:
|
if not self.retweets and "retweeted_status_id_str" in tweet:
|
||||||
self.log.debug("Skipping %s (retweet)", tweet["id_str"])
|
self.log.debug("Skipping %s (retweet)", tweet["id_str"])
|
||||||
continue
|
continue
|
||||||
if not self.replies and "in_reply_to_user_id_str" in tweet:
|
|
||||||
self.log.debug("Skipping %s (reply)", tweet["id_str"])
|
|
||||||
continue
|
|
||||||
if not self.quoted and "quoted" in tweet:
|
if not self.quoted and "quoted" in tweet:
|
||||||
self.log.debug("Skipping %s (quoted tweet)", tweet["id_str"])
|
self.log.debug("Skipping %s (quoted tweet)", tweet["id_str"])
|
||||||
continue
|
continue
|
||||||
|
if "in_reply_to_user_id_str" in tweet and (
|
||||||
|
not self.replies or (
|
||||||
|
self.replies == "self" and
|
||||||
|
tweet["in_reply_to_user_id_str"] != tweet["user_id_str"]
|
||||||
|
)
|
||||||
|
):
|
||||||
|
self.log.debug("Skipping %s (reply)", tweet["id_str"])
|
||||||
|
continue
|
||||||
|
|
||||||
files = []
|
files = []
|
||||||
if "extended_entities" in tweet:
|
if "extended_entities" in tweet:
|
||||||
@ -452,6 +457,15 @@ class TwitterTweetExtractor(TwitterExtractor):
|
|||||||
"options": (("replies", False),),
|
"options": (("replies", False),),
|
||||||
"count": 0,
|
"count": 0,
|
||||||
}),
|
}),
|
||||||
|
# 'replies' to self (#1254)
|
||||||
|
("https://twitter.com/i/web/status/1424882930803908612", {
|
||||||
|
"options": (("replies", "self"),),
|
||||||
|
"count": 4,
|
||||||
|
}),
|
||||||
|
("https://twitter.com/i/web/status/1424898916156284928", {
|
||||||
|
"options": (("replies", "self"),),
|
||||||
|
"count": 0,
|
||||||
|
}),
|
||||||
# "quoted" option (#854)
|
# "quoted" option (#854)
|
||||||
("https://twitter.com/StobiesGalaxy/status/1270755918330896395", {
|
("https://twitter.com/StobiesGalaxy/status/1270755918330896395", {
|
||||||
"options": (("quoted", True),),
|
"options": (("quoted", True),),
|
||||||
|
Loading…
Reference in New Issue
Block a user