Skip to content

Commit

Permalink
[twitter] use filter:links (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jul 27, 2022
1 parent 8d0801a commit 1540d0e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gallery_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,7 @@ def tweets(self):
if not self.textonly:
# try to search for media-only tweets
tweet = None
for tweet in self.api.search_adaptive(query + (
" (filter:images OR"
" filter:native_video OR"
" card_name:animated_gif)")):
for tweet in self.api.search_adaptive(query + " filter:links"):
yield tweet
if tweet is not None:
return
Expand Down

2 comments on commit 1540d0e

@afterdelight
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this do?

@mikf
Copy link
Owner Author

@mikf mikf commented on 1540d0e Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It filters out tweets that do not contain whatever Twitter defines as "link".
Seems to work better than the previously used filters.

Please sign in to comment.