[ie/spreaker] fixed SpreakerShowPageIE extractor

This commit is contained in:
subrat-lima 2024-09-10 15:55:14 +05:30
parent 7fff49c913
commit 794e3d372c

View file

@ -159,26 +159,26 @@ def _real_extract(self, url):
class SpreakerShowPageIE(InfoExtractor): class SpreakerShowPageIE(InfoExtractor):
# NOTE:the sample test doesnt work, need to futher investigate _VALID_URL = r'https?://(?:www\.)?spreaker\.com/show/(?P<id>[^/?#&]+)(?!/episodes/feed)'
# layout has changed
_VALID_URL = r'https?://(?:www\.)?spreaker\.com/show/(?P<id>[^/?#&]+)'
_TESTS = [{ _TESTS = [{
'url': 'https://www.spreaker.com/show/success-with-music', 'url': 'https://www.spreaker.com/show/success-with-music',
'only_matching': True, 'info_dict': {
'id': '2317431',
},
'playlist_mincount': 30,
}] }]
def _real_extract(self, url): def _real_extract(self, url):
display_id = self._match_id(url) display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id) webpage = self._download_webpage(url, display_id)
show_id = self._search_regex( redirect_url = self._og_search_property('url', webpage, 'redirect url')
r'show_id\s*:\s*(?P<id>\d+)', webpage, 'show id')
return self.url_result( return self.url_result(
f'https://api.spreaker.com/show/{show_id}', redirect_url,
ie=SpreakerShowIE.ie_key(), video_id=show_id) SpreakerPodcastPageIE)
class SpreakerPodcastPageIE(InfoExtractor): class SpreakerPodcastPageIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spreaker\.com/podcast/[\w-]+--(?P<id>[\d]{3,})' _VALID_URL = r'https?://(?:www\.)?spreaker\.com/podcast/[\w-]+--(?P<id>[\d]+)'
_TESTS = [{ _TESTS = [{
'url': 'https://www.spreaker.com/podcast/health-wealth--5918323', 'url': 'https://www.spreaker.com/podcast/health-wealth--5918323',
'info_dict': { 'info_dict': {