mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-27 00:22:09 +00:00
[orf] Fix segments extraction (Closes #2501)
This commit is contained in:
parent
2c39b0c695
commit
2acc1f8f50
1 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
HEADRequest,
|
HEADRequest,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
|
ExtractorError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +36,15 @@ def _real_extract(self, url):
|
||||||
data_json = self._search_regex(
|
data_json = self._search_regex(
|
||||||
r'initializeAdworx\((.+?)\);\n', webpage, 'video info')
|
r'initializeAdworx\((.+?)\);\n', webpage, 'video info')
|
||||||
all_data = json.loads(data_json)
|
all_data = json.loads(data_json)
|
||||||
sdata = all_data[0]['values']['segments']
|
|
||||||
|
def get_segments(all_data):
|
||||||
|
for data in all_data:
|
||||||
|
if data['name'] == 'Tracker::EPISODE_DETAIL_PAGE_OVER_PROGRAM':
|
||||||
|
return data['values']['segments']
|
||||||
|
|
||||||
|
sdata = get_segments(all_data)
|
||||||
|
if not sdata:
|
||||||
|
raise ExtractorError('Unable to extract segments')
|
||||||
|
|
||||||
def quality_to_int(s):
|
def quality_to_int(s):
|
||||||
m = re.search('([0-9]+)', s)
|
m = re.search('([0-9]+)', s)
|
||||||
|
|
Loading…
Reference in a new issue