Jump to content

How are videos downloaded off youtube?

¨TrisT¨
Go to solution Solved by prolemur,

you could make a script to run this one multiple times.

I was also thinking of making one because my bandwidth doesn't cound toward my cap from 2am - 8am, so (this script + a little cron job + list of youtube subscriptions + last time it was run) = awesome :D

Hi.

I'm kind of getting sick of getting low quality audio if I try downloading a whole playlist or having to download each music individually, so I was looking at the possibility of making something that'd do that for me.

Problem is I actually have no idea how it's done by those websites/programs.

I'd assume it'd have something to do with just receiving the data stream directly and encoding it, but that's a wild guess.

So, what would be, simplifiedly, the process though which one would achieve ending up with a mp3 file off a youtube link?

 

Thank you.

Link to comment
Share on other sites

Link to post
Share on other sites

https://youtubedownloader.com/

 

haven't used in a while but it's what I used to use. If you get the pro it will auto convert the download or you can just do it manually clicking buttons.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Lake-V-X6-10600 (Gaming PC)

R23 score MC: 9190pts | R23 score SC: 1302pts

R20 score MC: 3529cb | R20 score SC: 506cb

Spoiler

Case: Cooler Master HAF XB Evo Black / Case Fan(s) Front: Noctua NF-A14 ULN 140mm Premium Fans / Case Fan(s) Rear: Corsair Air Series AF120 Quiet Edition (red) / Case Fan(s) Side: Noctua NF-A6x25 FLX 60mm Premium Fan / Controller: Sony Dualshock 4 Wireless (DS4Windows) / Cooler: Cooler Master Hyper 212 Evo / CPU: Intel Core i5-10600, 6-cores, 12-threads, 4.4/4.8GHz, 13,5MB cache (Intel 14nm++ FinFET) / Display: ASUS 24" LED VN247H (67Hz OC) 1920x1080p / GPU: Gigabyte Radeon RX Vega 56 Gaming OC @1501MHz (Samsung 14nm FinFET) / Keyboard: Logitech Desktop K120 (Nordic) / Motherboard: ASUS PRIME B460 PLUS, Socket-LGA1200 / Mouse: Razer Abyssus 2014 / PCI-E: ASRock USB 3.1/A+C (PCI Express x4) / PSU: EVGA SuperNOVA G2, 850W / RAM A1, A2, B1 & B2: DDR4-2666MHz CL13-15-15-15-35-1T "Samsung 8Gbit C-Die" (4x8GB) / Operating System: Windows 10 Home / Sound: Zombee Z300 / Storage 1 & 2: Samsung 850 EVO 500GB SSD / Storage 3: Seagate® Barracuda 2TB HDD / Storage 4: Seagate® Desktop 2TB SSHD / Storage 5: Crucial P1 1000GB M.2 SSD/ Storage 6: Western Digital WD7500BPKX 2.5" HDD / Wi-fi: TP-Link TL-WN851N 11n Wireless Adapter (Qualcomm Atheros)

Zen-II-X6-3600+ (Gaming PC)

R23 score MC: 9893pts | R23 score SC: 1248pts @4.2GHz

R23 score MC: 10151pts | R23 score SC: 1287pts @4.3GHz

R20 score MC: 3688cb | R20 score SC: 489cb

Spoiler

Case: Medion Micro-ATX Case / Case Fan Front: SUNON MagLev PF70251VX-Q000-S99 70mm / Case Fan Rear: Fanner Tech(Shen Zhen)Co.,LTD. 80mm (Purple) / Controller: Sony Dualshock 4 Wireless (DS4Windows) / Cooler: AMD Near-silent 125w Thermal Solution / CPU: AMD Ryzen 5 3600, 6-cores, 12-threads, 4.2/4.2GHz, 35MB cache (T.S.M.C. 7nm FinFET) / Display: HP 24" L2445w (64Hz OC) 1920x1200 / GPU: MSI GeForce GTX 970 4GD5 OC "Afterburner" @1450MHz (T.S.M.C. 28nm) / GPU: ASUS Radeon RX 6600 XT DUAL OC RDNA2 32CUs @2607MHz (T.S.M.C. 7nm FinFET) / Keyboard: HP KB-0316 PS/2 (Nordic) / Motherboard: ASRock B450M Pro4, Socket-AM4 / Mouse: Razer Abyssus 2014 / PCI-E: ASRock USB 3.1/A+C (PCI Express x4) / PSU: EVGA SuperNOVA G2, 550W / RAM A2 & B2: DDR4-3600MHz CL16-18-8-19-37-1T "SK Hynix 8Gbit CJR" (2x16GB) / Operating System: Windows 10 Home / Sound 1: Zombee Z500 / Sound 2: Logitech Stereo Speakers S-150 / Storage 1 & 2: Samsung 850 EVO 500GB SSD / Storage 3: Western Digital My Passport 2.5" 2TB HDD / Storage 4: Western Digital Elements Desktop 2TB HDD / Storage 5: Kingston A2000 1TB M.2 NVME SSD / Wi-fi & Bluetooth: ASUS PCE-AC55BT Wireless Adapter (Intel)

Vishera-X8-9370 | R20 score MC: 1476cb

Spoiler

Case: Cooler Master HAF XB Evo Black / Case Fan(s) Front: Noctua NF-A14 ULN 140mm Premium Fans / Case Fan(s) Rear: Corsair Air Series AF120 Quiet Edition (red) / Case Fan(s) Side: Noctua NF-A6x25 FLX 60mm Premium Fan / Case Fan VRM: SUNON MagLev KDE1209PTV3 92mm / Controller: Sony Dualshock 4 Wireless (DS4Windows) / Cooler: Cooler Master Hyper 212 Evo / CPU: AMD FX-8370 (Base: @4.4GHz | Turbo: @4.7GHz) Black Edition Eight-Core (Global Foundries 32nm) / Display: ASUS 24" LED VN247H (67Hz OC) 1920x1080p / GPU: MSI GeForce GTX 970 4GD5 OC "Afterburner" @1450MHz (T.S.M.C. 28nm) / GPU: Gigabyte Radeon RX Vega 56 Gaming OC @1501MHz (Samsung 14nm FinFET) / Keyboard: Logitech Desktop K120 (Nordic) / Motherboard: MSI 970 GAMING, Socket-AM3+ / Mouse: Razer Abyssus 2014 / PCI-E: ASRock USB 3.1/A+C (PCI Express x4) / PSU: EVGA SuperNOVA G2, 850W PSU / RAM 1, 2, 3 & 4: Corsair Vengeance DDR3-1866MHz CL8-10-10-28-37-2T (4x4GB) 16.38GB / Operating System 1: Windows 10 Home / Sound: Zombee Z300 / Storage 1: Samsung 850 EVO 500GB SSD (x2) / Storage 2: Seagate® Barracuda 2TB HDD / Storage 3: Seagate® Desktop 2TB SSHD / Wi-fi: TP-Link TL-WN951N 11n Wireless Adapter

Godavari-X4-880K | R20 score MC: 810cb

Spoiler

Case: Medion Micro-ATX Case / Case Fan Front: SUNON MagLev PF70251VX-Q000-S99 70mm / Case Fan Rear: Fanner Tech(Shen Zhen)Co.,LTD. 80mm (Purple) / Controller: Sony Dualshock 4 Wireless (DS4Windows) / Cooler: AMD Near-silent 95w Thermal Solution / Cooler: AMD Near-silent 125w Thermal Solution / CPU: AMD Athlon X4 860K Black Edition Elite Quad-Core (T.S.M.C. 28nm) / CPU: AMD Athlon X4 880K Black Edition Elite Quad-Core (T.S.M.C. 28nm) / Display: HP 19" Flat Panel L1940 (75Hz) 1280x1024 / GPU: EVGA GeForce GTX 960 SuperSC 2GB (T.S.M.C. 28nm) / GPU: MSI GeForce GTX 970 4GD5 OC "Afterburner" @1450MHz (T.S.M.C. 28nm) / Keyboard: HP KB-0316 PS/2 (Nordic) / Motherboard: MSI A78M-E45 V2, Socket-FM2+ / Mouse: Razer Abyssus 2014 / PCI-E: ASRock USB 3.1/A+C (PCI Express x4) / PSU: EVGA SuperNOVA G2, 550W PSU / RAM 1, 2, 3 & 4: SK hynix DDR3-1866MHz CL9-10-11-27-40 (4x4GB) 16.38GB / Operating System 1: Ubuntu Gnome 16.04 LTS (Xenial Xerus) / Operating System 2: Windows 10 Home / Sound 1: Zombee Z500 / Sound 2: Logitech Stereo Speakers S-150 / Storage 1: Samsung 850 EVO 500GB SSD (x2) / Storage 2: Western Digital My Passport 2.5" 2TB HDD / Storage 3: Western Digital Elements Desktop 2TB HDD / Wi-fi: TP-Link TL-WN851N 11n Wireless Adapter

Acer Aspire 7738G custom (changed CPU, GPU & Storage)
Spoiler

CPU: Intel Core 2 Duo P8600, 2-cores, 2-threads, 2.4GHz, 3MB cache (Intel 45nm) / GPU: ATi Radeon HD 4570 515MB DDR2 (T.S.M.C. 55nm) / RAM: DDR2-1066MHz CL7-7-7-20-1T (2x2GB) / Operating System: Windows 10 Home / Storage: Crucial BX500 480GB 3D NAND SATA 2.5" SSD

Complete portable device SoC history:

Spoiler
Apple A4 - Apple iPod touch (4th generation)
Apple A5 - Apple iPod touch (5th generation)
Apple A9 - Apple iPhone 6s Plus
HiSilicon Kirin 810 (T.S.M.C. 7nm) - Huawei P40 Lite / Huawei nova 7i
Mediatek MT2601 (T.S.M.C 28nm) - TicWatch E
Mediatek MT6580 (T.S.M.C 28nm) - TECNO Spark 2 (1GB RAM)
Mediatek MT6592M (T.S.M.C 28nm) - my|phone my32 (orange)
Mediatek MT6592M (T.S.M.C 28nm) - my|phone my32 (yellow)
Mediatek MT6735 (T.S.M.C 28nm) - HMD Nokia 3 Dual SIM
Mediatek MT6737 (T.S.M.C 28nm) - Cherry Mobile Flare S6
Mediatek MT6739 (T.S.M.C 28nm) - my|phone myX8 (blue)
Mediatek MT6739 (T.S.M.C 28nm) - my|phone myX8 (gold)
Mediatek MT6750 (T.S.M.C 28nm) - honor 6C Pro / honor V9 Play
Mediatek MT6765 (T.S.M.C 12nm) - TECNO Pouvoir 3 Plus
Mediatek MT6797D (T.S.M.C 20nm) - my|phone Brown Tab 1
Qualcomm MSM8926 (T.S.M.C. 28nm) - Microsoft Lumia 640 LTE
Qualcomm MSM8974AA (T.S.M.C. 28nm) - Blackberry Passport
Qualcomm SDM710 (Samsung 10nm) - Oppo Realme 3 Pro

 

Link to comment
Share on other sites

Link to post
Share on other sites

He wants to know how to program such an application himself. 

I'm not entirely sure, and I don't want to spend a lot of time digging through their source code, but those webpages probably just download the file off of the youtube servers.

It should be possible to find the file destination on the server. 

Link to comment
Share on other sites

Link to post
Share on other sites

I'm not asking for ways to download, I'm asking how those ways download it themselves, so that maybe I can code something similar of my own where I don't have to pay sh** and can do anything I want with it.

Link to comment
Share on other sites

Link to post
Share on other sites

youtube-dl works the best, and is command line.  You can give it the URL to a playlist and it can fill an entire HDD if you want. 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, adm0n said:

He wants to know how to program such an application himself. 

I'm not entirely sure, and I don't want to spend a lot of time digging through their source code, but those webpages probably just download the file off of the youtube servers.

It should be possible to find the file destination on the server. 

I don't think files would just be exposed on a server like that, otherwise you'd be able to download private videos easy.

Besides you'd still have to encode it to audio.

 

I also don't believe digging through source code would help, I'm pretty sure they do that server side and then allow you to download from their own servers, otherwise there wouldn't be much of a point to doing so, and I'm not sure js even has the power to do that.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, ¨TrisT¨ said:

I don't think files would just be exposed on a server like that, otherwise you'd be able to download private videos easy.

Besides you'd still have to encode it to audio.

 

I also don't believe digging through source code would help, I'm pretty sure they do that server side and then allow you to download from their own servers, otherwise there wouldn't be much of a point to doing so, and I'm not sure js even has the power to do that.

You are actually right. I just remember that I used to be able to just save the files on my phone ... 

http://stackoverflow.com/questions/4032766/how-to-download-videos-from-youtube-on-java

Here you have some code : D go and figure out what they're doing yourself. But as far is i understood it, you were right with your first thought. 

Link to comment
Share on other sites

Link to post
Share on other sites

you can find the source video file by parsing the html for the src to the video then use a tool like ffpeg to convert it to mp3

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, adm0n said:

You are actually right. I just remember that I used to be able to just save the files on my phone ... 

http://stackoverflow.com/questions/4032766/how-to-download-videos-from-youtube-on-java

Here you have some code : D go and figure out what they're doing yourself. But as far is i understood it, you were right with your first thought. 

Yeh, that seems to be it. I don't do java and I'm not planning to in the near future, and this really seems too much work, dealing with media programmatically really is too much of a pain for an idea that isn't that important. I'll most likely just share folders with a VM and install all the "trashy" software I may want there, and pass the files through that folder, that way I won't get malware and I'll get the stuff done.

 

Once again, thank you :)

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, vorticalbox said:

you can find the source video file by parsing the html for the src to the video then use a tool like ffpeg to convert it to mp3

How do you mean?

I don't think you're ever gonna find any source video file without diving into the youtube API itself, you can find thumbnails and stuff, but a whole video is a much more complex thing, given all the qualities and how youtube buffers between them. This doesn't seem like your typical <video> tag.

Link to comment
Share on other sites

Link to post
Share on other sites

I just checked. Every video has a unique ID, which doesn't correspond with the filename. So no video tags : D that is right : D

 

You probably would be able to code this in any language you want, maybe there are even tutorials for some other language. 
And the conversion in the end could even be done by your VLC Media player : D but there are more sophisticated methods : D

Link to comment
Share on other sites

Link to post
Share on other sites

you could make a script to run this one multiple times.

I was also thinking of making one because my bandwidth doesn't cound toward my cap from 2am - 8am, so (this script + a little cron job + list of youtube subscriptions + last time it was run) = awesome :D

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, prolemur said:

you could make a script to run this one multiple times.

I was also thinking of making one because my bandwidth doesn't cound toward my cap from 2am - 8am, so (this script + a little cron job + list of youtube subscriptions + last time it was run) = awesome :D

Thanks a lot!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×