|
|
|
@ -284,16 +284,7 @@ class ArteTVPlaylistIE(ArteTVBaseIE):
|
|
|
|
|
},
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
|
lang, playlist_id = self._match_valid_url(url).group('lang', 'id')
|
|
|
|
|
webpage = self._download_webpage(url, playlist_id)
|
|
|
|
|
|
|
|
|
|
unescape_func = lambda jstring: jstring.replace('\\"', '"').replace('\\\\', '\\')
|
|
|
|
|
playlist_data = self._search_json(r'\$L23.+?', webpage, 'series data',
|
|
|
|
|
playlist_id,
|
|
|
|
|
end_pattern=r'\],\[\[',
|
|
|
|
|
transform_source=unescape_func)
|
|
|
|
|
|
|
|
|
|
def _entries(self, playlist_data, playlist_id):
|
|
|
|
|
playlist_item_filter = lambda _, v: re.match(rf'collection_(?:videos|subcollection)_{playlist_id}', v['code'])
|
|
|
|
|
collections = traverse_obj(playlist_data,
|
|
|
|
|
('data',
|
|
|
|
@ -303,20 +294,32 @@ class ArteTVPlaylistIE(ArteTVBaseIE):
|
|
|
|
|
'data',
|
|
|
|
|
...))
|
|
|
|
|
|
|
|
|
|
entries = [{
|
|
|
|
|
'_type': 'url_transparent',
|
|
|
|
|
'url': f'https://www.arte.tv{video['url']}',
|
|
|
|
|
'ie_key': ArteTVIE.ie_key(),
|
|
|
|
|
'id': video.get('id'),
|
|
|
|
|
'title': video.get('title'),
|
|
|
|
|
'alt_title': video.get('subtitle'),
|
|
|
|
|
'duration': int_or_none(traverse_obj(video, ('duration'))),
|
|
|
|
|
'age_limit': int_or_none(traverse_obj(video, 'ageRating')),
|
|
|
|
|
} for video in collections]
|
|
|
|
|
|
|
|
|
|
return self.playlist_result(entries, playlist_id,
|
|
|
|
|
traverse_obj(playlist_data, ('data', 'metadata', 'title')),
|
|
|
|
|
traverse_obj(playlist_data, ('data', 'metadata', 'description')))
|
|
|
|
|
for video in collections:
|
|
|
|
|
yield {
|
|
|
|
|
'_type': 'url_transparent',
|
|
|
|
|
'url': 'https://www.arte.tv' + video['url'],
|
|
|
|
|
'ie_key': ArteTVIE.ie_key(),
|
|
|
|
|
'id': video['id'],
|
|
|
|
|
'title': video.get('title'),
|
|
|
|
|
'alt_title': video.get('subtitle'),
|
|
|
|
|
'duration': int_or_none(traverse_obj(video, ('duration'))),
|
|
|
|
|
'age_limit': int_or_none(traverse_obj(video, 'ageRating')),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
|
lang, playlist_id = self._match_valid_url(url).group('lang', 'id')
|
|
|
|
|
webpage = self._download_webpage(url, playlist_id)
|
|
|
|
|
|
|
|
|
|
unescape_func = lambda jstring: jstring.replace('\\"', '"').replace('\\\\', '\\')
|
|
|
|
|
json_data = self._search_json(r'\$L23.+?', webpage, 'series data',
|
|
|
|
|
playlist_id,
|
|
|
|
|
end_pattern=r'\],\[\[',
|
|
|
|
|
transform_source=unescape_func)
|
|
|
|
|
|
|
|
|
|
return self.playlist_result(self._entries(json_data, playlist_id),
|
|
|
|
|
playlist_id,
|
|
|
|
|
traverse_obj(json_data, ('data', 'metadata', 'title')),
|
|
|
|
|
traverse_obj(json_data, ('data', 'metadata', 'description')))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ArteTVCategoryIE(ArteTVBaseIE):
|
|
|
|
|