Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[twitter] Allow single dash to be used as username #21705

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion youtube_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ class TwitterIE(InfoExtractor):
'params': {
'skip_download': True, # requires ffmpeg
},
}, {
'url': 'https://twitter.com/-/status/1087791357756956680',
'only_matching': True,
}]

def _real_extract(self, url):
Expand All @@ -441,7 +444,7 @@ def _real_extract(self, url):
if 'twitter.com/account/suspended' in urlh.geturl():
raise ExtractorError('Account suspended by Twitter.', expected=True)

if user_id is None:
if user_id is None or user_id == '-':
mobj = re.match(self._VALID_URL, urlh.geturl())
user_id = mobj.group('user_id')

Expand Down