mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-29 19:47:54 +01:00
Handling cases where the site removed a video but do not 404
This commit is contained in:
parent
8f91c383bf
commit
5b8203f184
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
get_element_by_id
|
get_element_by_id
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -50,11 +51,15 @@ class TV5UnisCaIE(InfoExtractor):
|
|||||||
get_element_by_id('__NEXT_DATA__', webpage), display_id) \
|
get_element_by_id('__NEXT_DATA__', webpage), display_id) \
|
||||||
.get('props').get('apolloState')
|
.get('props').get('apolloState')
|
||||||
|
|
||||||
info_dict = self._json_ld(
|
metadata = next_data_dict.get(
|
||||||
next_data_dict['$ArtisanBlocksPageMetaData:50.blockConfiguration.pageMetaDataConfiguration']['jsonLd'],
|
'$ArtisanBlocksPageMetaData:50.blockConfiguration.pageMetaDataConfiguration', None
|
||||||
display_id
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not metadata:
|
||||||
|
raise ExtractorError('Video removed or not found.', expected=True)
|
||||||
|
|
||||||
|
info_dict = self._json_ld(metadata.get('jsonLd'), display_id)
|
||||||
|
|
||||||
if info_dict.get('season', ''):
|
if info_dict.get('season', ''):
|
||||||
info_dict['title'] = ' - '.join((info_dict.get('season', ''), info_dict.get('episode', '')))
|
info_dict['title'] = ' - '.join((info_dict.get('season', ''), info_dict.get('episode', '')))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user