diff --git a/youtube_dl/extractor/soundgasm.py b/youtube_dl/extractor/soundgasm.py index 5f811444a..f9db15ec9 100644 --- a/youtube_dl/extractor/soundgasm.py +++ b/youtube_dl/extractor/soundgasm.py @@ -12,29 +12,26 @@ class SoundgasmIE(InfoExtractor): r'https?://(?:www\.)?soundgasm\.net(?::80)?/u/' + \ r'(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)' _TESTS = [{ - 'url': 'http://soundgasm.net/u/ytdl/Piano-sample', - 'md5': '010082a2c802c5275bb00030743e75ad', - 'info_dict': { - 'id': '88abd86ea000cafe98f96321b23cc1206cbcbcc9', - 'ext': 'm4a', - 'title': 'Piano sample', - 'description': 'Royalty Free Sample Music', - 'uploader': 'ytdl', - } - }, - { - 'url': 'http://web.archive.org/web/20181218221507/' + - 'https://soundgasm.net/u/ytdl/Piano-sample', - 'md5': '010082a2c802c5275bb00030743e75ad', - 'info_dict': { - 'id': '88abd86ea000cafe98f96321b23cc1206cbcbcc9', - 'ext': 'm4a', - 'title': 'Piano sample', - 'description': 'Royalty Free Sample Music', - 'uploader': 'ytdl', - } + 'url': 'http://soundgasm.net/u/ytdl/Piano-sample', + 'md5': '010082a2c802c5275bb00030743e75ad', + 'info_dict': { + 'id': '88abd86ea000cafe98f96321b23cc1206cbcbcc9', + 'ext': 'm4a', + 'title': 'Piano sample', + 'description': 'Royalty Free Sample Music', + 'uploader': 'ytdl' } - ] + }, { + 'url': 'http://web.archive.org/web/20181218221507/https://soundgasm.net/u/ytdl/Piano-sample', + 'md5': '010082a2c802c5275bb00030743e75ad', + 'info_dict': { + 'id': '88abd86ea000cafe98f96321b23cc1206cbcbcc9', + 'ext': 'm4a', + 'title': 'Piano sample', + 'description': 'Royalty Free Sample Music', + 'uploader': 'ytdl' + } + }] def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) @@ -47,7 +44,8 @@ class SoundgasmIE(InfoExtractor): 'audio URL', group='url') if mobj.group('archive'): - audio_url = audio_url[:41] + "if_" + audio_url[41:] + pos = mobj.span('archive')[1] - 1 + audio_url = audio_url[:pos] + "if_" + audio_url[pos:] title = self._search_regex( r']+\bclass=["\']jp-title[^>]+>([^<]+)', @@ -82,17 +80,15 @@ class SoundgasmProfileIE(InfoExtractor): 'info_dict': { 'id': 'ytdl', }, - 'playlist_count': 1, - }, + 'playlist_count': 1 + }, { - 'url': 'http://web.archive.org/web/20181218222843/' + - 'https://soundgasm.net/u/ytdl', + 'url': 'http://web.archive.org/web/20181218222843/https://soundgasm.net/u/ytdl', 'info_dict': { - 'id': 'ytdl', + 'id': 'ytdl' }, - 'playlist_count': 1, - } - ] + 'playlist_count': 1 + }] def _real_extract(self, url): profile_id = self._match_id(url)