Skip to content

Commit 250d351

Browse files
committed
[twitter] prioritize tweet type checks (mikf#3439)
Do not consider a tweet seen before applying 'retweet', 'quote' and 'reply' checks. Otherwise the original tweets will also be skipped if the "derivative" tweets and the original tweets are from the same user.
1 parent 2d7d80d commit 250d351

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gallery_dl/extractor/twitter.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ def items(self):
7575
else:
7676
data = tweet
7777

78-
if seen_tweets is not None:
79-
if data["id_str"] in seen_tweets:
80-
continue
81-
seen_tweets.add(data["id_str"])
82-
8378
if not self.retweets and "retweeted_status_id_str" in data:
8479
self.log.debug("Skipping %s (retweet)", data["id_str"])
8580
continue
@@ -97,6 +92,13 @@ def items(self):
9792
self.log.debug("Skipping %s (reply)", data["id_str"])
9893
continue
9994

95+
if seen_tweets is not None:
96+
if data["id_str"] in seen_tweets:
97+
self.log.debug(
98+
"Skipping %s (previously seen)", data["id_str"])
99+
continue
100+
seen_tweets.add(data["id_str"])
101+
100102
files = []
101103
if "extended_entities" in data:
102104
self._extract_media(

0 commit comments

Comments
 (0)