[spreaker] embedded player support

This commit is contained in:
Lauren Liberda 2021-04-12 14:45:18 +02:00
parent a4d58a6adf
commit 66e93478d8
2 changed files with 23 additions and 0 deletions

View file

@ -136,6 +136,7 @@ from .pulsembed import PulsEmbedIE
from .arcpublishing import ArcPublishingIE from .arcpublishing import ArcPublishingIE
from .medialaan import MedialaanIE from .medialaan import MedialaanIE
from .simplecast import SimplecastIE from .simplecast import SimplecastIE
from .spreaker import SpreakerIE
class GenericIE(InfoExtractor): class GenericIE(InfoExtractor):
@ -2301,6 +2302,20 @@ class GenericIE(InfoExtractor):
}, },
'playlist_mincount': 52, 'playlist_mincount': 52,
}, },
{
# Spreaker embed
'url': 'https://socjalizm.fm/jak-bedzie-w-socjalizmie/praca/',
'info_dict': {
'id': '44098221',
'ext': 'mp3',
'title': 'Jak będzie w socjalizmie? Praca.',
'uploader': 'Socjalizm FM',
'description': 'md5:d2833c41296a996153353890c329e1af',
'upload_date': '20210329',
'uploader_id': '13705223',
'timestamp': 1617024666,
},
},
] ]
def report_following_redirect(self, new_url): def report_following_redirect(self, new_url):
@ -2739,6 +2754,7 @@ class GenericIE(InfoExtractor):
ArcPublishingIE, ArcPublishingIE,
MedialaanIE, MedialaanIE,
SimplecastIE, SimplecastIE,
SpreakerIE,
): ):
try: try:
ie_key = embie.ie_key() ie_key = embie.ie_key()

View file

@ -2,6 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import itertools import itertools
import re
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import compat_str from ..compat import compat_str
@ -108,6 +109,12 @@ class SpreakerIE(InfoExtractor):
'only_matching': True, 'only_matching': True,
}] }]
@staticmethod
def _extract_urls(webpage, **kw):
return ['https://api.spreaker.com/episode/%s' % mobj.group('id') for mobj in re.finditer(
r'<iframe\b[^>]+src=(["\'])(?:(?:https?)?:)?//widget\.spreaker\.com/player\?(?:.+?&)?episode_id=(?P<id>\d+)',
webpage)]
def _real_extract(self, url): def _real_extract(self, url):
episode_id = self._match_id(url) episode_id = self._match_id(url)
data = self._download_json( data = self._download_json(