How do youtube downloaders work?
How do youtube downloaders work?
>I type yt-dlp into the terminal
>An .mp4 appears on my hardrive
simple as
check this out github.com
looks like some weird reverse engineering but my rule of thumb is if its viewable its scrape-able
HOW
first you must priovide a video id or url that contains the id
if given a url then the downloader probly parses it out
then it consults the youtub to find the video source url from the page it is on. there no api for this. so it scrape html.
then so well the video is chunked streams not just a plain old video file tu can download
so it go grab the chunks sometimes even do it in parallel. from youtub
then with the chunks it put them together into video.
now u can choose different format to download but often will be webm or mp4 either way the chunks come in that format it don t convert them
then after reassembling the chunks it does apply file name as requested or mabne it found the filename from scrapping web page.
also if you request audio extraction or video conversion it can do that
sometimes audio stream is in a different format of than the not inside the video itself, like separate streamin
in that case it must grab audio streams too and merge with the video
tool used to do most video stitching and manuipulation is named ffmpeg its good software use buy litlot of people and companyies. look it up.
>c+c
>w+r
>enter
>type y
>tab to ytdll
>space
>c+v
>enter
it's that easy
Basically it includes a JavaScript interpreter to run the JavaScript from the Youtube website, and that Javascript will tell the browser (or in the case the YTDL script) where to get the actual video.
I suspect most of the work of the YTDL script is to simulate a browser in such a way that the youtube javscript gets fooled.
Fun fact, you can dowload anything with youtube-dl, even porn from some chink obscure websites. I found out when I went through source code and saw urls to some vintage porn
So does that mean it's possible to access the video file directly from youtube's servers?
How do I get Streamlink to recheck a youtube stream? It times out and automatically closes after like 6 hours.
aw fuck it put my ip in it
oh well, please don't ddos me i have work to do
You can delete your own posts, if you want to.
just unplug your router for a few minutes
True, I've downloaded plenty of stuff from Dailymotion and Pornhub.
get fucked kiddo. enjoy being DDOSed.
I'm going to ping you :)
I did but I had to wait lol
I will report you to the cyber police and the state police.
>I will report you to the cyber police and the state police.
ya done goofed