[ok] Improve player regex
authorSergey M․ <dstftw@gmail.com>
Wed, 2 Sep 2015 15:38:56 +0000 (21:38 +0600)
committerSergey M․ <dstftw@gmail.com>
Wed, 2 Sep 2015 15:38:56 +0000 (21:38 +0600)
youtube_dl/extractor/odnoklassniki.py

index 97900a4c393c3011366cf7c0b5e7183c2a02f100..4564fd0be6d832d6d1dbd035dbee20ac14693f2f 100644 (file)
@@ -59,7 +59,8 @@ class OdnoklassnikiIE(InfoExtractor):
 
         player = self._parse_json(
             unescapeHTML(self._search_regex(
-                r'data-options="([^"]+%s[^"]+)"' % video_id, webpage, 'player')),
+                r'data-options=(?P<quote>["\'])(?P<player>{.+?%s.+?})(?P=quote)' % video_id,
+                webpage, 'player', group='player')),
             video_id)
 
         flashvars = player['flashvars']