mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[jsinterp] Better error messages
This commit is contained in:
parent
2b25cb5d76
commit
77ffa95701
1 changed files with 4 additions and 1 deletions
|
@ -99,9 +99,12 @@ def interpret_expression(self, expr, local_vars, allow_recursion):
|
|||
|
||||
def extract_function(self, funcname):
|
||||
func_m = re.search(
|
||||
r'function ' + re.escape(funcname) +
|
||||
(r'(?:function %s|%s\s*=\s*function)' % (
|
||||
re.escape(funcname), re.escape(funcname))) +
|
||||
r'\((?P<args>[a-z,]+)\){(?P<code>[^}]+)}',
|
||||
self.code)
|
||||
if func_m is None:
|
||||
raise ExtractorError('Could not find JS function %r' % funcname)
|
||||
argnames = func_m.group('args').split(',')
|
||||
|
||||
def resf(args):
|
||||
|
|
Loading…
Reference in a new issue