1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-15 11:17:16 +08:00

[Gaskrank] Add new extractor - fixed all but one quantified code issues

This commit is contained in:
motophil 2017-01-22 19:51:40 +01:00
parent 2c88df8d54
commit c08326ccdf

View File

@ -7,6 +7,7 @@ from ..utils import js_to_json
class GaskrankIE(InfoExtractor):
"""InfoExtractor for gaskrank.tv"""
_VALID_URL = r'https?://(?:www\.)?gaskrank\.tv/tv/(?P<categories>[^/]+)/(?P<id>[^/]+)\.html?'
_TEST = {
'url': 'http://www.gaskrank.tv/tv/motorrad-fun/strike-einparken-durch-anfaenger-crash-mit-groesserem-flurschaden.htm',
@ -22,8 +23,10 @@ class GaskrankIE(InfoExtractor):
}
def _real_extract(self, url):
"""extract information from gaskrank.tv"""
def fix_json(code):
return re.sub(r'}[\s]*?,[\s]*?}', r'}}', js_to_json(code))
"""Removes trailing comma in json: {{},} --> {{}}"""
return re.sub(r',[\s]*?}', r'}', js_to_json(code))
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)