Repository: ytdl-org/youtube-dl

Issue:
cda.pl extractor stopped working
- [X] I've **verified** and **I assure** that I'm running youtube-dl **2017.02.24.1**
- [X] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
- [X] Bug report (encountered problems with youtube-dl)

---

Log:

```
youtube-dl 'http://www.cda.pl/video/12791979b?wersja=1080p' -f hd -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'http://www.cda.pl/video/12791979b?wersja=1080p', u'-f', u'hd', u'-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.02.24.1
[debug] Python version 2.7.11 - Darwin-15.6.0-x86_64-i386-64bit
[debug] exe versions: avconv 11.4, avprobe 11.4, ffmpeg 3.0.2, ffprobe 3.0.2
[debug] Proxy map: {}
[CDA] 12791979b: Downloading webpage
[CDA] 12791979b: Downloading 480p version information
[CDA] 12791979b: Downloading 720p version information
[CDA] 12791979b: Downloading 1080p version information
[debug] Invoking downloader on u'uggc://ieok213.pqn.cy/HDSqR5j9xxDd80dEUpe2TN/1488013288/uqr8o9n1953oq0n1p4785ns355331pnpnsnqp.zc4'
ERROR: unable to download video data: <urlopen error unknown url type: uggc>
Traceback (most recent call last):
  File "/<PATH>/youtube-dl/youtube_dl/YoutubeDL.py", line 1791, in process_info
    success = dl(filename, info_dict)
  File "/<PATH>/youtube-dl/youtube_dl/YoutubeDL.py", line 1733, in dl
    return fd.download(name, info)
  File "/<PATH>/youtube-dl/youtube_dl/downloader/common.py", line 353, in download
    return self.real_download(filename, info_dict)
  File "/<PATH>/youtube-dl/youtube_dl/downloader/http.py", line 61, in real_download
    data = self.ydl.urlopen(request)
  File "/<PATH>/youtube-dl/youtube_dl/YoutubeDL.py", line 2093, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 454, in _open
    'unknown_open', req)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1265, in unknown_open
    raise URLError('unknown url type: %s' % type)
URLError: <urlopen error unknown url type: uggc>
```
---

### Description of your *issue*, suggested solution and other information

I think this is a problem wit ROT-13 encode (http is uggc in ROT-13).



Discussion:

Resolving patch:
diff --git a/youtube_dl/extractor/cda.py b/youtube_dl/extractor/cda.py
--- 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
@@ -96,6 +97,10 @@ def extract_format(page, version):
             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'] = codecs.decode(video['file'], 'rot_13')
+                if video['file'].endswith('adc.mp4'):
+                    video['file'] = video['file'].replace('adc.mp4', '.mp4')
             f = {
                 'url': video['file'],
             }


Test patch: