I have logged into a website from which I have purchased some educational course packages. These come with a book and DVDs and also an entitlement to view the DVD on line.
I have most of the DVDs although some have been mislaid but I had set out to save the files in my NAS so I could view them without having to load and rip DVD.
Having logged in to the course website I can view the videos on my workstation and have been trying to use yt-dlp to download the videos. Here is the result:-
alastair@HP-Z640-1:~> yt-dlp -f 'bv*+ba' --merge-output-format mp4 https://thegreatcourses.co./player/Video/1100
[generic] Extracting URL: https://thegreatcourses.co./player/Video/1100
[generic] 1100: Downloading webpage
ERROR: [generic] None: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'thegreatcourses.co.'. (_ssl.c:997)> (caused by URLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'thegreatcourses.co.'. (_ssl.c:997)")))
alastair@HP-Z640-1:~>
Because I am logged into the website I had hoped I would not have a problem but clearly I am missing something here. I am still reading up on yt-dlp but could it be that I just need to update the certificates on my machine? Asked from a position of profound ignorance in the hope that somebody can advise please.
One question concerns hostname. It is likely that I am working from a different host machine from the original purchase. Is it that simple?
VIrtual servers host many websites, and in order to serve HTTPS traffic they need to include every hosted website in the certificate alternative names, which is not the case for this domain.
If you remove the . at the end of the domain, it redirects to another website, you can try that domain.
alastair@HP-Z640-1:~> yt-dlp -f 'bv*+ba' --merge-output-format mp4 https://thegreatcourses.co/player/Video/1100
[generic] Extracting URL: https://thegreatcourses.co/player/Video/1100
[generic] 1100: Downloading webpage
[redirect] Following redirect to http://ww38.thegreatcourses.co/player/Video/1100
[generic] Extracting URL: http://ww38.thegreatcourses.co/player/Video/1100
[generic] 1100: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] 1100: Extracting information
ERROR: Unsupported URL: http://ww38.thegreatcourses.co/player/Video/1100
alastair@HP-Z640-1:~>
Well it gave a different result but I am well out of my depth here. Meanwhile the player is playing fine from my browser but that was just to check my login was still alive.
yt-dlp might not be handling redirects as a browser would. You could pass --downloader curl to yt-dlp to use curl. That said you’ll have to find a way to authenticate to this server as you would with the browser.
Well I tried this. Not sure I was correct but here is what I have:-
alastair@HP-Z640-1:~> yt-dlp -f 'bv*+ba' --merge-output-format mp4 --downloader curl https://thegreatcourses.co./player/Video/1100
[generic] Extracting URL: https://thegreatcourses.co./player/Video/1100
[generic] 1100: Downloading webpage
ERROR: [generic] None: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'thegreatcourses.co.'. (_ssl.c:997)> (caused by URLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'thegreatcourses.co.'. (_ssl.c:997)")))
alastair@HP-Z640-1:~>
This seems similar to my first attempt. As the browser is working how can I look into what is happening with the handshake when I run the video in the browser.
Have you tried with the trailing dot removed?
If that still doesn’t work, you should be able to use --downloader-args "curl:--insecure" to instruct curl to ignore certificate validation. (I have not certified this actually works)
You are supposed to keep the --downloader curl, consult man yt-dlp for more information. As a troubleshooting step, try downloading that page with curl (man curl) so you can certify curl can connect to that page. You’ll probably hit a paywall which you should deal with before you even try yt-dlp. This will be hard if you are not familiar with HTTP protocol and command lines.
So apparently your program does not support whatever output server provided. I would ask on the support channels for your program (do they have mailing list/forum/bug tracker?)