Compare commits

..

2 Commits

Author SHA1 Message Date
Esokrates
bc56c066ce Changes from isort 2023-11-01 22:15:54 +01:00
Esokrates
2121e472ba Address feedback from second review 2023-11-01 22:04:49 +01:00

View File

@ -4,15 +4,16 @@ import re
from .common import InfoExtractor from .common import InfoExtractor
from ..networking import HEADRequest from ..networking import HEADRequest
from ..utils import ( from ..utils import (
InAdvancePagedList,
clean_html, clean_html,
determine_ext, determine_ext,
float_or_none, float_or_none,
InAdvancePagedList,
int_or_none, int_or_none,
join_nonempty, join_nonempty,
make_archive_id,
mimetype2ext,
orderedSet, orderedSet,
remove_end, remove_end,
make_archive_id,
smuggle_url, smuggle_url,
strip_jsonp, strip_jsonp,
try_call, try_call,
@ -337,11 +338,10 @@ class ORFRadioIE(InfoExtractor):
class ORFPodcastIE(InfoExtractor): class ORFPodcastIE(InfoExtractor):
IE_NAME = 'orf:podcast' IE_NAME = 'orf:podcast'
_STATION_RE = '|'.join(map(re.escape, (
_STATION_RE = 'noe|wie|bgl|ooe|stm|ktn|sbg|tir|vbg|oe3|oe1|fm4|tv' 'bgl', 'fm4', 'ktn', 'noe', 'oe1', 'oe3',
'ooe', 'sbg', 'stm', 'tir', 'tv', 'vbg', 'wie')))
_VALID_URL = rf'https?://sound\.orf\.at/podcast/(?P<station>{_STATION_RE})/(?P<show>[\w-]+)/(?P<id>[\w-]+)' _VALID_URL = rf'https?://sound\.orf\.at/podcast/(?P<station>{_STATION_RE})/(?P<show>[\w-]+)/(?P<id>[\w-]+)'
_TESTS = [{ _TESTS = [{
'url': 'https://sound.orf.at/podcast/oe3/fruehstueck-bei-mir/nicolas-stockhammer-15102023', 'url': 'https://sound.orf.at/podcast/oe3/fruehstueck-bei-mir/nicolas-stockhammer-15102023',
'md5': '526a5700e03d271a1505386a8721ab9b', 'md5': '526a5700e03d271a1505386a8721ab9b',
@ -366,6 +366,7 @@ class ORFPodcastIE(InfoExtractor):
'vcodec': 'none', 'vcodec': 'none',
**traverse_obj(data, ('payload', { **traverse_obj(data, ('payload', {
'url': ('enclosures', 0, 'url'), 'url': ('enclosures', 0, 'url'),
'ext': ('enclosures', 0, 'type', {mimetype2ext}),
'title': 'title', 'title': 'title',
'description': ('description', {clean_html}), 'description': ('description', {clean_html}),
'duration': ('duration', {functools.partial(float_or_none, scale=1000)}), 'duration': ('duration', {functools.partial(float_or_none, scale=1000)}),