Browse Source

[jsinterp] Better error messages

totalwebcasting
Philipp Hagemeister 11 years ago
parent
commit
77ffa95701
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      youtube_dl/jsinterp.py

+ 4
- 1
youtube_dl/jsinterp.py View File

@ -99,9 +99,12 @@ class JSInterpreter(object):
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…
Cancel
Save