[teamcoco] Fix extraction
authorNaglis Jonaitis <njonaitis@gmail.com>
Sun, 8 Mar 2015 12:28:53 +0000 (14:28 +0200)
committerNaglis Jonaitis <njonaitis@gmail.com>
Sun, 8 Mar 2015 12:28:53 +0000 (14:28 +0200)
youtube_dl/extractor/teamcoco.py

index 5793dbc1085a86fdf573a432805be129dc62de94..7cb06f351e5b388142b00b51aeba69a1ecfef250 100644 (file)
@@ -53,10 +53,10 @@ class TeamcocoIE(InfoExtractor):
         embed = self._download_webpage(
             embed_url, video_id, 'Downloading embed page')
 
-        encoded_data = self._search_regex(
-            r'"preload"\s*:\s*"([^"]+)"', embed, 'encoded data')
+        player_data = self._parse_json(self._search_regex(
+            r'Y\.Ginger\.Module\.Player\((\{.*?\})\);', embed, 'player data'), video_id)
         data = self._parse_json(
-            base64.b64decode(encoded_data.encode('ascii')).decode('utf-8'), video_id)
+            base64.b64decode(player_data['preload'].encode('ascii')).decode('utf-8'), video_id)
 
         formats = []
         get_quality = qualities(['500k', '480p', '1000k', '720p', '1080p'])