diff --git a/youtube_dl/extractor/mixcloud.py b/youtube_dl/extractor/mixcloud.py
index 481182380..f331db890 100644
--- a/youtube_dl/extractor/mixcloud.py
+++ b/youtube_dl/extractor/mixcloud.py
@@ -9,6 +9,7 @@
from ..compat import (
compat_chr,
compat_ord,
+ compat_str,
compat_urllib_parse_unquote,
compat_urlparse,
compat_zip
@@ -16,9 +17,12 @@
from ..utils import (
clean_html,
ExtractorError,
+ int_or_none,
OnDemandPagedList,
str_to_int,
- try_get)
+ try_get,
+ urljoin,
+)
class MixcloudIE(InfoExtractor):
@@ -61,13 +65,6 @@ def _decrypt_xor_cipher(key, ciphertext):
compat_chr(compat_ord(ch) ^ compat_ord(k))
for ch, k in compat_zip(ciphertext, itertools.cycle(key))])
- @staticmethod
- def _decrypt_and_extend(stream_info, url_key, getter, key, formats):
- maybe_url = stream_info.get(url_key)
- if maybe_url is not None:
- decrypted = MixcloudIE._decrypt_xor_cipher(key, base64.b64decode(maybe_url))
- formats.extend(getter(decrypted))
-
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
uploader = mobj.group(1)
@@ -86,9 +83,12 @@ def _real_extract(self, url):
else:
# New path
full_info_json = self._parse_json(self._html_search_regex(
- r'', webpage, 'play info'), 'play info')
+ r'',
+ webpage, 'play info'), 'play info')
for item in full_info_json:
- item_data = try_get(item, lambda x: x['cloudcast']['data']['cloudcastLookup'])
+ item_data = try_get(
+ item, lambda x: x['cloudcast']['data']['cloudcastLookup'],
+ dict)
if try_get(item_data, lambda x: x['streamInfo']['url']):
info_json = item_data
break
@@ -100,13 +100,9 @@ def _real_extract(self, url):
webpage, 'error message', default=None)
js_url = self._search_regex(
- r'