mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 10:24:33 +01:00
[soundgasm] reformat code
This commit is contained in:
parent
ee8e4aac78
commit
e679814281
@ -12,29 +12,26 @@ class SoundgasmIE(InfoExtractor):
|
|||||||
r'https?://(?:www\.)?soundgasm\.net(?::80)?/u/' + \
|
r'https?://(?:www\.)?soundgasm\.net(?::80)?/u/' + \
|
||||||
r'(?P<user>[0-9a-zA-Z_-]+)/(?P<display_id>[0-9a-zA-Z_-]+)'
|
r'(?P<user>[0-9a-zA-Z_-]+)/(?P<display_id>[0-9a-zA-Z_-]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://soundgasm.net/u/ytdl/Piano-sample',
|
'url': 'http://soundgasm.net/u/ytdl/Piano-sample',
|
||||||
'md5': '010082a2c802c5275bb00030743e75ad',
|
'md5': '010082a2c802c5275bb00030743e75ad',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '88abd86ea000cafe98f96321b23cc1206cbcbcc9',
|
'id': '88abd86ea000cafe98f96321b23cc1206cbcbcc9',
|
||||||
'ext': 'm4a',
|
'ext': 'm4a',
|
||||||
'title': 'Piano sample',
|
'title': 'Piano sample',
|
||||||
'description': 'Royalty Free Sample Music',
|
'description': 'Royalty Free Sample Music',
|
||||||
'uploader': 'ytdl',
|
'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://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):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
@ -47,7 +44,8 @@ class SoundgasmIE(InfoExtractor):
|
|||||||
'audio URL', group='url')
|
'audio URL', group='url')
|
||||||
|
|
||||||
if mobj.group('archive'):
|
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(
|
title = self._search_regex(
|
||||||
r'<div[^>]+\bclass=["\']jp-title[^>]+>([^<]+)',
|
r'<div[^>]+\bclass=["\']jp-title[^>]+>([^<]+)',
|
||||||
@ -82,17 +80,15 @@ class SoundgasmProfileIE(InfoExtractor):
|
|||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'ytdl',
|
'id': 'ytdl',
|
||||||
},
|
},
|
||||||
'playlist_count': 1,
|
'playlist_count': 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'http://web.archive.org/web/20181218222843/' +
|
'url': 'http://web.archive.org/web/20181218222843/https://soundgasm.net/u/ytdl',
|
||||||
'https://soundgasm.net/u/ytdl',
|
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'ytdl',
|
'id': 'ytdl'
|
||||||
},
|
},
|
||||||
'playlist_count': 1,
|
'playlist_count': 1
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
profile_id = self._match_id(url)
|
profile_id = self._match_id(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user