]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[twitter:card] Relax _VALID_URL (closes #11225)
authorSergey M․ <dstftw@gmail.com>
Fri, 18 Nov 2016 18:49:13 +0000 (01:49 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 18 Nov 2016 18:49:13 +0000 (01:49 +0700)
youtube_dl/extractor/twitter.py

index 3411fcf7eb753154aa034474641b5327be7ea127..ac0b221b4f5ab02c33f1776389cba849bf00ae2b 100644 (file)
@@ -25,7 +25,7 @@ class TwitterBaseIE(InfoExtractor):
 
 class TwitterCardIE(TwitterBaseIE):
     IE_NAME = 'twitter:card'
-    _VALID_URL = r'https?://(?:www\.)?twitter\.com/i/(?:cards/tfw/v1|videos/tweet)/(?P<id>\d+)'
+    _VALID_URL = r'https?://(?:www\.)?twitter\.com/i/(?:cards/tfw/v1|videos(?:/tweet)?)/(?P<id>\d+)'
     _TESTS = [
         {
             'url': 'https://twitter.com/i/cards/tfw/v1/560070183650213889',
@@ -84,6 +84,9 @@ class TwitterCardIE(TwitterBaseIE):
                 'title': 'Twitter web player',
                 'thumbnail': 're:^https?://.*\.jpg',
             },
+        }, {
+            'url': 'https://twitter.com/i/videos/752274308186120192',
+            'only_matching': True,
         },
     ]