]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/newgrounds.py
9bea610c88a4ac48cc1b84ed5c3fae45789d643e
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
6 class NewgroundsIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?newgrounds\.com/(?:audio/listen|portal/view)/(?P<id>[0-9]+)'
9 'url': 'https://www.newgrounds.com/audio/listen/549479',
10 'md5': 'fe6033d297591288fa1c1f780386f07a',
14 'title': 'B7 - BusMode',
18 'url': 'https://www.newgrounds.com/portal/view/673111',
19 'md5': '3394735822aab2478c31b1004fe5e5bc',
24 'uploader': 'Squirrelman82',
28 def _real_extract(self
, url
):
29 media_id
= self
._match
_id
(url
)
30 webpage
= self
._download
_webpage
(url
, media_id
)
32 title
= self
._html
_search
_regex
(
33 r
'<title>([^>]+)</title>', webpage
, 'title')
35 uploader
= self
._html
_search
_regex
(
36 r
'Author\s*<a[^>]+>([^<]+)', webpage
, 'uploader', fatal
=False)
38 music_url
= self
._parse
_json
(self
._search
_regex
(
39 r
'"url":("[^"]+"),', webpage
, ''), media_id
)