]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[extractor/generic] Improve rtmp support (closes #11993)
authorSergey M․ <dstftw@gmail.com>
Mon, 6 Feb 2017 16:23:40 +0000 (23:23 +0700)
committerSergey M․ <dstftw@gmail.com>
Mon, 6 Feb 2017 16:23:40 +0000 (23:23 +0700)
youtube_dl/extractor/generic.py

index 4156cf27dbbf80159e3e503150e7e62c3211dd0b..1fb0e0673753e8a061f1451fe6ae234f0c31433d 100644 (file)
@@ -29,6 +29,7 @@ from ..utils import (
     UnsupportedError,
     xpath_text,
 )
+from .commonprotocols import RtmpIE
 from .brightcove import (
     BrightcoveLegacyIE,
     BrightcoveNewIE,
@@ -2487,6 +2488,8 @@ class GenericIE(InfoExtractor):
         def check_video(vurl):
             if YoutubeIE.suitable(vurl):
                 return True
+            if RtmpIE.suitable(vurl):
+                return True
             vpath = compat_urlparse.urlparse(vurl).path
             vext = determine_ext(vpath)
             return '.' in vpath and vext not in ('swf', 'png', 'jpg', 'srt', 'sbv', 'sub', 'vtt', 'ttml', 'js')
@@ -2584,6 +2587,10 @@ class GenericIE(InfoExtractor):
                 entries.append(self.url_result(video_url, 'Youtube'))
                 continue
 
+            if RtmpIE.suitable(video_url):
+                entries.append(self.url_result(video_url, RtmpIE.ie_key()))
+                continue
+
             # here's a fun little line of code for you:
             video_id = os.path.splitext(video_id)[0]