[cda] Fix extraction (Closes #9803)
authorSergey M․ <dstftw@gmail.com>
Thu, 16 Jun 2016 15:33:12 +0000 (22:33 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 16 Jun 2016 15:33:12 +0000 (22:33 +0700)
youtube_dl/extractor/cda.py

index 498d2c0d8a1dad129c8a1a9681da2f06503129f9..8af318703b0ae9ad57fedb49c7f320288322caa9 100755 (executable)
@@ -58,7 +58,8 @@ class CDAIE(InfoExtractor):
         def extract_format(page, version):
             unpacked = decode_packed_codes(page)
             format_url = self._search_regex(
-                r"url:\\'(.+?)\\'", unpacked, '%s url' % version, fatal=False)
+                r"(?:file|url)\s*:\s*(\\?[\"'])(?P<url>http.+?)\1", unpacked,
+                '%s url' % version, fatal=False, group='url')
             if not format_url:
                 return
             f = {
@@ -75,7 +76,8 @@ class CDAIE(InfoExtractor):
             info_dict['formats'].append(f)
             if not info_dict['duration']:
                 info_dict['duration'] = parse_duration(self._search_regex(
-                    r"duration:\\'(.+?)\\'", unpacked, 'duration', fatal=False))
+                    r"duration\s*:\s*(\\?[\"'])(?P<duration>.+?)\1",
+                    unpacked, 'duration', fatal=False, group='duration'))
 
         extract_format(webpage, 'default')