mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[myspace] Redirect to other extractors
There are many songs just linked from Vevo/YouTube to MySpace. Vevo example: https://myspace.com/threedaysgrace/music/song/animal-i-have-become-28400208-28218041 YouTube example: https://myspace.com/starset2/music/song/first-light-95799905-106964426
This commit is contained in:
parent
1940fadd53
commit
3266f0c68e
2 changed files with 14 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_str,
|
compat_str,
|
||||||
)
|
)
|
||||||
|
from ..utils import ExtractorError
|
||||||
|
|
||||||
|
|
||||||
class MySpaceIE(InfoExtractor):
|
class MySpaceIE(InfoExtractor):
|
||||||
|
@ -65,6 +66,18 @@ def search_data(name):
|
||||||
r'''data-%s=([\'"])(.*?)\1''' % name,
|
r'''data-%s=([\'"])(.*?)\1''' % name,
|
||||||
song_data, name, default='', group=2)
|
song_data, name, default='', group=2)
|
||||||
streamUrl = search_data('stream-url')
|
streamUrl = search_data('stream-url')
|
||||||
|
if not streamUrl:
|
||||||
|
vevo_id = search_data('vevo-id')
|
||||||
|
youtube_id = search_data('youtube-id')
|
||||||
|
if vevo_id:
|
||||||
|
self.to_screen('Vevo video detected: %s' % vevo_id)
|
||||||
|
return self.url_result('vevo:%s' % vevo_id, ie='Vevo')
|
||||||
|
elif youtube_id:
|
||||||
|
self.to_screen('Youtube video detected: %s' % youtube_id)
|
||||||
|
return self.url_result(youtube_id, ie='Youtube')
|
||||||
|
else:
|
||||||
|
raise ExtractorError(
|
||||||
|
'Found song but don\'t know how to download it')
|
||||||
info = {
|
info = {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': self._og_search_title(webpage),
|
'title': self._og_search_title(webpage),
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
class VevoIE(InfoExtractor):
|
class VevoIE(InfoExtractor):
|
||||||
"""
|
"""
|
||||||
Accepts urls from vevo.com or in the format 'vevo:{id}'
|
Accepts urls from vevo.com or in the format 'vevo:{id}'
|
||||||
(currently used by MTVIE)
|
(currently used by MTVIE and MySpaceIE)
|
||||||
"""
|
"""
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
(?:https?://www\.vevo\.com/watch/(?:[^/]+/(?:[^/]+/)?)?|
|
(?:https?://www\.vevo\.com/watch/(?:[^/]+/(?:[^/]+/)?)?|
|
||||||
|
|
Loading…
Reference in a new issue