Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Request) Ability to download using the "real" URL (not the "webpage_url") #1973

Closed
joeschmoe40 opened this issue Dec 15, 2013 · 7 comments
Closed

Comments

@joeschmoe40
Copy link

@joeschmoe40 joeschmoe40 commented Dec 15, 2013

When you d/l from YouTube (using any tool, including the old-fasioned way of using a flash-enabled browser), you give it a URL like: http://youtube.com/watch/..., but that's not the real URL. What happens is that a real URL, pointing to the actual content, is created for you and that's what really gets played. This real URL is very long (over 400 characters).

You can see this long URL if you run: youtube-dl.py -j short_URL

It is in there as "url". The "short URL" is also in the "-j" output, as "webpage_url".

So, my question is: Suppose you already have the "real" URL. Is there a way (and I assume the answer is "No.", so I"m requesting that this be made possible) to download the video, using the "real" url? The reason I ask is that I think that the creation of the "real" URL takes significant time, and if you already have it, you could save time by using it.

I have tried (using version: 2013.12.11.2):

youtube-dl.py -o xxx.flv "long/real URL"

and got error messages followed by a "hang". Had to Control/C to get out and there was no file xxx.flv created.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 15, 2013

With the latest versions you can do it using the following steps:

  1. Save the info of the video: youtube-dl 'http://www.youtube.com/watch?v=BaW_jenozKc' --write-info-json -o 'example.mp4'
  2. If you stop the download, then you can download the video without having to extract the information again: youtube-dl --load-info example.info.json. You can use any of the available options when running the command (like --extract-audio).

I'm closing the issue, but if you have any question, feel free to ask.
Allowing to download the file if you give the final url would be hard to implement and it couldn't use the output template features and other options, and most important, you can use a tool like curl, wget, or aria2c to download it, so it's not really needed.

@jaimeMF jaimeMF closed this Dec 15, 2013
@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Dec 17, 2013

OK - I accept your answer.

In fact, it had never occurred to me that you could just use a simple tool like "wget" to get the file, once you know the "real" URL.  I agree that it doesn't make sense to re-implement that in youtube-dl, especially if it is difficult to do.

(I also found it interesting to learn that it would be difficult to do.  Interesting, that...)

On Sunday, December 15, 2013 8:16 AM, Jaime Marquínez Ferrándiz notifications@github.com wrote:

With the latest versions you can do it using the following steps:

  1. Save the info of the video: youtube-dl 'http://www.youtube.com/watch?v=BaW_jenozKc' --write-info-json -o 'example.mp4'
  2. If you stop the download, then you can download the video without having to extract the information again: youtube-dl --load-info example.info.json. You can use any of the available options when running the command (like --extract-audio).
    I'm closing the issue, but if you have any question, feel free to ask.
    Allowing to download the file if you give the final url would be hard to implement and it couldn't use the output template features and other options, and most important, you can use a tool like curl, wget, or aria2c to download it, so it's not really needed.

    Reply to this email directly or view it on GitHub.
@phihag
Copy link
Contributor

@phihag phihag commented Dec 17, 2013

Actually, @jaimeMF never said it would be difficult to do. In fact, in youtube-dl 2013.17.12 and newer, you can pass in a direct link to a video.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 17, 2013

I actually said that ;), but I was thinking in using a regex for that, inspecting the Content-Type header makes more sense and it's much easier.

@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Dec 17, 2013

Heh heh. 

Funny how often things work like this.  Hackers love challenges, so when they say something is (or would be) difficult to do, it is quite often the case that soon thereafter, the thing is done.

Well done, guys!

On Tuesday, December 17, 2013 9:06 AM, Jaime Marquínez Ferrándiz notifications@github.com wrote:

I actually said that ;), but I was thinking in using a regex for that, inspecting the Content-Type header makes more sense and it's much easier.

Reply to this email directly or view it on GitHub.

@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Dec 17, 2013

However, ...

FYI, running 2013.12.17.1, I still get error messages when I pass in the direct URL.

Command line I used was: youtube-dl.py -o xxx.flv "http://very.long.url"

Is there, perhaps, a command line option you have to use to tell it that what it is getting is a "direct" URL?

On , J S joeschmoe40@yahoo.com wrote:

Heh heh. 

Funny how often things work like this.  Hackers love challenges, so when they say something is (or would be) difficult to do, it is quite often the case that soon thereafter, the thing is done.

Well done, guys!

On Tuesday, December 17, 2013 9:06 AM, Jaime Marquínez Ferrándiz notifications@github.com wrote:

I actually said that ;), but I was thinking in using a regex for that, inspecting the Content-Type header makes more sense and it's much easier.

Reply to this email directly or view it on GitHub.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 17, 2013

Open a new issue with the output and the url you are using (or at least how to get it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.