aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-11-06 23:29:42 +0700
committerSergey M․ <dstftw@gmail.com>2018-11-06 23:29:42 +0700
commit432cd4841023091811db46cd82c188698a386841 (patch)
tree290f5bbdfeb02b31e62e36dfd2f43699f023702b
parentc0345b825f8758571a8de871ab9349c46b062fc0 (diff)
[cliphinter] Fix extraction (closes #18083)
-rw-r--r--youtube_dl/extractor/cliphunter.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/youtube_dl/extractor/cliphunter.py b/youtube_dl/extractor/cliphunter.py
index ab651d1c8..f2ca7a337 100644
--- a/youtube_dl/extractor/cliphunter.py
+++ b/youtube_dl/extractor/cliphunter.py
@@ -1,19 +1,10 @@
from __future__ import unicode_literals
from .common import InfoExtractor
-from ..utils import int_or_none
-
-
-_translation_table = {
- 'a': 'h', 'd': 'e', 'e': 'v', 'f': 'o', 'g': 'f', 'i': 'd', 'l': 'n',
- 'm': 'a', 'n': 'm', 'p': 'u', 'q': 't', 'r': 's', 'v': 'p', 'x': 'r',
- 'y': 'l', 'z': 'i',
- '$': ':', '&': '.', '(': '=', '^': '&', '=': '/',
-}
-
-
-def _decode(s):
- return ''.join(_translation_table.get(c, c) for c in s)
+from ..utils import (
+ int_or_none,
+ url_or_none,
+)
class CliphunterIE(InfoExtractor):
@@ -60,14 +51,14 @@ class CliphunterIE(InfoExtractor):
formats = []
for format_id, f in gexo_files.items():
- video_url = f.get('url')
+ video_url = url_or_none(f.get('url'))
if not video_url:
continue
fmt = f.get('fmt')
height = f.get('h')
format_id = '%s_%sp' % (fmt, height) if fmt and height else format_id
formats.append({
- 'url': _decode(video_url),
+ 'url': video_url,
'format_id': format_id,
'width': int_or_none(f.get('w')),
'height': int_or_none(height),