mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2025-01-10 07:07:55 +01:00
[AnimeLab] Fix video extraction
This commit is contained in:
parent
4cfa18985c
commit
b377af1de5
@ -101,7 +101,7 @@ class AnimeLabIE(AnimeLabBaseIE):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, display_id, 'Downloading requested URL')
|
webpage = self._download_webpage(url, display_id, 'Downloading requested URL')
|
||||||
|
|
||||||
video_collection = self.get_data_from_js(webpage, 'VideoCollection', display_id)
|
video_collection = self.get_data_from_js(webpage, 'AnimeLabApp.VideoCollection', display_id)
|
||||||
position = int_or_none(self._search_regex(r'playlistPosition\s*?=\s*?(\d+)', webpage, 'Playlist Position'))
|
position = int_or_none(self._search_regex(r'playlistPosition\s*?=\s*?(\d+)', webpage, 'Playlist Position'))
|
||||||
|
|
||||||
raw_data = video_collection[position]['videoEntry']
|
raw_data = video_collection[position]['videoEntry']
|
||||||
@ -119,20 +119,24 @@ class AnimeLabIE(AnimeLabBaseIE):
|
|||||||
if None not in title_parts:
|
if None not in title_parts:
|
||||||
title = '%s - %s %s - %s' % title_parts
|
title = '%s - %s %s - %s' % title_parts
|
||||||
else:
|
else:
|
||||||
title = self._search_regex(r'AnimeLab - (.*) - Watch Online', webpage, 'Title from html')
|
title = episode_name
|
||||||
|
|
||||||
description = raw_data.get('synopsis') or self._og_search_description(webpage, default=None)
|
description = raw_data.get('synopsis') or self._og_search_description(webpage, default=None)
|
||||||
|
|
||||||
duration = int_or_none(raw_data.get('duration'))
|
duration = int_or_none(raw_data.get('duration'))
|
||||||
|
|
||||||
thumbnail_data = raw_data.get('thumbnailInstance', {})
|
thumbnail_data = raw_data.get('images', [])
|
||||||
image_data = thumbnail_data.get('imageInfo', {})
|
thumbnail_data = thumbnail_data[0] if len(thumbnail_data) > 0 else None
|
||||||
thumbnails = [{
|
if thumbnail_data is not None:
|
||||||
'id': str_or_none(thumbnail_data.get('id')),
|
image_data = thumbnail_data.get('imageInfo', {})
|
||||||
'url': image_data.get('fullPath'),
|
thumbnails = [{
|
||||||
'width': image_data.get('width'),
|
'id': str_or_none(thumbnail_data.get('id')),
|
||||||
'height': image_data.get('height'),
|
'url': image_data.get('fullPath'),
|
||||||
}]
|
'width': image_data.get('width'),
|
||||||
|
'height': image_data.get('height'),
|
||||||
|
}]
|
||||||
|
else:
|
||||||
|
thumbnails = None
|
||||||
|
|
||||||
season_data = raw_data.get('season', {})
|
season_data = raw_data.get('season', {})
|
||||||
season = str_or_none(season_data.get('name'))
|
season = str_or_none(season_data.get('name'))
|
||||||
|
Loading…
Reference in New Issue
Block a user