mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-22 18:22:21 +00:00
[goshgay] PEP8 and test for age_limit (#3220)
This commit is contained in:
parent
6f66eedc5d
commit
3dfd25b3aa
1 changed files with 3 additions and 2 deletions
|
@ -22,6 +22,7 @@ class GoshgayIE(InfoExtractor):
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'md5:089833a4790b5e103285a07337f245bf',
|
'title': 'md5:089833a4790b5e103285a07337f245bf',
|
||||||
'thumbnail': 're:http://.*\.jpg',
|
'thumbnail': 're:http://.*\.jpg',
|
||||||
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +33,8 @@ class GoshgayIE(InfoExtractor):
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
title = self._search_regex(r'class="video-title"><h1>(.+?)<', webpage, 'title')
|
title = self._search_regex(r'class="video-title"><h1>(.+?)<', webpage, 'title')
|
||||||
|
|
||||||
player_config = self._search_regex(r'jwplayer\("player"\)\.setup\(({.+?})\)', webpage, 'config settings',
|
player_config = self._search_regex(
|
||||||
fatal=True, flags=re.S)
|
r'(?s)jwplayer\("player"\)\.setup\(({.+?})\)', webpage, 'config settings')
|
||||||
player_vars = json.loads(player_config.replace("'", '"'))
|
player_vars = json.loads(player_config.replace("'", '"'))
|
||||||
width = str_to_int(player_vars.get('width'))
|
width = str_to_int(player_vars.get('width'))
|
||||||
height = str_to_int(player_vars.get('height'))
|
height = str_to_int(player_vars.get('height'))
|
||||||
|
|
Loading…
Reference in a new issue