aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/ard.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-03-08 12:48:50 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-03-08 12:58:26 +0530
commit409cdd1ec9659e06e67da05c3e9ffba0ce05f727 (patch)
treef71605cf25fe1e2d8c37c0efad3c9cf994a40273 /yt_dlp/extractor/ard.py
parent992f9a730b49fd36fc422be8d802f98ebcdce418 (diff)
downloadhypervideo-pre-409cdd1ec9659e06e67da05c3e9ffba0ce05f727.tar.lz
hypervideo-pre-409cdd1ec9659e06e67da05c3e9ffba0ce05f727.tar.xz
hypervideo-pre-409cdd1ec9659e06e67da05c3e9ffba0ce05f727.zip
[ard] Fix valid URL
Partial fix for #2975
Diffstat (limited to 'yt_dlp/extractor/ard.py')
-rw-r--r--yt_dlp/extractor/ard.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/yt_dlp/extractor/ard.py b/yt_dlp/extractor/ard.py
index 4ad5d6ddd..7ea339b39 100644
--- a/yt_dlp/extractor/ard.py
+++ b/yt_dlp/extractor/ard.py
@@ -407,8 +407,9 @@ class ARDBetaMediathekIE(ARDMediathekBaseIE):
(?:(?:beta|www)\.)?ardmediathek\.de/
(?:(?P<client>[^/]+)/)?
(?:player|live|video|(?P<playlist>sendung|sammlung))/
- (?:(?P<display_id>[^?#]+)/)?
- (?P<id>(?(playlist)|Y3JpZDovL)[a-zA-Z0-9]+)'''
+ (?:(?P<display_id>(?(playlist)[^?#]+?|[^?#]+))/)?
+ (?P<id>(?(playlist)|Y3JpZDovL)[a-zA-Z0-9]+)
+ (?(playlist)/(?P<season>\d+)?/?(?:[?#]|$))'''
_TESTS = [{
'url': 'https://www.ardmediathek.de/mdr/video/die-robuste-roswita/Y3JpZDovL21kci5kZS9iZWl0cmFnL2Ntcy84MWMxN2MzZC0wMjkxLTRmMzUtODk4ZS0wYzhlOWQxODE2NGI/',
@@ -437,6 +438,13 @@ class ARDBetaMediathekIE(ARDMediathekBaseIE):
'upload_date': '20211108',
},
}, {
+ 'url': 'https://www.ardmediathek.de/sendung/beforeigners/beforeigners/staffel-1/Y3JpZDovL2Rhc2Vyc3RlLmRlL2JlZm9yZWlnbmVycw/1',
+ 'playlist_count': 6,
+ 'info_dict': {
+ 'id': 'Y3JpZDovL2Rhc2Vyc3RlLmRlL2JlZm9yZWlnbmVycw',
+ 'title': 'beforeigners/beforeigners/staffel-1',
+ },
+ }, {
'url': 'https://beta.ardmediathek.de/ard/video/Y3JpZDovL2Rhc2Vyc3RlLmRlL3RhdG9ydC9mYmM4NGM1NC0xNzU4LTRmZGYtYWFhZS0wYzcyZTIxNGEyMDE',
'only_matching': True,
}, {
@@ -561,14 +569,15 @@ class ARDBetaMediathekIE(ARDMediathekBaseIE):
break
pageNumber = pageNumber + 1
- return self.playlist_result(entries, playlist_title=display_id)
+ return self.playlist_result(entries, playlist_id, playlist_title=display_id)
def _real_extract(self, url):
- video_id, display_id, playlist_type, client = self._match_valid_url(url).group(
- 'id', 'display_id', 'playlist', 'client')
+ video_id, display_id, playlist_type, client, season_number = self._match_valid_url(url).group(
+ 'id', 'display_id', 'playlist', 'client', 'season')
display_id, client = display_id or video_id, client or 'ard'
if playlist_type:
+ # TODO: Extract only specified season
return self._ARD_extract_playlist(url, video_id, display_id, client, playlist_type)
player_page = self._download_json(