]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[plays] Fix extraction
authorcpm <costpermille@users.noreply.github.com>
Fri, 11 Nov 2016 20:48:19 +0000 (15:48 -0500)
committerSergey M․ <dstftw@gmail.com>
Sat, 12 Nov 2016 15:59:39 +0000 (22:59 +0700)
youtube_dl/extractor/plays.py

index c3c38cf4ac07787e520c7c2c7eac7da1ed2aa8b4..5ac0292fad5ff73adf89264e7f17087d2343f7a6 100644 (file)
@@ -10,12 +10,12 @@ from ..utils import int_or_none
 class PlaysTVIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?plays\.tv/video/(?P<id>[0-9a-f]{18})'
     _TEST = {
-        'url': 'http://plays.tv/video/56af17f56c95335490/when-you-outplay-the-azir-wall',
+        'url': 'https://plays.tv/video/56af17f56c95335490/when-you-outplay-the-azir-wall',
         'md5': 'dfeac1198506652b5257a62762cec7bc',
         'info_dict': {
             'id': '56af17f56c95335490',
             'ext': 'mp4',
-            'title': 'When you outplay the Azir wall',
+            'title': 'Bjergsen - When you outplay the Azir wall',
             'description': 'Posted by Bjergsen',
         }
     }
@@ -24,14 +24,11 @@ class PlaysTVIE(InfoExtractor):
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
-        title = self._og_search_title(webpage)
-        content = self._parse_json(
-            self._search_regex(
-                r'R\.bindContent\(({.+?})\);', webpage,
-                'content'), video_id)['content']
+        content = self._search_json_ld(webpage, video_id)
+        title = content['title']
         mpd_url, sources = re.search(
             r'(?s)<video[^>]+data-mpd="([^"]+)"[^>]*>(.+?)</video>',
-            content).groups()
+            webpage).groups()
         formats = self._extract_mpd_formats(
             self._proto_relative_url(mpd_url), video_id, mpd_id='DASH')
         for format_id, height, format_url in re.findall(r'<source\s+res="((\d+)h?)"\s+src="([^"]+)"', sources):