mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	[utils] Recognize more patterns in strip_jsonp()
Used in Youku Show pages
This commit is contained in:
		| @@ -2211,7 +2211,12 @@ def parse_age_limit(s): | ||||
|  | ||||
| def strip_jsonp(code): | ||||
|     return re.sub( | ||||
|         r'(?s)^[a-zA-Z0-9_.$]+\s*\(\s*(.*)\);?\s*?(?://[^\n]*)*$', r'\1', code) | ||||
|         r'''(?sx)^ | ||||
|             (?:window\.)?(?P<func_name>[a-zA-Z0-9_.$]+) | ||||
|             (?:\s*&&\s*(?P=func_name))? | ||||
|             \s*\(\s*(?P<callback_data>.*)\);? | ||||
|             \s*?(?://[^\n]*)*$''', | ||||
|         r'\g<callback_data>', code) | ||||
|  | ||||
|  | ||||
| def js_to_json(code): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yen Chi Hsuan
					Yen Chi Hsuan