aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/iqiyi.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-02-24 22:08:40 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-02-26 14:26:26 +0800
commit81bdc8fdf6516b05bc3a26f82eacb1889f5e46d5 (patch)
treeb1f707f5f19a737ef06982b868b1df9a7b2a997c /youtube_dl/extractor/iqiyi.py
parente048d87fc9b5cfa19806649faf20fc1a7bdb82a6 (diff)
[utils] Move base62 to utils
Diffstat (limited to 'youtube_dl/extractor/iqiyi.py')
-rw-r--r--youtube_dl/extractor/iqiyi.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/youtube_dl/extractor/iqiyi.py b/youtube_dl/extractor/iqiyi.py
index c3e33009a..4f02b9f87 100644
--- a/youtube_dl/extractor/iqiyi.py
+++ b/youtube_dl/extractor/iqiyi.py
@@ -18,6 +18,7 @@ from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
+ base62,
ExtractorError,
ohdave_rsa_encrypt,
remove_start,
@@ -126,21 +127,9 @@ class IqiyiSDK(object):
class IqiyiSDKInterpreter(object):
- BASE62_TABLE = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
-
def __init__(self, sdk_code):
self.sdk_code = sdk_code
- @classmethod
- def base62(cls, num):
- if num == 0:
- return '0'
- ret = ''
- while num:
- ret = cls.BASE62_TABLE[num % 62] + ret
- num = num // 62
- return ret
-
def decode_eval_codes(self):
self.sdk_code = self.sdk_code[5:-3]
@@ -154,7 +143,7 @@ class IqiyiSDKInterpreter(object):
while count:
count -= 1
- b62count = self.base62(count)
+ b62count = base62(count)
symbol_table[b62count] = symbols[count] or b62count
self.sdk_code = re.sub(