1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-01-06 15:01:25 +00:00

[ie/cda] Support mobile URLs (#15398)

Closes #15397
Authored by: seproDev
This commit is contained in:
sepro
2025-12-25 02:25:03 +01:00
committed by GitHub
parent 9bf040dc6f
commit 6d92f87ddc

View File

@@ -27,7 +27,7 @@ from ..utils.traversal import traverse_obj
class CDAIE(InfoExtractor): class CDAIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?cda\.pl/video|ebd\.cda\.pl/[0-9]+x[0-9]+)/(?P<id>[0-9a-z]+)' _VALID_URL = r'https?://(?:(?:(?:www|m)\.)?cda\.pl/video|ebd\.cda\.pl/[0-9]+x[0-9]+)/(?P<id>[0-9a-z]+)'
_NETRC_MACHINE = 'cdapl' _NETRC_MACHINE = 'cdapl'
_BASE_URL = 'https://www.cda.pl' _BASE_URL = 'https://www.cda.pl'
@@ -110,6 +110,9 @@ class CDAIE(InfoExtractor):
}, { }, {
'url': 'http://ebd.cda.pl/0x0/5749950c', 'url': 'http://ebd.cda.pl/0x0/5749950c',
'only_matching': True, 'only_matching': True,
}, {
'url': 'https://m.cda.pl/video/617297677',
'only_matching': True,
}] }]
def _download_age_confirm_page(self, url, video_id, *args, **kwargs): def _download_age_confirm_page(self, url, video_id, *args, **kwargs):
@@ -367,35 +370,35 @@ class CDAIE(InfoExtractor):
class CDAFolderIE(InfoExtractor): class CDAFolderIE(InfoExtractor):
_MAX_PAGE_SIZE = 36 _MAX_PAGE_SIZE = 36
_VALID_URL = r'https?://(?:www\.)?cda\.pl/(?P<channel>[\w-]+)/folder/(?P<id>\d+)' _VALID_URL = r'https?://(?:(?:www|m)\.)?cda\.pl/(?P<channel>[\w-]+)/folder/(?P<id>\d+)'
_TESTS = [ _TESTS = [{
{ 'url': 'https://www.cda.pl/domino264/folder/31188385',
'url': 'https://www.cda.pl/domino264/folder/31188385', 'info_dict': {
'info_dict': { 'id': '31188385',
'id': '31188385', 'title': 'SERIA DRUGA',
'title': 'SERIA DRUGA',
},
'playlist_mincount': 13,
}, },
{ 'playlist_mincount': 13,
'url': 'https://www.cda.pl/smiechawaTV/folder/2664592/vfilm', }, {
'info_dict': { 'url': 'https://www.cda.pl/smiechawaTV/folder/2664592/vfilm',
'id': '2664592', 'info_dict': {
'title': 'VideoDowcipy - wszystkie odcinki', 'id': '2664592',
}, 'title': 'VideoDowcipy - wszystkie odcinki',
'playlist_mincount': 71,
}, },
{ 'playlist_mincount': 71,
'url': 'https://www.cda.pl/DeliciousBeauty/folder/19129979/vfilm', }, {
'info_dict': { 'url': 'https://www.cda.pl/DeliciousBeauty/folder/19129979/vfilm',
'id': '19129979', 'info_dict': {
'title': 'TESTY KOSMETYKÓW', 'id': '19129979',
}, 'title': 'TESTY KOSMETYKÓW',
'playlist_mincount': 139, },
}, { 'playlist_mincount': 139,
'url': 'https://www.cda.pl/FILMY-SERIALE-ANIME-KRESKOWKI-BAJKI/folder/18493422', }, {
'only_matching': True, 'url': 'https://www.cda.pl/FILMY-SERIALE-ANIME-KRESKOWKI-BAJKI/folder/18493422',
}] 'only_matching': True,
}, {
'url': 'https://m.cda.pl/smiechawaTV/folder/2664592/vfilm',
'only_matching': True,
}]
def _real_extract(self, url): def _real_extract(self, url):
folder_id, channel = self._match_valid_url(url).group('id', 'channel') folder_id, channel = self._match_valid_url(url).group('id', 'channel')