[ie/spreaker] enhancement: added support for podcast and feed pages

This commit is contained in:
subrat-lima 2024-09-10 14:13:33 +05:30
parent d1c4d88b2d
commit 7fff49c913
2 changed files with 42 additions and 1 deletions

View File

@ -1929,8 +1929,10 @@ from .spotify import (
SpotifyShowIE, SpotifyShowIE,
) )
from .spreaker import ( from .spreaker import (
SpreakerFeedPageIE,
SpreakerIE, SpreakerIE,
SpreakerPageIE, SpreakerPageIE,
SpreakerPodcastPageIE,
SpreakerShowIE, SpreakerShowIE,
SpreakerShowPageIE, SpreakerShowPageIE,
) )

View File

@ -83,7 +83,9 @@ class SpreakerIE(InfoExtractor):
'view_count': int, 'view_count': int,
'like_count': int, 'like_count': int,
'comment_count': int, 'comment_count': int,
'series': 'Success With Music (SWM)', 'series': 'Success With Music | SWM',
'thumbnail': r're:https?://.*\.jpg',
'creators': ['SWM'],
}, },
}, { }, {
'url': 'https://api.spreaker.com/download/episode/12534508/swm_ep15_how_to_market_your_music_part_2.mp3', 'url': 'https://api.spreaker.com/download/episode/12534508/swm_ep15_how_to_market_your_music_part_2.mp3',
@ -102,6 +104,7 @@ class SpreakerIE(InfoExtractor):
class SpreakerPageIE(InfoExtractor): class SpreakerPageIE(InfoExtractor):
# NOTE:the sample test doesnt work, need to futher investigate
_VALID_URL = r'https?://(?:www\.)?spreaker\.com/user/[^/]+/(?P<id>[^/?#&]+)' _VALID_URL = r'https?://(?:www\.)?spreaker\.com/user/[^/]+/(?P<id>[^/?#&]+)'
_TESTS = [{ _TESTS = [{
'url': 'https://www.spreaker.com/user/9780658/swm-ep15-how-to-market-your-music-part-2', 'url': 'https://www.spreaker.com/user/9780658/swm-ep15-how-to-market-your-music-part-2',
@ -156,6 +159,8 @@ class SpreakerShowIE(InfoExtractor):
class SpreakerShowPageIE(InfoExtractor): class SpreakerShowPageIE(InfoExtractor):
# NOTE:the sample test doesnt work, need to futher investigate
# layout has changed
_VALID_URL = r'https?://(?:www\.)?spreaker\.com/show/(?P<id>[^/?#&]+)' _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',
@ -170,3 +175,37 @@ class SpreakerShowPageIE(InfoExtractor):
return self.url_result( return self.url_result(
f'https://api.spreaker.com/show/{show_id}', f'https://api.spreaker.com/show/{show_id}',
ie=SpreakerShowIE.ie_key(), video_id=show_id) ie=SpreakerShowIE.ie_key(), video_id=show_id)
class SpreakerPodcastPageIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spreaker\.com/podcast/[\w-]+--(?P<id>[\d]{3,})'
_TESTS = [{
'url': 'https://www.spreaker.com/podcast/health-wealth--5918323',
'info_dict': {
'id': '5918323',
},
'playlist_mincount': 60,
}]
def _real_extract(self, url):
show_id = self._match_id(url)
return self.url_result(
f'https://api.spreaker.com/show/{show_id}',
ie=SpreakerShowIE.ie_key(), video_id=show_id)
class SpreakerFeedPageIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spreaker\.com/show/(?P<id>[\d]+)/episodes/feed'
_TESTS = [{
'url': 'https://www.spreaker.com/show/5887186/episodes/feed',
'info_dict': {
'id': '5887186',
},
'playlist_mincount': 290,
}]
def _real_extract(self, url):
show_id = self._match_id(url)
return self.url_result(
f'https://api.spreaker.com/show/{show_id}',
ie=SpreakerShowIE.ie_key(), video_id=show_id)