Skip to content

Commit

Permalink
merge #5372: [twitter] match Tweet URLs with query parameters (#5371)
Browse files Browse the repository at this point in the history
fixes regression introduced in 40c0553
  • Loading branch information
mikf committed Mar 25, 2024
2 parents 15a4bc2 + 423599c commit d1d017a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gallery_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ 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+)/?(?:$|[?#])"
example = "https://twitter.com/USER/status/12345"

def __init__(self, match):
Expand Down
4 changes: 2 additions & 2 deletions test/results/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,15 @@
},

{
"#url" : "https://twitter.com/perrypumas/status/1065692031626829824",
"#url" : "https://twitter.com/perrypumas/status/1065692031626829824?s=20",
"#comment" : "video",
"#category": ("", "twitter", "tweet"),
"#class" : twitter.TwitterTweetExtractor,
"#pattern" : r"https://video.twimg.com/ext_tw_video/.+\.mp4\?tag=5",
},

{
"#url" : "https://twitter.com/playpokemon/status/1263832915173048321",
"#url" : "https://twitter.com/playpokemon/status/1263832915173048321/",
"#comment" : "content with emoji, newlines, hashtags (#338)",
"#category": ("", "twitter", "tweet"),
"#class" : twitter.TwitterTweetExtractor,
Expand Down

0 comments on commit d1d017a

Please sign in to comment.