1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-22 22:47:55 +01:00

[myspace] Handle non-playable songs

I'm adding this because sometimes there is a song page, but you cannot play it.
Example: https://myspace.com/starset2/music/song/let-it-die-maniac-agenda-remix-bonus-track-95799916-106964439
It will be useful for downloading whole album with songs like this.
This commit is contained in:
Tithen-Firion 2014-11-30 19:36:24 +01:00 committed by Jaime Marquínez Ferrándiz
parent 03fd72d996
commit 1940fadd53

View File

@ -53,9 +53,17 @@ class MySpaceIE(InfoExtractor):
if mobj.group('mediatype').startswith('music/song'): if mobj.group('mediatype').startswith('music/song'):
# songs don't store any useful info in the 'context' variable # songs don't store any useful info in the 'context' variable
song_data = self._search_regex(
r'''<button.*data-song-id=(["\'])%s\1.*''' % video_id,
webpage, 'song_data', default=None, group=0)
if song_data is None:
self.to_screen(
'%s: No downloadable song on this page' % video_id)
return
def search_data(name): def search_data(name):
return self._search_regex( return self._search_regex(
r'data-%s="(.*?)"' % name, webpage, name) r'''data-%s=([\'"])(.*?)\1''' % name,
song_data, name, default='', group=2)
streamUrl = search_data('stream-url') streamUrl = search_data('stream-url')
info = { info = {
'id': video_id, 'id': video_id,