mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	[utils] Expose PACKED_CODES_RE
This commit is contained in:
		| @@ -165,6 +165,8 @@ DATE_FORMATS_MONTH_FIRST.extend([ | |||||||
|     '%m/%d/%Y %H:%M:%S', |     '%m/%d/%Y %H:%M:%S', | ||||||
| ]) | ]) | ||||||
|  |  | ||||||
|  | PACKED_CODES_RE = r"}\('(.+)',(\d+),(\d+),'([^']+)'\.split\('\|'\)" | ||||||
|  |  | ||||||
|  |  | ||||||
| def preferredencoding(): | def preferredencoding(): | ||||||
|     """Get preferred encoding. |     """Get preferred encoding. | ||||||
| @@ -3017,9 +3019,7 @@ def encode_base_n(num, n, table=None): | |||||||
|  |  | ||||||
|  |  | ||||||
| def decode_packed_codes(code): | def decode_packed_codes(code): | ||||||
|     mobj = re.search( |     mobj = re.search(PACKED_CODES_RE, code) | ||||||
|         r"}\('(.+)',(\d+),(\d+),'([^']+)'\.split\('\|'\)", |  | ||||||
|         code) |  | ||||||
|     obfucasted_code, base, count, symbols = mobj.groups() |     obfucasted_code, base, count, symbols = mobj.groups() | ||||||
|     base = int(base) |     base = int(base) | ||||||
|     count = int(count) |     count = int(count) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sergey M․
					Sergey M․