[rentv] Fix extraction
authoreinstein95 <einstein95@users.noreply.github.com>
Thu, 11 Jan 2018 18:01:02 +0000 (07:01 +1300)
committerSergey M․ <dstftw@gmail.com>
Sat, 21 Apr 2018 16:22:25 +0000 (23:22 +0700)
youtube_dl/extractor/rentv.py

index d338b3a933cf10fb50621ea4d785d4e83324466c..df528b09e01abc1d53c146f021ac2ea9341e697c 100644 (file)
@@ -26,9 +26,20 @@ class RENTVIE(InfoExtractor):
     def _real_extract(self, url):
         video_id = self._match_id(url)
         webpage = self._download_webpage('http://ren.tv/player/' + video_id, video_id)
-        jw_config = self._parse_json(self._search_regex(
-            r'config\s*=\s*({.+});', webpage, 'jw config'), video_id)
-        return self._parse_jwplayer_data(jw_config, video_id, m3u8_id='hls')
+        config = self._parse_json(self._search_regex(
+            r'config\s*=\s*({.+});', webpage, 'config'), video_id)
+        formats = []
+        for video in config.get('src', ''):
+            formats.append({
+                'url': video.get('src', '')
+            })
+        self._sort_formats(formats)
+        return {
+            'id': video_id,
+            'formats': formats,
+            'title': config.get('title', ''),
+            'thumbnail': config.get('image', '')
+        }
 
 
 class RENTVArticleIE(InfoExtractor):