Closed apoorvaeternity closed 7 years ago
What is your URL, how do you decide which file to return?
I am trying to download videos from youtube.If I download the files using html download attribute their name is the default one.HTML5 download attribute does not rename the file if it is on another server.I want to rename them so I am using HTTPDownloadView which is doing the job for me.
I am able to get youtube video download links using pafy and youtube-dl. I want the user select the video quality and I want to rename the file to xyz.mp4 not videoplayback.mp4 which is the default name.
How to do it?
https://youtube-video-downloader.herokuapp.com/
Here it's a sample. Paste a youtube video link in the field and get the download links.' When you try to download a file.The filename will be videoplayback.mp4 by default. I want to rename it to title of the video.
Ok, then you need to implement a get_basename()
method to your view so that you can return the correct filename with regards to the video
Got it thanks.
I want to serve download files based on the request from an external server.I cannot fix the download url as there are many files.How to use the HTTPDownloadView with it.