about summary refs log tree commit diff
path: root/youtube_dl/extractor/myspace.py
diff options
context:
space:
mode:
authorTithen-Firion <Tithen-Firion@users.noreply.github.com>2014-11-30 20:00:16 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-12-01 00:10:12 +0100
commit3266f0c68e9512f226043d868630a7179f45d390 (patch)
treee5becb4f14dacaaa31ed3461152e824292b8ff01 /youtube_dl/extractor/myspace.py
parent1940fadd5307a11fd64ab26c43fbc31764c213a1 (diff)
downloadyoutube-dl-3266f0c68e9512f226043d868630a7179f45d390.tar.gz
youtube-dl-3266f0c68e9512f226043d868630a7179f45d390.tar.xz
youtube-dl-3266f0c68e9512f226043d868630a7179f45d390.zip
[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
Diffstat (limited to 'youtube_dl/extractor/myspace.py')
-rw-r--r--youtube_dl/extractor/myspace.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/youtube_dl/extractor/myspace.py b/youtube_dl/extractor/myspace.py
index 843e1f24a..dd0a0415e 100644
--- a/youtube_dl/extractor/myspace.py
+++ b/youtube_dl/extractor/myspace.py
@@ -7,6 +7,7 @@ from .common import InfoExtractor
 from ..compat import (
     compat_str,
 )
+from ..utils import ExtractorError
 
 
 class MySpaceIE(InfoExtractor):
@@ -65,6 +66,18 @@ class MySpaceIE(InfoExtractor):
                     r'''data-%s=([\'"])(.*?)\1''' % name,
                     song_data, name, default='', group=2)
             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 = {
                 'id': video_id,
                 'title': self._og_search_title(webpage),