mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-11-14 22:37:59 +09:00
follow coding conventions
This commit is contained in:
parent
f6c4b9da47
commit
c848538aff
@ -56,13 +56,13 @@ class NewgroundsIE(InfoExtractor):
|
|||||||
media_id = self._match_id(url)
|
media_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, media_id)
|
webpage = self._download_webpage(url, media_id)
|
||||||
|
|
||||||
paths = url.split('/')
|
paths = url.split('/')
|
||||||
if paths[-3] == 'audio':
|
if paths[-3] == 'audio':
|
||||||
isAudio = True
|
isAudio = True
|
||||||
else:
|
else:
|
||||||
isAudio = False
|
isAudio = False
|
||||||
|
|
||||||
if isAudio:
|
if isAudio:
|
||||||
media_url = self._parse_json(self._search_regex(
|
media_url = self._parse_json(self._search_regex(
|
||||||
r'"url"\s*:\s*("[^"]+"),', webpage, ''), media_id)
|
r'"url"\s*:\s*("[^"]+"),', webpage, ''), media_id)
|
||||||
@ -71,7 +71,7 @@ class NewgroundsIE(InfoExtractor):
|
|||||||
(r'(?s)<h4[^>]*>(.+?)</h4>.*?<em>\s*Author\s*</em>',
|
(r'(?s)<h4[^>]*>(.+?)</h4>.*?<em>\s*Author\s*</em>',
|
||||||
r'(?:Author|Writer)\s*<a[^>]+>([^<]+)'), webpage, 'uploader',
|
r'(?:Author|Writer)\s*<a[^>]+>([^<]+)'), webpage, 'uploader',
|
||||||
fatal=False)
|
fatal=False)
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': media_url,
|
'url': media_url,
|
||||||
'format_id': 'source',
|
'format_id': 'source',
|
||||||
@ -92,10 +92,9 @@ class NewgroundsIE(InfoExtractor):
|
|||||||
formats.append({
|
formats.append({
|
||||||
'url': sources[source][i]['src'],
|
'url': sources[source][i]['src'],
|
||||||
'format_id': source,
|
'format_id': source,
|
||||||
'height': int(source[:-2]) # 1080p -> 1080
|
'height': int(source[:-2]) # 1080p -> 1080
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
title = self._html_search_regex(
|
title = self._html_search_regex(
|
||||||
r'<title>([^>]+)</title>', webpage, 'title')
|
r'<title>([^>]+)</title>', webpage, 'title')
|
||||||
timestamp = unified_timestamp(self._html_search_regex(
|
timestamp = unified_timestamp(self._html_search_regex(
|
||||||
@ -116,7 +115,7 @@ class NewgroundsIE(InfoExtractor):
|
|||||||
|
|
||||||
self._check_formats(formats, media_id)
|
self._check_formats(formats, media_id)
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': media_id,
|
'id': media_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
Loading…
Reference in New Issue
Block a user