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

how can i download youtube video from the link immediately after click #5960

Closed
badershs opened this issue Jun 12, 2015 · 8 comments
Closed

Comments

@badershs
Copy link

Hi i have problem with downloading the video immediately
the problem is i fetch this link like : http://r17---sn-5hn7snls.googlevideo.com/videoplayback?mt=1434089815&mv=u&ms=au

but when i click on it ,it show me the video in new windows the video didn't Downloaded immediately , I must click save as by right mouse click To Save it
is there is a way to solve it ?

@jaimeMF
Copy link
Collaborator

jaimeMF commented Jun 12, 2015

I guess that most browsers prefer to show the video, as far as I know there is no way to force them to download.

If you are interested only in downloading the video you can just use youtube-dl or pass the url to some downloader (wget, curl, aria2 ...).

@jaimeMF jaimeMF closed this as completed Jun 12, 2015
@badershs
Copy link
Author

Mmmm. . . thank you so much but i think threre is away for this but i dont know how
if you check this website http://en.savefrom.net/
and get there link it will be download immediately without passing

@jaimeMF
Copy link
Collaborator

jaimeMF commented Jun 12, 2015

Try to compare the urls from youtube-dl and from that site and see their differences, that may allow you to fore it to download. If you find how to do it and want to it to be implemented in youtube-dl feel free to share it.

@jaimeMF
Copy link
Collaborator

jaimeMF commented Jun 12, 2015

Actually, they just add &title=youtube-dl+test+video+%27%27--%C3%A4%E2%86%AD%F0%9D%95%90(for https://www.youtube.com/watch?v=RbtPXFlZlHg), which also works with youtube-dl links

@badershs
Copy link
Author

Thats Right i just added &title=anything to the link and it's downloadable now

@muditmehrotra
Copy link

I am trying to do the same thing but I am not able to download the file. I am using the django, youtube-dl to download a video. I am getting the video link
https://r2---sn-ci5gup-h55e.googlevideo.com/videoplayback?mt=1466074772&dur=0.000&mv=m&initcwndbps=78750&ms=au&itag=43&sparams=dur%..... and concatenate the &title = "filename" but when I pass this to view template inside the link it still download the videoplayback file instead of the video file. while on the other hand when I hardcoded the link + &title = "file name" to the tag it download the file. Please, check my code below:

def downloadfile(request):
options = {
'outtmpl': '%(title)s-%(id)s.%(ext)s',
'format': 'best'
} 
with youtube_dl.YoutubeDL(options) as ydl:
    r = ydl.extract_info(request.POST['videourl'], download=False)
    videoUrl = r['url']
    fileName = ''.join(random.choice('abcdefghijklmnopqrstuvwxyz') for i in range(8))
    finalLink = videoUrl + "&" + fileName 
context = {"videoUrl":videoUrl, "filename":name, "finalLink":finalLink}
return render(request, 'videodownloader/downloadfile.html', context)

Template file code:

<a href="{{finalLink}}" download="something">Download Video</a>

link download the videoplayback file. Please help

@muditmehrotra
Copy link

I have done with this I forget to add title during the strings concatenations. Thanks for the help.

@JAXPARROW
Copy link

I am trying to do the same thing but I am not able to download the file. I am using the django, youtube-dl to download a video. I am getting the video link
https://r2---sn-ci5gup-h55e.googlevideo.com/videoplayback?mt=1466074772&dur=0.000&mv=m&initcwndbps=78750&ms=au&itag=43&sparams=dur%..... and concatenate the &title = "filename" but when I pass this to view template inside the link it still download the videoplayback file instead of the video file. while on the other hand when I hardcoded the link + &title = "file name" to the tag it download the file. Please, check my code below:

def downloadfile(request):
options = {
'outtmpl': '%(title)s-%(id)s.%(ext)s',
'format': 'best'
} 
with youtube_dl.YoutubeDL(options) as ydl:
    r = ydl.extract_info(request.POST['videourl'], download=False)
    videoUrl = r['url']
    fileName = ''.join(random.choice('abcdefghijklmnopqrstuvwxyz') for i in range(8))
    finalLink = videoUrl + "&" + fileName 
context = {"videoUrl":videoUrl, "filename":name, "finalLink":finalLink}
return render(request, 'videodownloader/downloadfile.html', context)

Template file code:

<a href="{{finalLink}}" download="something">Download Video</a>

link download the videoplayback file. Please help

Were you able to accomplish this ?

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

No branches or pull requests

4 participants