Răsfoiți Sursa

The opening curly brace `{` is a regex reserved [control character](http://stackoverflow.com/a/400316/1106367), so it needs to be escaped.

codesparkle 10 ani în urmă
părinte
comite
52585fd6dc
2 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 1 1
      youtube_dl/extractor/generic.py
  2. 1 1
      youtube_dl/extractor/grooveshark.py

+ 1 - 1
youtube_dl/extractor/generic.py

@@ -1073,7 +1073,7 @@ class GenericIE(InfoExtractor):
             found = filter_video(re.findall(r'''(?xs)
             found = filter_video(re.findall(r'''(?xs)
                 flowplayer\("[^"]+",\s*
                 flowplayer\("[^"]+",\s*
                     \{[^}]+?\}\s*,
                     \{[^}]+?\}\s*,
-                    \s*{[^}]+? ["']?clip["']?\s*:\s*\{\s*
+                    \s*\{[^}]+? ["']?clip["']?\s*:\s*\{\s*
                         ["']?url["']?\s*:\s*["']([^"']+)["']
                         ["']?url["']?\s*:\s*["']([^"']+)["']
             ''', webpage))
             ''', webpage))
         if not found:
         if not found:

+ 1 - 1
youtube_dl/extractor/grooveshark.py

@@ -83,7 +83,7 @@ class GroovesharkIE(InfoExtractor):
         return compat_urlparse.urlunparse((uri.scheme, uri.netloc, obj['attrs']['data'], None, None, None))
         return compat_urlparse.urlunparse((uri.scheme, uri.netloc, obj['attrs']['data'], None, None, None))
 
 
     def _transform_bootstrap(self, js):
     def _transform_bootstrap(self, js):
-        return re.split('(?m)^\s*try\s*{', js)[0] \
+        return re.split('(?m)^\s*try\s*\{', js)[0] \
                  .split(' = ', 1)[1].strip().rstrip(';')
                  .split(' = ', 1)[1].strip().rstrip(';')
 
 
     def _transform_meta(self, js):
     def _transform_meta(self, js):