From b03209569547bac86f3166ccfb59342e2d0f25df Mon Sep 17 00:00:00 2001 From: Alex Seiler Date: Sat, 25 Feb 2017 22:07:20 +0100 Subject: [PATCH] [cda] Decode url (fixes #12255) --- youtube_dl/extractor/cda.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/youtube_dl/extractor/cda.py b/youtube_dl/extractor/cda.py index ae7af2f0e..fad568641 100755 --- a/youtube_dl/extractor/cda.py +++ b/youtube_dl/extractor/cda.py @@ -1,6 +1,7 @@ # coding: utf-8 from __future__ import unicode_literals +import codecs import re from .common import InfoExtractor @@ -47,6 +48,12 @@ class CDAIE(InfoExtractor): 'only_matching': True, }] + def _decode_url(self, url): + decoded_url = codecs.decode(url, 'rot_13') + if decoded_url.endswith('adc.mp4'): + decoded_url = decoded_url.replace('adc.mp4', '.mp4') + return decoded_url + def _real_extract(self, url): video_id = self._match_id(url) self._set_cookie('cda.pl', 'cda.player', 'html5') @@ -96,6 +103,8 @@ class CDAIE(InfoExtractor): if not video or 'file' not in video: self.report_warning('Unable to extract %s version information' % version) return + if video['file'].startswith('uggc'): + video['file'] = self._decode_url(video['file']) f = { 'url': video['file'], }