From 3eff81fbf72939abf885afcca2f1155cc976999b Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Wed, 18 Feb 2015 10:47:40 +0100 Subject: [jsinterp] Disable comment support We need a proper lexer to be able to understand YouTube's code, which contains /* inside of strings. For now it's sufficient to just disable comment support altogether. Fixes #4976, fixes #4979, fixes #4980, fixes #4981, fixes #4982. Closes #4977. --- youtube_dl/jsinterp.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'youtube_dl/jsinterp.py') diff --git a/youtube_dl/jsinterp.py b/youtube_dl/jsinterp.py index 453e2732c..0e0c7d90d 100644 --- a/youtube_dl/jsinterp.py +++ b/youtube_dl/jsinterp.py @@ -30,13 +30,10 @@ class JSInterpreter(object): def __init__(self, code, objects=None): if objects is None: objects = {} - self.code = self._remove_comments(code) + self.code = code self._functions = {} self._objects = objects - def _remove_comments(self, code): - return re.sub(r'(?s)/\*.*?\*/', '', code) - def interpret_statement(self, stmt, local_vars, allow_recursion=100): if allow_recursion < 0: raise ExtractorError('Recursion limit reached') -- cgit 1.4.1