This commit is contained in:
Aditya Kumar Mishra 2026-07-31 17:44:23 +00:00 committed by GitHub
commit a47d46569d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,7 @@ from .periscope import (
class TwitterBaseIE(InfoExtractor):
_API_BASE = 'https://api.twitter.com/1.1/'
_BASE_REGEX = r'https?://(?:(?:www|m(?:obile)?)\.)?twitter\.com/'
_BASE_REGEX = r'https?://(?:(?:www|m(?:obile)?)\.)?(?:twitter|x)\.com/' # FIX: support x.com domain
_GUEST_TOKEN = None
def _extract_variant_formats(self, variant, video_id):
@ -178,6 +178,12 @@ class TwitterCardIE(InfoExtractor):
}, {
'url': 'https://twitter.com/i/videos/752274308186120192',
'only_matching': True,
}, {
'url': 'https://x.com/i/videos/752274308186120192',
'only_matching': True,
}, {
'url': 'https://mobile.x.com/i/videos/752274308186120192',
'only_matching': True,
},
]
@ -427,6 +433,12 @@ class TwitterIE(TwitterBaseIE):
# poll4choice_video card
'url': 'https://twitter.com/SouthamptonFC/status/1347577658079641604',
'only_matching': True,
}, {
'url': 'https://x.com/SouthamptonFC/status/1347577658079641604',
'only_matching': True,
}, {
'url': 'https://mobile.x.com/SouthamptonFC/status/1347577658079641604',
'only_matching': True,
}]
def _real_extract(self, url):