diff options
author | Jesús <heckyel@hyperbola.info> | 2021-10-18 15:24:21 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-10-18 15:24:21 -0500 |
commit | 5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e (patch) | |
tree | 65209bc739db35e31f1c9b5b868eb5df4fe12ae3 /hypervideo_dl/extractor/arte.py | |
parent | 27fe903c511691c078942bef5ee9a05a43b15c8f (diff) | |
download | hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.lz hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.xz hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.zip |
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/arte.py')
-rw-r--r-- | hypervideo_dl/extractor/arte.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/hypervideo_dl/extractor/arte.py b/hypervideo_dl/extractor/arte.py index 03abdbf..296b169 100644 --- a/hypervideo_dl/extractor/arte.py +++ b/hypervideo_dl/extractor/arte.py @@ -6,11 +6,11 @@ import re from .common import InfoExtractor from ..compat import ( compat_str, - compat_urlparse, ) from ..utils import ( ExtractorError, int_or_none, + parse_qs, qualities, try_get, unified_strdate, @@ -49,7 +49,7 @@ class ArteTVIE(ArteTVBaseIE): }] def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) + mobj = self._match_valid_url(url) video_id = mobj.group('id') lang = mobj.group('lang') or mobj.group('lang_2') @@ -150,7 +150,6 @@ class ArteTVIE(ArteTVBaseIE): format = { 'format_id': format_id, - 'preference': -10 if f.get('videoFormat') == 'M3U8' else None, 'language_preference': lang_pref, 'format_note': '%s, %s' % (f.get('versionCode'), f.get('versionLibelle')), 'width': int_or_none(f.get('width')), @@ -168,12 +167,14 @@ class ArteTVIE(ArteTVBaseIE): formats.append(format) - self._sort_formats(formats) + # For this extractor, quality only represents the relative quality + # with respect to other formats with the same resolution + self._sort_formats(formats, ('res', 'quality')) return { 'id': player_info.get('VID') or video_id, 'title': title, - 'description': player_info.get('VDE'), + 'description': player_info.get('VDE') or player_info.get('V7T'), 'upload_date': unified_strdate(upload_date_str), 'thumbnail': player_info.get('programImage') or player_info.get('VTU', {}).get('IUR'), 'formats': formats, @@ -203,7 +204,7 @@ class ArteTVEmbedIE(InfoExtractor): webpage)] def _real_extract(self, url): - qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query) + qs = parse_qs(url) json_url = qs['json_url'][0] video_id = ArteTVIE._match_id(json_url) return self.url_result( @@ -226,7 +227,7 @@ class ArteTVPlaylistIE(ArteTVBaseIE): }] def _real_extract(self, url): - lang, playlist_id = re.match(self._VALID_URL, url).groups() + lang, playlist_id = self._match_valid_url(url).groups() collection = self._download_json( '%s/collectionData/%s/%s?source=videos' % (self._API_BASE, lang, playlist_id), playlist_id) |