]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[pornhub] Add support for DASH formats (closes #20403)
authorSergey M․ <dstftw@gmail.com>
Fri, 22 Mar 2019 18:09:33 +0000 (01:09 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 22 Mar 2019 18:09:33 +0000 (01:09 +0700)
youtube_dl/extractor/pornhub.py

index 3a474c17970bbd087de187bf6059e9900551f61f..bf8f0be886eba04cad55e18d65dc3f3d1179d95d 100644 (file)
@@ -14,6 +14,7 @@ from ..compat import (
 )
 from .openload import PhantomJSwrapper
 from ..utils import (
+    determine_ext,
     ExtractorError,
     int_or_none,
     orderedSet,
@@ -275,6 +276,10 @@ class PornHubIE(PornHubBaseIE):
                     r'/(\d{6}/\d{2})/', video_url, 'upload data', default=None)
                 if upload_date:
                     upload_date = upload_date.replace('/', '')
+            if determine_ext(video_url) == 'mpd':
+                formats.extend(self._extract_mpd_formats(
+                    video_url, video_id, mpd_id='dash', fatal=False))
+                continue
             tbr = None
             mobj = re.search(r'(?P<height>\d+)[pP]?_(?P<tbr>\d+)[kK]', video_url)
             if mobj: