aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-10-19 23:28:49 +0700
committerSergey M․ <dstftw@gmail.com>2016-10-19 23:28:49 +0700
commit06b3fe2926c62ad0a86da5ef8d2d7686755af000 (patch)
tree3c8a6a38841192fae487957425945ddc456fb550 /youtube_dl
parent2c6743bf0f63bc5093926f0f8e95b47218d13961 (diff)
[utils] Expose PACKED_CODES_RE
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 0569d231c..28941673f 100644
--- 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)