aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/jsinterp.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-11-10 12:54:02 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-11-10 12:54:02 +0800
commitff29bf81f852941cd7bcef1c051c77eccd4857bc (patch)
tree46b3985f9dbc2544c6905ed35a87c93f8ba71140 /youtube_dl/jsinterp.py
parentb25f7533975d7463cc772e9d106802ef29252796 (diff)
[jsinterp] Support alternative function definition form
Diffstat (limited to 'youtube_dl/jsinterp.py')
-rw-r--r--youtube_dl/jsinterp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/jsinterp.py b/youtube_dl/jsinterp.py
index 0e0c7d90d..9bc855144 100644
--- a/youtube_dl/jsinterp.py
+++ b/youtube_dl/jsinterp.py
@@ -232,10 +232,10 @@ class JSInterpreter(object):
def extract_function(self, funcname):
func_m = re.search(
r'''(?x)
- (?:function\s+%s|[{;]%s\s*=\s*function)\s*
+ (?:function\s+%s|[{;]%s\s*=\s*function|var\s+%s\s*=\s*function)\s*
\((?P<args>[^)]*)\)\s*
\{(?P<code>[^}]+)\}''' % (
- re.escape(funcname), re.escape(funcname)),
+ re.escape(funcname), re.escape(funcname), re.escape(funcname)),
self.code)
if func_m is None:
raise ExtractorError('Could not find JS function %r' % funcname)