[tvn24] Extract video id from the data-video-id attribute
Extracting video identifier from the data-share-params attribute has proven to be brittle: the attribute is bogus for some videos and completely missing for some others. Extract the identifier from the numeric part of the data-video-id attribute instead.
This commit is contained in:
parent
2f16501b8d
commit
27d70ea99e
@ -88,15 +88,9 @@ class TVN24IE(InfoExtractor):
|
|||||||
iterator = itertools.islice(iterator, 0, 1)
|
iterator = itertools.islice(iterator, 0, 1)
|
||||||
for match in iterator:
|
for match in iterator:
|
||||||
video_elt = match.group('video')
|
video_elt = match.group('video')
|
||||||
video_id = None
|
video_id = self._search_regex(
|
||||||
share_params = extract_json('share-params', 'share params', fatal=False)
|
r'^(\d{6,})($|_)',
|
||||||
if share_params:
|
extract_value('video-id', 'video id'), 'video id')
|
||||||
video_id = share_params['id']
|
|
||||||
if video_id == '[id]':
|
|
||||||
# toteraz.pl videos have bogus share-params
|
|
||||||
video_id = None
|
|
||||||
if video_id is None:
|
|
||||||
video_id = extract_value('video-id', 'video id')
|
|
||||||
try:
|
try:
|
||||||
title = match.group('title')
|
title = match.group('title')
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user