SSL Decrypt on youtube-dl

Issues related to applications and software problems and general support
amir385276
Posts: 50
Joined: 2019/08/09 20:54:52

SSL Decrypt on youtube-dl

Post by amir385276 » 2020/06/27 10:15:57

Hi Guys
I have a issue with (youtube-dl) and i don't know why do it that
in centos 8 with USA VPS
##### youtube-dl -f best --verbose --write-sub --sub-lang en https://www.viki.com/videos/1145069v-love-o2o-episode-1
after more time try to download show me this error

[download] 45.8% of 262.32MiB at 592.50KiB/s ETA 04:05ERROR: unable to download video data: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2354)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1926, in process_info
success = dl(filename, info_dict)
File "/usr/local/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 1865, in dl
return fd.download(name, info)
File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/common.py", line 366, in download
return self.real_download(filename, info_dict)
File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/http.py", line 342, in real_download
return download()
File "/usr/local/lib/python3.6/site-packages/youtube_dl/downloader/http.py", line 230, in download
data_block = ctx.data.read(block_size if data_len is None else min(block_size, data_len - byte_counter))
File "/usr/lib64/python3.6/http/client.py", line 459, in read
n = self.readinto(b)
File "/usr/lib64/python3.6/http/client.py", line 503, in readinto
n = self.fp.readinto(b)
File "/usr/lib64/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/usr/lib64/python3.6/ssl.py", line 971, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib64/python3.6/ssl.py", line 833, in read
return self._sslobj.read(len, buffer)
File "/usr/lib64/python3.6/ssl.py", line 590, in read
v = self._sslobj.read(len, buffer)
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2354)

somebody can help me how to fix this error
the github don't answer me

thanks

User avatar
TrevorH
Forum Moderator
Posts: 29172
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SSL Decrypt on youtube-dl

Post by TrevorH » 2020/06/27 12:15:58

Works here. Are you up to date on everything?
[trevor@centos8 ~]$ youtube-dl -f best --verbose --write-sub --sub-lang en https://www.viki.com/videos/1145069v-love-o2o-episode-1
[debug] System config: ['--prefer-free-formats']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-f', 'best', '--verbose', '--write-sub', '--sub-lang', 'en', 'https://www.viki.com/videos/1145069v-love-o2o-episode-1']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.06.06
[debug] Python version 3.6.8 (CPython) - Linux-4.18.0-193.6.3.el8_2.x86_64-x86_64-with-centos-8.2.2004-Core
[debug] exe versions: none
[debug] Proxy map: {}
[viki] 1145069v: Downloading video JSON
[viki] 1145069v: Downloading video streams JSON
[info] Writing video subtitles to: Love O2O - Episode 1-1145069v.en.vtt
WARNING: Unable to download subtitle for "en": Unable to download webpage: HTTP Error 500: Internal Server Error (caused by <HTTPError 500: 'Internal Server Error'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
[debug] Invoking downloader on 'https://v4.viki.io/1145069v/1145069v_hi ... d09a829477'
[download] Destination: Love O2O - Episode 1-1145069v.mp4
[download] 100% of 262.32MiB in 00:12
I have

Code: Select all

[trevor@centos8 ~]$ rpm -q youtube-dl openssl
youtube-dl-2020.06.06-1.el8.noarch
openssl-1.1.1c-15.el8.x86_64
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

amir385276
Posts: 50
Joined: 2019/08/09 20:54:52

Re: SSL Decrypt on youtube-dl

Post by amir385276 » 2020/06/27 14:05:51

Yes

I must be downgrade the everything

how to do that??????????
the youtube-dl 2020.6.6 is best
but i don't know how to install it from this link
https://github.com/ytdl-org/youtube-dl/ ... 2020.06.06
Thanks

User avatar
TrevorH
Forum Moderator
Posts: 29172
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SSL Decrypt on youtube-dl

Post by TrevorH » 2020/06/27 14:13:34

It's in EPEL though my copy came from epel-testing or epel-playground.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

amir385276
Posts: 50
Joined: 2019/08/09 20:54:52

Re: SSL Decrypt on youtube-dl

Post by amir385276 » 2020/06/27 14:17:48

hi again
TrevorH

I try this
# yum remove youtube-dl
# yum remove openssl
# yum install youtube-dl
and installed youtube-dl 2020-3-24 successfully

# youtube-dl -f best *********************
-bash: /usr/local/bin/youtube-dl: No such file or directory

how to fix it?

User avatar
TrevorH
Forum Moderator
Posts: 29172
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SSL Decrypt on youtube-dl

Post by TrevorH » 2020/06/27 14:36:27

Bash remembers where things were. You need to run hash -r to tell it to forget where it used to be and to look again.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
TrevorH
Forum Moderator
Posts: 29172
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SSL Decrypt on youtube-dl

Post by TrevorH » 2020/06/27 14:37:21

Hopefully your removal of openssl failed!
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

amir385276
Posts: 50
Joined: 2019/08/09 20:54:52

Re: SSL Decrypt on youtube-dl

Post by amir385276 » 2020/06/27 15:05:31

I removed youtube-dl and openssl successfully
and then reinstall youtube-dl
# yum install youtube-dl
youtube-dl 2020.3.24
is installed

but the issue is alive
]# youtube-dl -f best --write-sub --sub-lang en https://www.viki.com/videos/1145090v-lo ... episode-22
[viki] 1145090v: Downloading video JSON
[viki] 1145090v: Downloading video streams JSON
[info] Writing video subtitles to: Love O2O - Episode 22-1145090v.en.vtt
[download] Destination: Love O2O - Episode 22-1145090v.mp4
[download] 12.3% of 246.66MiB at 2.40MiB/s ETA 01:30ERROR: unable to download video data: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2354)

I think
1- New install of CentOS 7 x64
2- install youtube-dl with epel-release
3- working great

What do you think TrevorH

Thank you so much for your time

bonedome
Posts: 167
Joined: 2017/04/22 08:11:04

Re: SSL Decrypt on youtube-dl

Post by bonedome » 2020/06/28 11:13:01

Hello
I just noticed something

Code: Select all

# youtube-dl
are you logged in as root ?
Not sure if this would be a problem though as the download seems to get somewhere then stop.
I'd reinstall openssl, not just for youtube-dl but all https traffic.
You can install the latest youtube-dl with this command (as user $)

Code: Select all

$ pip install -U youtube-dl --user

Code: Select all

$ youtube-dl --version
2020.06.16.1
I don't know if this will make any difference as Trevor downloaded successfully with the older version and it seems to be an ssl problem.
I downloaded the video and subtitles aswell, which play fine with English subtitles, I used a slightly different command

Code: Select all

$ youtube-dl -f 480p-https --sub-format srt --write-sub --sub-lang en https://www.viki.com/videos/1145090v-love-o2o-episode-22

amir385276
Posts: 50
Joined: 2019/08/09 20:54:52

Re: SSL Decrypt on youtube-dl

Post by amir385276 » 2020/06/28 19:29:22

The issue is alive

i can't fix it

but your command help me to convert to srt subtitle

Thanks

Post Reply

Return to “CentOS 8 - General Support”