Closed jchook closed 6 months ago
👍, using https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg/related?hl=en to extract my session cookies worked fine, but passing username/password via the CLI or in netrc doesn't do a thing.
Yes, credential with username and password doesn't work.
And --cookies didn't work for me @akx also the extension above is not available anymore.
@nuthinking You can copy your cookie in the headers tab via chrome inspect and use that. the cookie is under request headers youtube-dl --add-header "Cookie:[Your cookie here]" [Mixcloud_Link]
@t3chnoshark it worked, thanks! The files are quite low quality though (22 kHz!). --audio-quality
and --audio-format
get ignored 🤔
Getting a new error message in latest 2021.03.25 version
➜ youtube-dl -n -v 'https://www.mixcloud.com/HouseShoes/in-memoriam-pip-doom-pt-ii-1421/'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-n', '-v', 'https://www.mixcloud.com/HouseShoes/in-memoriam-pip-doom-pt-ii-1421/']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.03.25
[debug] Python version 3.9.2 (CPython) - Linux-5.11.9_1-x86_64-with-glibc2.32
[debug] exe versions: ffmpeg 4.3.2, ffprobe 4.3.2, phantomjs 2.1.1
[debug] Proxy map: {}
[mixcloud] HouseShoes_in-memoriam-pip-doom-pt-ii-1421: Downloading JSON metadata
Traceback (most recent call last):
File "/usr/sbin/youtube-dl", line 33, in <module>
sys.exit(load_entry_point('youtube-dl==2021.3.25', 'console_scripts', 'youtube-dl')())
File "/usr/lib/python3.9/site-packages/youtube_dl/__init__.py", line 475, in main
_real_main(argv)
File "/usr/lib/python3.9/site-packages/youtube_dl/__init__.py", line 465, in _real_main
retcode = ydl.download(all_urls)
File "/usr/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 2059, in download
res = self.extract_info(
File "/usr/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 799, in extract_info
return self.__extract_info(url, ie, download, extra_info, process)
File "/usr/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 806, in wrapper
return func(self, *args, **kwargs)
File "/usr/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 827, in __extract_info
ie_result = ie.extract(url)
File "/usr/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 534, in extract
ie_result = self._real_extract(url)
File "/usr/lib/python3.9/site-packages/youtube_dl/extractor/mixcloud.py", line 137, in _real_extract
format_url = stream_info.get(url_key)
AttributeError: 'NoneType' object has no attribute 'get'
@jchook used the -cookie option and it worked, dont think it worked for mixcloud before till now I used this Firefox extension to download the cookie then i just entered it in as an option https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/ youtube-dl --cookie mixcloud-cookie.txt [Mixcloud_Link]
This is still happening in version 2021.06.06. By using --inspect-traffic, it seems that the login step is not even attempted.
$ youtube-dl --netrc -f 'bestaudio[ext=m4a]/bestaudio[ext=ogg]/bestaudio[ext=mp3]/bestaudio' --sleep-interval=2 --rate-limit=128k -c --extract-audio 'https://www.mixcloud.com/zonalibera/zona-libera-774-aired-04-iulie-2021/?utm_source=notification&utm_medium=email&utm_campaign=notification_new_upload&utm_content=html' '--output=tmp/%(playlist_index)s - %(title)s.%(ext)s' -v --print-traffic
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--netrc', '-f', 'bestaudio[ext=m4a]/bestaudio[ext=ogg]/bestaudio[ext=mp3]/bestaudio', '--sleep-interval=2', '--rate-limit=128k', '-c', '--extract-audio', 'https://www.mixcloud.com/zonalibera/zona-libera-774-aired-04-iulie-2021/?utm_source=notification&utm_medium=email&utm_campaign=notification_new_upload&utm_content=html', '--output=$HOME/tmp/%(playlist_index)s - %(title)s.%(ext)s', '-v', '--print-traffic']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.8.10 (CPython) - Linux-5.4.0-77-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg N-98519-gc4c989c, ffprobe N-98519-gc4c989c, rtmpdump 2.4
[debug] Proxy map: {}
[mixcloud] zonalibera_zona-libera-774-aired-04-iulie-2021: Downloading JSON metadata
send: b'GET /graphql?query=%7B%0A++cloudcastLookup%28lookup%3A+%7Busername%3A+%22zonalibera%22%2C+slug%3A+%22zona-libera-774-aired-04-iulie-2021%22%7D%29+%7B%0A++++audioLength%0A++++comments%28first%3A+100%29+%7B%0A++++++edges+%7B%0A++++++++node+%7B%0A++++++++++comment%0A++++++++++created%0A++++++++++user+%7B%0A++++++++++++displayName%0A++++++++++++username%0A++++++++++%7D%0A++++++++%7D%0A++++++%7D%0A++++++totalCount%0A++++%7D%0A++++description%0A++++favorites+%7B%0A++++++totalCount%0A++++%7D%0A++++featuringArtistList%0A++++isExclusive%0A++++name%0A++++owner+%7B%0A++++++displayName%0A++++++url%0A++++++username%0A++++%7D%0A++++picture%28width%3A+1024%2C+height%3A+1024%29+%7B%0A++++++++url%0A++++%7D%0A++++plays%0A++++publishDate%0A++++reposts+%7B%0A++++++totalCount%0A++++%7D%0A++++streamInfo+%7B%0A++++++dashUrl%0A++++++hlsUrl%0A++++++url%0A++++%7D%0A++++tags+%7B%0A++++++tag+%7B%0A++++++++name%0A++++++%7D%0A++++%7D%0A++%7D%0A%7D HTTP/1.1\r\nHost: www.mixcloud.com\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3667.1 Safari/537.36\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nConnection: close\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Tue, 06 Jul 2021 06:00:06 GMT
header: Content-Type: application/json
header: Transfer-Encoding: chunked
header: Connection: close
header: Vary: Cookie, User-Agent
header: X-Frame-Options: SAMEORIGIN
header: x-content-type-options: nosniff
header: x-xss-protection: 1; mode=block
header: Content-Security-Policy: default-src https: data: blob:; script-src https: data: blob: 'unsafe-inline' 'unsafe-eval'; style-src https: data: 'unsafe-inline'; img-src https: data: blob:; media-src https: http: blob: data:; connect-src http: https: ws: wss:;
header: X-Mixcloud-Session: 5l0f0rjnklhwtj708bqaybftubld466j
header: X-Request-ID: fabfa2795b2711f8a7223e9b5ed4c919
header: X-Mixcloud-Country-Code: ROU
header: X-Mixcloud-View-Name: graphql
header: ETag: W/"982d428f78f39721dd390ec552139869"
header: Set-Cookie: csrftoken=XYHxsk6XSGSYwTc8BbMhEXQvX78r0QOnY0Wo42AHJ4LBIghowUbbFzbiEE4r0vfM; Domain=.mixcloud.com; expires=Tue, 05 Jul 2022 06:00:06 GMT; Max-Age=31449600; Path=/; SameSite=Lax; Secure
header: Set-Cookie: c=5l0f0rjnklhwtj708bqaybftubld466j; Domain=.mixcloud.com; expires=Fri, 04 Jul 2031 06:00:06 GMT; HttpOnly; Max-Age=315360000; Path=/; SameSite=Lax; Secure
header: Set-Cookie: mx_t=3e9be78f-1320-4daf-b94c-0630595b3341; Domain=.mixcloud.com; expires=Fri, 04 Jul 2031 06:00:06 GMT; HttpOnly; Max-Age=315360000; Path=/
header: Strict-Transport-Security: max-age=15724800; includeSubDomains
header: CF-Cache-Status: DYNAMIC
header: Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
header: Server: cloudflare
header: CF-RAY: 66a69c604c99acac-OTP
header: Content-Encoding: gzip
header: alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
ERROR: This video is only available for registered users. Use --username and --password or --netrc to provide account credentials.
Traceback (most recent call last):
File "$HOME/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
return func(self, *args, **kwargs)
File "$HOME/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
ie_result = ie.extract(url)
File "$HOME/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 534, in extract
ie_result = self._real_extract(url)
File "$HOME/.local/lib/python3.8/site-packages/youtube_dl/extractor/mixcloud.py", line 160, in _real_extract
self.raise_login_required()
File "$HOME/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 941, in raise_login_required
raise ExtractorError(
youtube_dl.utils.ExtractorError: This video is only available for registered users. Use --username and --password or --netrc to provide account credentials.
In this case and many others, the diagnostic is misleading. There is no login function in this extractor: instead pass --cookies ...
from your logged-in browser session and omit any parameters related to login (--username ...
/-u ...
, --password ...
/'p ...',
--netrc`).
Checklist
Verbose log
Description
I saw related issue #19280, but it cited a different error, so I submitted this one as well.
This appears related to the "Select Exclusive" mixes. I tried adding my login and password as well as the
--cookies
flag, but no dice.UPDATE
I copied all the cookies from my browser and the download worked. Seems the login/password authentication does not work on Mixcloud.