projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c6743b
)
[utils] Expose PACKED_CODES_RE
author
Sergey M․
<dstftw@gmail.com>
Wed, 19 Oct 2016 16:28:49 +0000
(23:28 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 19 Oct 2016 16:28:49 +0000
(23:28 +0700)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 0569d231c66cc4f952449e15131de8fa120439e2..28941673fa9bec36b24464faa79cc3b2348aca99 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-165,6
+165,8
@@
DATE_FORMATS_MONTH_FIRST.extend([
'%m/%d/%Y %H:%M:%S',
])
+PACKED_CODES_RE = r"}\('(.+)',(\d+),(\d+),'([^']+)'\.split\('\|'\)"
+
def preferredencoding():
"""Get preferred encoding.
@@
-3017,9
+3019,7
@@
def encode_base_n(num, n, table=None):
def decode_packed_codes(code):
- mobj = re.search(
- r"}\('(.+)',(\d+),(\d+),'([^']+)'\.split\('\|'\)",
- code)
+ mobj = re.search(PACKED_CODES_RE, code)
obfucasted_code, base, count, symbols = mobj.groups()
base = int(base)
count = int(count)