3 from .common
import InfoExtractor
6 class SoundgasmIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_-]+)/(?P<display_id>[0-9a-zA-Z_-]+)'
10 'url': 'http://soundgasm.net/u/ytdl/Piano-sample',
11 'md5': '010082a2c802c5275bb00030743e75ad',
13 'id': '88abd86ea000cafe98f96321b23cc1206cbcbcc9',
15 'title': 'Piano sample',
16 'description': 'Royalty Free Sample Music',
21 def _real_extract(self
, url
):
22 mobj
= self
._match
_valid
_url
(url
)
23 display_id
= mobj
.group('display_id')
25 webpage
= self
._download
_webpage
(url
, display_id
)
27 audio_url
= self
._html
_search
_regex
(
28 r
'(?s)m4a\s*:\s*(["\'])(?P
<url
>(?
:(?
!\
1).)+)\
1', webpage,
29 'audio URL
', group='url
')
31 title = self._search_regex(
32 r'<div
[^
>]+\bclass
=["\']jp-title[^>]+>([^<]+)',
33 webpage, 'title', default=display_id)
35 description = self._html_search_regex(
36 (r'(?s)<div[^>]+\bclass=["\']jp
-description
[^
>]+>(.+?
)</div
>',
37 r'(?s
)<li
>Description
:\
s(.*?
)<\
/li
>'),
38 webpage, 'description
', fatal=False)
40 audio_id = self._search_regex(
41 r'/([^
/]+)\
.m4a
', audio_url, 'audio
id', default=display_id)
45 'display_id
': display_id,
49 'description
': description,
50 'uploader
': mobj.group('user
'),
54 class SoundgasmProfileIE(InfoExtractor):
55 IE_NAME = 'soundgasm
:profile
'
56 _VALID_URL = r'https?
://(?
:www\
.)?soundgasm\
.net
/u
/(?P
<id>[^
/]+)/?
(?
:\
#.*)?$'
58 'url': 'http://soundgasm.net/u/ytdl',
65 def _real_extract(self
, url
):
66 profile_id
= self
._match
_id
(url
)
68 webpage
= self
._download
_webpage
(url
, profile_id
)
71 self
.url_result(audio_url
, 'Soundgasm')
72 for audio_url
in re
.findall(rf
'href="([^"]+/u/{profile_id}/[^"]+)', webpage
)]
74 return self
.playlist_result(entries
, profile_id
)