[cda] Decode url (fixes #12255)
This commit is contained in:
parent
b3aec47665
commit
b032095695
@ -1,6 +1,7 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import codecs
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
@ -47,6 +48,12 @@ class CDAIE(InfoExtractor):
|
|||||||
'only_matching': True,
|
'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):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
self._set_cookie('cda.pl', 'cda.player', 'html5')
|
self._set_cookie('cda.pl', 'cda.player', 'html5')
|
||||||
@ -96,6 +103,8 @@ class CDAIE(InfoExtractor):
|
|||||||
if not video or 'file' not in video:
|
if not video or 'file' not in video:
|
||||||
self.report_warning('Unable to extract %s version information' % version)
|
self.report_warning('Unable to extract %s version information' % version)
|
||||||
return
|
return
|
||||||
|
if video['file'].startswith('uggc'):
|
||||||
|
video['file'] = self._decode_url(video['file'])
|
||||||
f = {
|
f = {
|
||||||
'url': video['file'],
|
'url': video['file'],
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user