Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Error on windows during download [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1748) #14139

Open
4 of 8 tasks
ghost opened this issue Sep 6, 2017 · 16 comments

Comments

@ghost
Copy link

ghost commented Sep 6, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.09.02. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.09.02

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other
C:\...>youtube-dl -i -v -f best --no-check-certificate --write-thumbnail --write-description --write-info-json --download-archive "C:/.../cats/archive.txt" -o "C:/.../cats/%(title)s.%(ext)s" "https://www.youtube.com/watch?v=mdqBbvYX3MU"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-i', '-v', '-f', 'best', '--no-check-certificate', '--write-thumbnail', '--write-description', '--write-info-json', '--download-archive', 'C:/.../cats/archive.txt', '-o', 'C:/.../cats/%(title)s.%(ext)s', 'https://www.youtube.com/watch?v=mdqBbvYX3MU']
[debug] Encodings: locale cp1250, fs mbcs, out cp852, pref cp1250
[debug] youtube-dl version 2017.09.02
[debug] Python version 3.4.4 - Windows-10-10.0.14393
[debug] exe versions: ffmpeg 3.3.3, ffprobe 3.3.3
[debug] Proxy map: {}
[youtube] mdqBbvYX3MU: Downloading webpage
[youtube] mdqBbvYX3MU: Downloading video info webpage
[youtube] mdqBbvYX3MU: Extracting video information
[youtube] mdqBbvYX3MU: Downloading MPD manifest
[info] Writing video description to: C:\...\cats\How do Cats Use Their Whiskers Slow-Motion - Cats Uncovered - BBC.description
[info] Writing video description metadata as JSON to: C:\...\cats\How do Cats Use Their Whiskers Slow-Motion - Cats Uncovered - BBC.info.json
[youtube] mdqBbvYX3MU: Downloading thumbnail ...
[youtube] mdqBbvYX3MU: Writing thumbnail to: C:\...\cats\How do Cats Use Their Whiskers Slow-Motion - Cats Uncovered - BBC.jpg
[debug] Invoking downloader on 'https://r1---sn-qpbpu8-c0ql.googlevideo.com/videoplayback?lmt=1493417719755362&ei=aPOvWYbPO4-8Vv7cgbAM&ms=au&source=youtube&dur=258.345&mv=m&pl=20&ip=62.165.208.150&requiressl=yes&id=o-AKl7qASm8K0eo_64wWkJMA2reMTE-pWc5MPCRl22oYHU&key=yt6&signature=50EA5A7E2D92F704831176C3873AE8662EC538A7.9414C395E429ECE531C92B02C00F4428924DFA7A&mm=31&mn=sn-qpbpu8-c0ql&mt=1504703234&itag=22&mime=video%2Fmp4&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&expire=1504724937&initcwndbps=2967500&ratebypass=yes&ipbits=0'
[download] Destination: C:\...\cats\How do Cats Use Their Whiskers Slow-Motion - Cats Uncovered - BBC.mp4
[download]   0.1% of 51.31MiB at  4.12MiB/s ETA 00:12         ERROR: unable to download video data: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1748)
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmptra0egnk\build\youtube_dl\YoutubeDL.py", line 1865, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmptra0egnk\build\youtube_dl\YoutubeDL.py", line 1807, in dl
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmptra0egnk\build\youtube_dl\downloader\common.py", line 361, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmptra0egnk\build\youtube_dl\downloader\http.py", line 287, in real_download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmptra0egnk\build\youtube_dl\downloader\http.py", line 180, in download
  File "C:\Python\Python34\lib\http\client.py", line 537, in read
  File "C:\Python\Python34\lib\http\client.py", line 576, in readinto
  File "C:\Python\Python34\lib\socket.py", line 378, in readinto
  File "C:\Python\Python34\lib\ssl.py", line 748, in recv_into
  File "C:\Python\Python34\lib\ssl.py", line 620, in read
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1748)

Description of your issue, suggested solution and other information

I have been having this issue in the last couple of months. Download starts, then it stops with this error with a farily high likelyhood. One can force himself to download videos even with this bumping up over and over since it can pick up at the last byte it has been left at. Sometimes it is much more frequent than other times. Recently I managed to download a 25GB playlist in 3 tries. However now a 23GB playlist needed 21 tries to complete... Worst is when it doesn't even get to 1% of the data before it crashes.

I have seen other issues here in the past with similar error message, hence the --no-check-certificate option; I've also tried clearing expired certificates. I've seen this post linked to somewhere here, it may explain the cause of the problem if it is indeed with youtube-dl and not on my part: https://stackoverflow.com/questions/3724900/python-ssl-problem-with-multiprocessing/3724938#3724938. Any suggestions?

@ghost
Copy link
Author

ghost commented Sep 9, 2017

So might it not be a multiprocessing error as the SO answer suggests? The random nature of the issue indicates something of this sort. At least I'm not alone: #14047.

@ghost
Copy link
Author

ghost commented Sep 21, 2017

Issue still persists with version 09.15. "cant reproduce" - Funny because I can but reproduce it every time now ;). Impossible for me to use this software anymore. Doesn't matter if my anti-virus is on or off. I don't understand how there are no more users having similar problems to this, I have a super-mainstream Win 10 config... I need some suggestions else I'm gonna have to live the rest of my life in bitter sorrow.

@mrbryce
Copy link

mrbryce commented Oct 31, 2017

does this issue date back to 2015 ?

#7235

@fheilz
Copy link

fheilz commented Jan 30, 2019

I had a similar issue but i'm on windows ubuntu

This fixed it:
sudo mkdir /usr/local/share/ca-certificates/cacert.org
sudo wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt
sudo update-ca-certificates

Hope this helps 🥇

@totalamd
Copy link

I have the same issue in 2019.09.12.1. Should I open a new ticket or what?

@cluxter
Copy link

cluxter commented May 13, 2020

I had a similar issue but i'm on windows ubuntu

This fixed it:
sudo mkdir /usr/local/share/ca-certificates/cacert.org
sudo wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt
sudo update-ca-certificates

Hope this helps 1st_place_medal

Using ArchLinux, here is what fixed it:

$ sudo update-ca-trust

Nothing else to do.

@alik604
Copy link

alik604 commented Aug 5, 2020

I'm on a summer 2020 release and am also getting this issue.

my 'fix'

youtube-dl -f best -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PL8XX06eOucSzP4iZ3ONvAnG5gt8qLSI5S;
youtube-dl -f best -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PL8XX06eOucSzP4iZ3ONvAnG5gt8qLSI5S;
youtube-dl -f best -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PL8XX06eOucSzP4iZ3ONvAnG5gt8qLSI5S;
# .... and so on
# note the ; at the end 

'if it works, it's not stupid', this worked for me

@BlackWolfWoof
Copy link

I am also having the same issue now. On mobile (using Termux) it is fine but on Windows it likes breaking. I used
youtube-dl.exe https://youtu.be/1pNFoZeFhTE -f bestvideo+bestaudio[ext=m4a] --verbose

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://youtu.be/1pNFoZeFhTE', '-f', 'bestvideo+bestaudio[ext=m4a]', '--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2021.03.14
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg 4.3.2-2021-02-27-full_build-www.gyan.dev
[debug] Proxy map: {}
[youtube] 1pNFoZeFhTE: Downloading webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on 'https://r2---sn-h0jeln7e.googlevideo.com/videoplayback?expire=1616186629&ei=pbhUYNiSA4GigAeL1K34Aw&ip=84.160.114.44&id=o-AG_uK0NArmu4rmpKc-7piiyougbQaQqTbqXT_cr7n0x8&itag=308&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303%2C308&source=youtube&requiressl=yes&mh=cs&mm=31%2C26&mn=sn-h0jeln7e%2Csn-4g5e6nes&ms=au%2Conr&mv=m&mvi=2&pl=26&initcwndbps=1453750&vprv=1&mime=video%2Fwebm&ns=Sw8exPqHjOVqf-OU0p_JuooF&gir=yes&clen=69783554&dur=212.016&lmt=1616155831601702&mt=1616164865&fvip=2&keepalive=yes&fexp=24001374%2C24007246&c=WEB&txp=6316222&n=GbROfJByeTzJ_wqpDk&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgVgZcJf6tPmIDWsE1tVwDaJOVWRmixiF6nysUMifHGJYCIDPoVtdMeVORFnqGb07z6DIAz9q8SugWULsaaOxJ_JWj&sig=AOq0QJ8wRQIhAIfj_MF2fn4J7NCu7KnKvZ-w6MYky_pQP_vuTDSS9ZtYAiAWu1rq-0TVfMsZzQ8BD2H2c0Ed8jk44L2-UysrULZ0iQ=='
[download] Destination: Unlike Pluto - Interstellar Weather-1pNFoZeFhTE.f308.webm
[download]  46.4% of 66.55MiB at  6.53MiB/s ETA 00:05 ERROR: unable to download video data: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1748)
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp8z3w9mz6\build\youtube_dl\YoutubeDL.py", line 1961, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp8z3w9mz6\build\youtube_dl\YoutubeDL.py", line 1906, in dl
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp8z3w9mz6\build\youtube_dl\downloader\common.py", line 366, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp8z3w9mz6\build\youtube_dl\downloader\http.py", line 352, in real_download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp8z3w9mz6\build\youtube_dl\downloader\http.py", line 238, in download
  File "C:\Python\Python34\lib\http\client.py", line 537, in read
  File "C:\Python\Python34\lib\http\client.py", line 576, in readinto
  File "C:\Python\Python34\lib\socket.py", line 378, in readinto
  File "C:\Python\Python34\lib\ssl.py", line 748, in recv_into
  File "C:\Python\Python34\lib\ssl.py", line 620, in read
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1748)

Idk if i am being stupid and if i overseeing something obvious, but if someone has an idea i'll be happy to hear back from someone :)

@riimuru
Copy link

riimuru commented Mar 29, 2021

AnyOne Know how to fix it yet? i keep getting the same issue
2021-03-28 20:46:46.000 20572-20572/com.example.youtubedownloader E/YouTube DL: Failed To Download
com.yausername.youtubedl_android.YoutubeDLException: ERROR: unable to download video data: [SSL:
DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2560)

               at com.yausername.youtubedl_android.YoutubeDL.execute(YoutubeDL.java:201)
               at com.example.youtubedownloader.MainActivity.lambda$null$1$MainActivity(MainActivity.java:181)
               at com.example.youtubedownloader.-$$Lambda$MainActivity$dOoUrSOY9156A_2ewgxnMJ6G4xw.call(Unknown 
               Source:4)
               at 
               io.reactivex.internal.operators.observable.ObservableFromCallable.subscribeActual(ObservableFromCallable.java:42)
               at io.reactivex.Observable.subscribe(Observable.java:12030)
               at 
               io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
               at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:579)
               at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
               at java.util.concurrent.FutureTask.run(FutureTask.java:266)
               at 
               java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
               at java.lang.Thread.run(Thread.java:923)

@BritishDudeJon
Copy link

You might want to check if it's not a problem with Windows 10 itself. I updated from 1909 to 2004 in Spring last year and I've been having similar issues globally, not just in youtube-dl where downloads using the https protocol would frequently stop and you either have to keep retrying or resuming the download manually until completion. This has been going on since version 2004 and it hasn;t been fixed yet.

@BlackWolfWoof
Copy link

BlackWolfWoof commented Apr 7, 2021 via email

@BritishDudeJon
Copy link

BritishDudeJon commented Apr 7, 2021

I know this sounds stupid but might that also be related to another issue i had where downloads with chrome would randomly stop and i had to click continue again. If yes then welp... Thanks for bringing this to my attention. I'll look a bit further into this if it has something to do with windows

You might want to check if it's not a problem with Windows 10 itself. I updated from 1909 to 2004 in Spring last year and I've been having similar issues globally, not just in youtube-dl where downloads using the https protocol would frequently stop and you either have to keep retrying or resuming the download manually until completion. This has been going on since version 2004 and it hasn;t been fixed yet. —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

Is this just a Chrome issue or does it affect other applications? But yes, this sounds identical to the problem I've been facing for nearly a year now. I just hope we can both find some answers.

I failed to note previously that this has happened to two PCs I've owned in the past year. Just to make sure that it's not a problem with my connection, I ran the lates version of Windows 10 In a virtual machine and never had any issues despite running it on the problematic host. So it seems to only affect machines that have updated from 1903/1909 to 2004/20H2.

@BlackWolfWoof
Copy link

I know this sounds stupid but might that also be related to another issue i had where downloads with chrome would randomly stop and i had to click continue again. If yes then welp... Thanks for bringing this to my attention. I'll look a bit further into this if it has something to do with windows

You might want to check if it's not a problem with Windows 10 itself. I updated from 1909 to 2004 in Spring last year and I've been having similar issues globally, not just in youtube-dl where downloads using the https protocol would frequently stop and you either have to keep retrying or resuming the download manually until completion. This has been going on since version 2004 and it hasn;t been fixed yet. —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

Is this just a Chrome issue or does it affect other applications? But yes, this sounds identical to the problem I've been facing for nearly a year now. I just hope we can both find some answers.

I failed to note previously that this has happened to two PCs I've owned in the past year. Just to make sure that it's not a problem with my connection, I ran the lates version of Windows 10 In a virtual machine and never had any issues despite running it on the problematic host. So it seems to only affect machines that have updated from 1903/1909 to 2004/20H2.

I tried several things already such as turning off my anti virus, resetting chrome, using a different browser and other stuff. I also tested it on save mode with network drivers enabled and thats where both (chrome an youtube-dl) worked without any issues.
So yea a windows issue could be the reason. I'll search a bit around today and see if i can find more info about this

@BlackWolfWoof
Copy link

BlackWolfWoof commented Apr 9, 2021

@BritishDudeJon I found the issue. I am still looking how to fix it.

  1. It has nothing to do with youtube-dl
  2. I am using a "FRITZ!WLAN USB Stick AC 860" and by using USB-Tethering and sharing the internet from my phone this issue was resolved.
  3. That means it has to do something with my network controller???? or my wifi usb stick (fun fact: in windows save mode it works fine, even with my wifi stick lol)
    I will keep you updated on what worked on my end when i find a fix.

@BritishDudeJon
Copy link

2. USB-Tethering

Nice. I'm connected directly the router via a USB wifi adaptor. I did check the event viewer to see if it was logging thses errors in some way and I did find that it was logging an excessive amount of TLS errors reading "A fatal error occurred while creating a TLS client credential. The internal error state is 10013." which from what I've read might be related to the problem. I also noticed that I am least likely to get connection drops when I my PC has only recently been rebooted. about 15-30 minutes after is when the problems start happening. Let me know if you're getting these errors too.

@yazan-abu-obaideh
Copy link

yazan-abu-obaideh commented Jul 16, 2021

If you're having the same issue I was having, I think I've managed to resolve it using this tweak tool:

https://www.speedguide.net/downloads.php

Just use 'optimal settings' and everything should work just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants