Skip to content

Commit

Permalink
[twitter] match '/photo/' Tweet URLs (#5443)
Browse files Browse the repository at this point in the history
fixes regression introduced in 40c0553
  • Loading branch information
mikf committed Apr 6, 2024
1 parent 3346a37 commit 647a87d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gallery_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,8 @@ def tweets(self):
class TwitterTweetExtractor(TwitterExtractor):
"""Extractor for individual tweets"""
subcategory = "tweet"
pattern = BASE_PATTERN + r"/([^/?#]+|i/web)/status/(\d+)/?(?:$|[?#])"
pattern = (BASE_PATTERN + r"/([^/?#]+|i/web)/status/(\d+)"
r"/?(?:$|\?|#|photo/)")
example = "https://twitter.com/USER/status/12345"

def __init__(self, match):
Expand Down
7 changes: 7 additions & 0 deletions test/results/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,13 @@
"#count" : 5,
},

{
"#url" : "https://twitter.com/supernaturepics/status/604341487988576256/photo/1",
"#comment" : "/photo/ URL (#5443)",
"#category": ("", "twitter", "tweet"),
"#class" : twitter.TwitterTweetExtractor,
},

{
"#url" : "https://twitter.com/morino_ya/status/1392763691599237121",
"#comment" : "retweet with missing media entities (#1555)",
Expand Down

0 comments on commit 647a87d

Please sign in to comment.