diff options
author | Naglis Jonaitis <njonaitis@gmail.com> | 2014-10-01 21:53:45 +0300 |
---|---|---|
committer | Naglis Jonaitis <njonaitis@gmail.com> | 2014-10-01 21:53:45 +0300 |
commit | 9e77c60c9ad83c70e0f943404507fb2d2486113a (patch) | |
tree | d20332c1e53da785aaafbc101caf94300f31bfeb /youtube_dl | |
parent | 1414df5ce24af3b915db5d630969862847349f24 (diff) |
[tapely] Catch SoundCloud tracks
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/tapely.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube_dl/extractor/tapely.py b/youtube_dl/extractor/tapely.py index 2c1178b1b..77e056242 100644 --- a/youtube_dl/extractor/tapely.py +++ b/youtube_dl/extractor/tapely.py @@ -17,6 +17,7 @@ class TapelyIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tape\.ly/(?P<id>[A-Za-z0-9\-_]+)(?:/(?P<songnr>\d+))?' _API_URL = 'http://tape.ly/showtape?id={0:}' _S3_SONG_URL = 'http://mytape.s3.amazonaws.com/{0:}' + _SOUNDCLOUD_SONG_URL = 'http://api.soundcloud.com{0:}' _TESTS = [ { 'url': 'http://tape.ly/my-grief-as-told-by-water', @@ -68,9 +69,15 @@ class TapelyIE(InfoExtractor): }) entries.append(entry) elif song['source'] == 'YT': - _, _, yt_id = song['filename'].split('/') + self.to_screen('YouTube video detected') + yt_id = song['filename'].replace('/youtube/', '') entry.update(self.url_result(yt_id, 'Youtube', video_id=yt_id)) entries.append(entry) + elif song['source'] == 'SC': + self.to_screen('SoundCloud song detected') + sc_url = self._SOUNDCLOUD_SONG_URL.format(song['filename']) + entry.update(self.url_result(sc_url, 'Soundcloud')) + entries.append(entry) else: self.report_warning('Unknown song source: %s' % song['source']) |