summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/yle_areena.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/yle_areena.py')
-rw-r--r--yt_dlp/extractor/yle_areena.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/yt_dlp/extractor/yle_areena.py b/yt_dlp/extractor/yle_areena.py
index 796f7f3..ef9e968 100644
--- a/yt_dlp/extractor/yle_areena.py
+++ b/yt_dlp/extractor/yle_areena.py
@@ -11,6 +11,7 @@ from ..utils import (
class YleAreenaIE(InfoExtractor):
_VALID_URL = r'https?://areena\.yle\.fi/(?P<id>[\d-]+)'
+ _GEO_COUNTRIES = ['FI']
_TESTS = [
{
'url': 'https://areena.yle.fi/1-4371942',
@@ -19,7 +20,7 @@ class YleAreenaIE(InfoExtractor):
'id': '0_a3tjk92c',
'ext': 'mp4',
'title': 'Pouchit',
- 'description': 'md5:d487309c3abbe5650265bbd1742d2f82',
+ 'description': 'md5:01071d7056ceec375f63960f90c35366',
'series': 'Modernit miehet',
'season': 'Season 1',
'season_number': 1,
@@ -87,8 +88,8 @@ class YleAreenaIE(InfoExtractor):
})
# Example title: 'K1, J2: Pouchit | Modernit miehet'
- series, season_number, episode_number, episode = self._search_regex(
- r'K(?P<season_no>[\d]+),\s*J(?P<episode_no>[\d]+):?\s*\b(?P<episode>[^|]+)\s*|\s*(?P<series>.+)',
+ season_number, episode_number, episode, series = self._search_regex(
+ r'K(?P<season_no>\d+),\s*J(?P<episode_no>\d+):?\s*\b(?P<episode>[^|]+)\s*|\s*(?P<series>.+)',
info.get('title') or '', 'episode metadata', group=('season_no', 'episode_no', 'episode', 'series'),
default=(None, None, None, None))
description = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'description', 'fin'), expected_type=str)
@@ -110,10 +111,12 @@ class YleAreenaIE(InfoExtractor):
'ie_key': KalturaIE.ie_key(),
}
else:
+ formats, subs = self._extract_m3u8_formats_and_subtitles(
+ video_data['data']['ongoing_ondemand']['manifest_url'], video_id, 'mp4', m3u8_id='hls')
+ self._merge_subtitles(subs, target=subtitles)
info_dict = {
'id': video_id,
- 'formats': self._extract_m3u8_formats(
- video_data['data']['ongoing_ondemand']['manifest_url'], video_id, 'mp4', m3u8_id='hls'),
+ 'formats': formats,
}
return {
@@ -129,6 +132,6 @@ class YleAreenaIE(InfoExtractor):
or int_or_none(episode_number)),
'thumbnails': traverse_obj(info, ('thumbnails', ..., {'url': 'url'})),
'age_limit': traverse_obj(video_data, ('data', 'ongoing_ondemand', 'content_rating', 'age_restriction'), expected_type=int_or_none),
- 'subtitles': subtitles,
+ 'subtitles': subtitles or None,
'release_date': unified_strdate(traverse_obj(video_data, ('data', 'ongoing_ondemand', 'start_time'), expected_type=str)),
}