mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[tapely] Catch SoundCloud tracks
This commit is contained in:
parent
1414df5ce2
commit
9e77c60c9a
1 changed files with 8 additions and 1 deletions
|
@ -17,6 +17,7 @@ class TapelyIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?tape\.ly/(?P<id>[A-Za-z0-9\-_]+)(?:/(?P<songnr>\d+))?'
|
_VALID_URL = r'https?://(?:www\.)?tape\.ly/(?P<id>[A-Za-z0-9\-_]+)(?:/(?P<songnr>\d+))?'
|
||||||
_API_URL = 'http://tape.ly/showtape?id={0:}'
|
_API_URL = 'http://tape.ly/showtape?id={0:}'
|
||||||
_S3_SONG_URL = 'http://mytape.s3.amazonaws.com/{0:}'
|
_S3_SONG_URL = 'http://mytape.s3.amazonaws.com/{0:}'
|
||||||
|
_SOUNDCLOUD_SONG_URL = 'http://api.soundcloud.com{0:}'
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
{
|
{
|
||||||
'url': 'http://tape.ly/my-grief-as-told-by-water',
|
'url': 'http://tape.ly/my-grief-as-told-by-water',
|
||||||
|
@ -68,9 +69,15 @@ def _real_extract(self, url):
|
||||||
})
|
})
|
||||||
entries.append(entry)
|
entries.append(entry)
|
||||||
elif song['source'] == 'YT':
|
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))
|
entry.update(self.url_result(yt_id, 'Youtube', video_id=yt_id))
|
||||||
entries.append(entry)
|
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:
|
else:
|
||||||
self.report_warning('Unknown song source: %s' % song['source'])
|
self.report_warning('Unknown song source: %s' % song['source'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue