diff --git a/youtube_dl/jsinterp2/jsparser.py b/youtube_dl/jsinterp2/jsparser.py index a50337595..6da7ba61b 100644 --- a/youtube_dl/jsinterp2/jsparser.py +++ b/youtube_dl/jsinterp2/jsparser.py @@ -16,8 +16,7 @@ class Parser(object): def parse(self): while not self.token_stream.ended: yield self._source_element(self.stack_top) - raise StopIteration - + def _source_element(self, stack_top): if stack_top < 0: raise ExtractorError('Recursion limit reached') diff --git a/youtube_dl/jsinterp2/tstream.py b/youtube_dl/jsinterp2/tstream.py index 55bb87985..f615864f8 100644 --- a/youtube_dl/jsinterp2/tstream.py +++ b/youtube_dl/jsinterp2/tstream.py @@ -154,8 +154,7 @@ class TokenStream(object): self.ended = True else: raise ExtractorError('Unrecognised sequence at %d' % pos) - raise StopIteration - + def chk_id(self, last=False): if last: name, value, pos = self._last