mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-22 02:15:12 +00:00
[utils] Expose PACKED_CODES_RE
This commit is contained in:
parent
2c6743bf0f
commit
06b3fe2926
1 changed files with 3 additions and 3 deletions
|
@ -165,6 +165,8 @@ def register_socks_protocols():
|
|||
'%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)
|
||||
|
|
Loading…
Reference in a new issue