LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2015, 10:52 AM   #1
altermetax
LQ Newbie
 
Registered: Apr 2015
Distribution: Manjaro 16.06.1
Posts: 25

Rep: Reputation: Disabled
Question Where does YouTube store its videos?


I see a lot of applications that download videos from YouTube in a lot of formats. I don't want you to write a YouTube downloader for me but I would like to know where YouTube stores its videos. Is there any address like youtube.com/videos/lpn1dnDO5Os.mp4 (this is an example)??
Thanks for answers.

And, please, answer
 
Old 11-08-2015, 11:45 AM   #2
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: USA
Distribution: Lubuntu 14.04, 22.04, Windows 8.1 and 10
Posts: 6,282
Blog Entries: 4

Rep: Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842
Quote:
Originally Posted by altermetax View Post
I see a lot of applications that download videos from YouTube in a lot of formats. I don't want you to write a YouTube downloader for me but I would like to know where YouTube stores its videos. Is there any address like youtube.com/videos/lpn1dnDO5Os.mp4 (this is an example)??
Thanks for answers.

And, please, answer
Hi...

Unless it's your own videos (that you made,) I wouldn't recommend this. A lot of content on Youtube was uploaded illegally, without permission from the author or copyright holder.

Regards...
 
Old 11-08-2015, 12:52 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
@altermetax: if you understand a little about how servers work, you will find that it is very basic stuff to redirect URLs internally, without the visitor ever seeing the underlying file system structure.
but it doesn't matter; there's plenty of youtube downloaders availbale, and if you really want to get into it, you download the source code of one and start digging htrough it. but even then you won't find out anything about google's server's directory tree.

(now i have to duck & run because jesus police is coming after me)
 
Old 11-08-2015, 01:51 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
As ondoho says, the effect of the internal redirection, aka streaming, is to hide the bits from the user between the network device and the viewing device.

It is also easy to capture the bit patterns to a normal file, but unless you just want to do that as an exercise it is easiest to just use one of the many tools available for the purpose.

My favorite is youtube-dl.

And I wouldn't burden myself with copy guilt... they are posted for the puprose of visitors being able to view them, right? To do so you must download the bit pattern, buffer it on your system and write it to a display device, right? If you use a file as a buffer instead of or in addition to system RAM, you have absolutely NOT harmed the author or any self-appointed "rights holder" (aka, money chanagers).

Those who would lay guilt on you and spin such innocent actions into a brazen crime are at best, misguided.

As for the "Jesus police", as I recall Jesus bypassed the legal tribute collectors and made them come to Him, and He overturned their tables - and their system. I cannot imagine Him vigilantly directing all the poor to dutifully line up at their tables again! Just my personal opinion.

Enjoy the music and the videos at your own convenience, guilt free - and feel free to dance if the mood strikes you!

Last edited by astrogeek; 11-08-2015 at 02:15 PM. Reason: tpos, typs, typos
 
1 members found this post helpful.
Old 11-08-2015, 02:43 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
You can locate the URLs for the MP4 files by using the browser's developer tools to analyze the page's DOM (Document Object Model). Once you find out where in the DOM it is, you can use Javascript to manipulate the page to insert a download link for it. If I were writing a Youtube video downloader from scratch, it would be a script for Greasemonkey or Tampermonkey.
 
Old 11-08-2015, 03:41 PM   #6
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: USA
Distribution: Lubuntu 14.04, 22.04, Windows 8.1 and 10
Posts: 6,282
Blog Entries: 4

Rep: Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842
Quote:
Originally Posted by astrogeek View Post
Those who would lay guilt on you and spin such innocent actions into a brazen crime are at best, misguided.
Someone who uploads content that was not theirs and did not obtain permission to do so is not committing an "innocent" action. It is wrong. I know because the Lord has had to correct me more than once about watching stuff that was illegally uploaded. Now I try to very diligent about the source of the content before I watch it.

Regards...
 
Old 11-08-2015, 03:49 PM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Surely anything that Google own or have negotiated rights to distribute anything that is available on YouTube, or they wouldn't show it?
The DMCA, amongst other things, would mean that should Google be hosting illegal content, or even if there were a suggestion that they were, on YouTube the site would be shut down pending legal action. That's what US law says, Google is a US company, so anything on Google must be legal to watch or it wouldn't be there.
 
Old 11-08-2015, 04:42 PM   #8
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: USA
Distribution: Lubuntu 14.04, 22.04, Windows 8.1 and 10
Posts: 6,282
Blog Entries: 4

Rep: Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842
Quote:
Originally Posted by 273 View Post
so anything on Google must be legal to watch or it wouldn't be there.
Hi...

Unfortunately, no, that's not the case. There is quite a bit of stuff on Youtube that was uploaded illegally. At one point, MondoMedia and Youtube put out this funny cartoon I think to make people aware of the problem and the potential penalties. There also wouldn't be the need for takedown forms such as this one.

As far as downloading videos goes, please see this page.

Regards...

Last edited by ardvark71; 11-08-2015 at 04:46 PM. Reason: Changed wording/Correction.
 
Old 11-08-2015, 04:50 PM   #9
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by ardvark71 View Post
Hi...

Unfortunately, no, that's not the case. There is quite a bit of stuff on Youtube that was uploaded illegally. At one point, MondoMedia and Youtube put out this funny cartoon I think to make people aware of the problem and the potential penalties. There also wouldn't be the need for takedown forms such as this one.

As far as downloading videos goes, please see this page.

Regards...
That simply can't be the case. The DMCA has ended copyright infringement and all those who practice it have been jailed. If I were to host illegal content then my hosting provider would suspend my account until I could prove I wasn't breaking the law. Since YouTube is still up and running all its content must be legal.
The US courts can't have it both ways, I'm afraid.
 
Old 11-09-2015, 12:22 AM   #10
lambo69
Member
 
Registered: Sep 2012
Distribution: Slackware, Manjaro, Slackarm, Raspbian, Debian
Posts: 68

Rep: Reputation: Disabled
https://developers.google.com/youtube/v3/
https://www.youtube.com/yt/dev/api-resources.html
 
Old 11-13-2015, 01:36 AM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by dugan View Post
You can locate the URLs for the MP4 files by using the browser's developer tools to analyze the page's DOM (Document Object Model).
thanks for this.
i keep forgetting how powerful these developer tools are, at least on firefox/iceweasel.
op, on the page in question press "F12" and see mysteries unravel!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Youtube-DL A Command-Line & GUI Youtube, Facebook, Dailymotion Videos Downloading Tool For Li LXer Syndicated Linux News 0 10-11-2015 02:51 PM
LXer: youtube-dl – download Youtube videos from linux command Line LXer Syndicated Linux News 0 06-24-2014 12:11 PM
LXer: Search YouTube videos on Ubuntu with the YouTube Lens LXer Syndicated Linux News 0 12-30-2011 08:40 PM
LXer: Youtube-dl - Download videos from Youtube in openSUSE LXer Syndicated Linux News 1 08-14-2008 08:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration