1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-05 02:32:44 +01:00

[extractor/generic] Extract all soundcloud embeds (Closes #10179)

This commit is contained in:
Sergey M․ 2016-07-28 22:15:15 +07:00
parent 39eef54cf0
commit 94aae01548
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -71,6 +71,7 @@
from .kaltura import KalturaIE
from .eagleplatform import EaglePlatformIE
from .facebook import FacebookIE
from .soundcloud import SoundcloudIE
class GenericIE(InfoExtractor):
@ -1999,12 +2000,9 @@ def _playlist_from_matches(matches, getter=None, ie=None):
return self.url_result(myvi_url)
# Look for embedded soundcloud player
mobj = re.search(
r'<iframe\s+(?:[a-zA-Z0-9_-]+="[^"]+"\s+)*src="(?P<url>https?://(?:w\.)?soundcloud\.com/player[^"]+)"',
webpage)
if mobj is not None:
url = unescapeHTML(mobj.group('url'))
return self.url_result(url)
soundcloud_urls = SoundcloudIE._extract_urls(webpage)
if soundcloud_urls:
return _playlist_from_matches(soundcloud_urls, getter=unescapeHTML, ie=SoundcloudIE.ie_key())
# Look for embedded mtvservices player
mtvservices_url = MTVServicesEmbeddedIE._extract_url(webpage)