[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)
|
||||
for match in iterator:
|
||||
video_elt = match.group('video')
|
||||
video_id = None
|
||||
share_params = extract_json('share-params', 'share params', fatal=False)
|
||||
if share_params:
|
||||
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')
|
||||
video_id = self._search_regex(
|
||||
r'^(\d{6,})($|_)',
|
||||
extract_value('video-id', 'video id'), 'video id')
|
||||
try:
|
||||
title = match.group('title')
|
||||
except IndexError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user