]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[abcnews] Add support for embed URLs
authorTithen-Firion <tithen.firion.0@gmail.com>
Wed, 26 Apr 2017 19:21:17 +0000 (21:21 +0200)
committerSergey M․ <dstftw@gmail.com>
Sun, 28 May 2017 00:06:29 +0000 (07:06 +0700)
youtube_dl/extractor/abcnews.py

index 4f56c4c11935ee85a9412a39de20138bb83cc33d..e18be2497f4d934b67bf8dcbedf7787762adb8bf 100644 (file)
@@ -12,7 +12,11 @@ from ..compat import compat_urlparse
 
 class AbcNewsVideoIE(AMPIE):
     IE_NAME = 'abcnews:video'
-    _VALID_URL = r'https?://abcnews\.go\.com/[^/]+/video/(?P<display_id>[0-9a-z-]+)-(?P<id>\d+)'
+    _VALID_URL = r'''(?x)
+        https?://abcnews\.go\.com/
+            (?:[^/]+/video/(?P<display_id>[0-9a-z-]+)-|
+               video/embed\?id=)
+       (?P<id>\d+)'''
 
     _TESTS = [{
         'url': 'http://abcnews.go.com/ThisWeek/video/week-exclusive-irans-foreign-minister-zarif-20411932',
@@ -29,6 +33,17 @@ class AbcNewsVideoIE(AMPIE):
             # m3u8 download
             'skip_download': True,
         },
+    }, {
+        'url': 'http://abcnews.go.com/video/embed?id=46979033',
+        'md5': 'd19d160cfa8372fc197f406d4821dd9f',
+        'info_dict': {
+            'id': '46979033',
+            'ext': 'flv',
+            'title': 'Nikki Haley reacts to French election results',
+            'description': 'md5:df1b5ad1b8ad76c4d4e01d3c67d6b38e',
+            'duration': 274,
+            'thumbnail': r're:^https?://.*\.jpg$',
+        },
     }, {
         'url': 'http://abcnews.go.com/2020/video/2020-husband-stands-teacher-jail-student-affairs-26119478',
         'only_matching': True,