X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/848723ea972c09f28787db91d8c06e98a274ab89..acb27260e91c30efdb413d0a6fa6279adcc98469:/youtube_dl/extractor/fourtube.py?ds=sidebyside diff --git a/youtube_dl/extractor/fourtube.py b/youtube_dl/extractor/fourtube.py index 8db7fc6..b22ce2a 100644 --- a/youtube_dl/extractor/fourtube.py +++ b/youtube_dl/extractor/fourtube.py @@ -8,8 +8,8 @@ from ..utils import ( unified_strdate, str_to_int, parse_duration, + clean_html, ) -from youtube_dl.utils import clean_html class FourTubeIE(InfoExtractor): @@ -55,7 +55,7 @@ class FourTubeIE(InfoExtractor): description = self._html_search_meta('description', webpage, 'description') if description: upload_date = self._search_regex(r'Published Date: (\d{2} [a-zA-Z]{3} \d{4})', description, 'upload date', - fatal=False) + fatal=False) if upload_date: upload_date = unified_strdate(upload_date) view_count = self._search_regex(r'Views: ([\d,\.]+)', description, 'view count', fatal=False) @@ -65,9 +65,9 @@ class FourTubeIE(InfoExtractor): token_url = "http://tkn.4tube.com/{0}/desktop/{1}".format(media_id, "+".join(sources)) headers = { - b'Content-Type': b'application/x-www-form-urlencoded', - b'Origin': b'http://www.4tube.com', - } + b'Content-Type': b'application/x-www-form-urlencoded', + b'Origin': b'http://www.4tube.com', + } token_req = compat_urllib_request.Request(token_url, b'{}', headers) tokens = self._download_json(token_req, video_id) @@ -76,7 +76,7 @@ class FourTubeIE(InfoExtractor): 'format_id': format + 'p', 'resolution': format + 'p', 'quality': int(format), - } for format in sources] + } for format in sources] self._sort_formats(formats) @@ -92,4 +92,4 @@ class FourTubeIE(InfoExtractor): 'duration': duration, 'age_limit': 18, 'webpage_url': webpage_url, - } \ No newline at end of file + }