]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/filmon.py
[ie/jiosaavn] Support playlists (#9622)
[yt-dlp.git] / yt_dlp / extractor / filmon.py
index f775fe0baebe47eebfd1f9bcd0eea7c76623abd9..0cd18f49479aad7738f8237ac59a37e72480c5bb 100644 (file)
@@ -1,11 +1,6 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
-from ..compat import (
-    compat_str,
-    compat_HTTPError,
-)
+from ..compat import compat_str
+from ..networking.exceptions import HTTPError
 from ..utils import (
     qualities,
     strip_or_none,
@@ -43,8 +38,8 @@ def _real_extract(self, url):
                 'https://www.filmon.com/api/vod/movie?id=%s' % video_id,
                 video_id)['response']
         except ExtractorError as e:
-            if isinstance(e.cause, compat_HTTPError):
-                errmsg = self._parse_json(e.cause.read().decode(), video_id)['reason']
+            if isinstance(e.cause, HTTPError):
+                errmsg = self._parse_json(e.cause.response.read().decode(), video_id)['reason']
                 raise ExtractorError('%s said: %s' % (self.IE_NAME, errmsg), expected=True)
             raise
 
@@ -68,7 +63,6 @@ def _real_extract(self, url):
                 'quality': QUALITY(stream.get('quality')),
                 'protocol': 'm3u8_native',
             })
-        self._sort_formats(formats)
 
         thumbnails = []
         poster = response.get('poster', {})
@@ -128,8 +122,8 @@ def _real_extract(self, url):
             channel_data = self._download_json(
                 'http://www.filmon.com/api-v2/channel/' + channel_id, channel_id)['data']
         except ExtractorError as e:
-            if isinstance(e.cause, compat_HTTPError):
-                errmsg = self._parse_json(e.cause.read().decode(), channel_id)['message']
+            if isinstance(e.cause, HTTPError):
+                errmsg = self._parse_json(e.cause.response.read().decode(), channel_id)['message']
                 raise ExtractorError('%s said: %s' % (self.IE_NAME, errmsg), expected=True)
             raise
 
@@ -156,7 +150,6 @@ def _real_extract(self, url):
                 'ext': 'mp4',
                 'quality': QUALITY(quality),
             })
-        self._sort_formats(formats)
 
         thumbnails = []
         for name, width, height in self._THUMBNAIL_RES:
@@ -170,7 +163,7 @@ def _real_extract(self, url):
         return {
             'id': channel_id,
             'display_id': channel_data.get('alias'),
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'description': channel_data.get('description'),
             'thumbnails': thumbnails,
             'formats': formats,