From c08326ccdf467acf534315922f876724c66a3ab9 Mon Sep 17 00:00:00 2001 From: motophil Date: Sun, 22 Jan 2017 19:51:40 +0100 Subject: [PATCH] [Gaskrank] Add new extractor - fixed all but one quantified code issues --- youtube_dl/extractor/gaskrank.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/gaskrank.py b/youtube_dl/extractor/gaskrank.py index aa99f8dd0..8ece658bf 100644 --- a/youtube_dl/extractor/gaskrank.py +++ b/youtube_dl/extractor/gaskrank.py @@ -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[^/]+)/(?P[^/]+)\.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)