Reputation: 332
Facing issues while starting youtube video downloads directly instead of playing in the browser.
I am working youtube downloader website which provides direct youtube links to users.
The sample download link for 720p video is like this :
https://r1---sn-q0c7rn76.googlevideo.com/videoplayback?expire=1595113918&ei=Xi0TX8roK_7oxN8P3a2UuAs&ip=34.249.118.49&id=o-APhQXWUkgI-5LLZFkyXiauEloMZSsD2EU-mLNEVrdFkW&itag=22&source=youtube&requiressl=yes&mh=x-&mm=31%2C26&mn=sn-q0c7rn76%2Csn-aigzrn7s&ms=au%2Conr&mv=u&mvi=1&pl=23&vprv=1&mime=video%2Fmp4&ratebypass=yes&dur=3231.010&lmt=1575857773351740&mt=1595091905&fvip=1&beids=9466587&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhALE93ROecAk4QLvdgUKfwGUAHYHpxyTzaSDMMNMSe_npAiBU8oX1fZ5M_MjukqXY1gCYnojaYBpz2hcm_gD8jvkmyw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AG3C_xAwRAIgHf-Gnzqo9ffjJThHM7r4bpLA-hfD_agNHv3hvwVouNECIHwR3fja1WdZsb9SCUtAlJ4CSkjWaBsUy6toAPd2luxV
suppose I add this at the end of the URL : "&title=mytitle" the video will start to download automatically in users machines with the file name as "mytitle" when they click the download button on my website.
However, this works only for 720p videos and nothing else.It does not work for m4a(audio only file) The m4a file starts playing in a new browser tab even if I add "&title=mytitle". The sample of m4a file is like this :
https://r1---sn-q0c7rn76.googlevideo.com/videoplayback?expire=1595113918&ei=Xi0TX8roK_7oxN8P3a2UuAs&ip=34.249.118.49&id=o-APhQXWUkgI-5LLZFkyXiauEloMZSsD2EU-mLNEVrdFkW&itag=140&source=youtube&requiressl=yes&mh=x-&mm=31%2C26&mn=sn-q0c7rn76%2Csn-aigzrn7s&ms=au%2Conr&mv=u&mvi=1&pl=23&vprv=1&mime=audio%2Fmp4&gir=yes&clen=52291395&dur=3231.010&lmt=1575857698539497&mt=1595091905&fvip=1&keepalive=yes&beids=9466587&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgFvKaAcMeekReINF85eWcO_cQsXW8qLzyxv_S_faFx0sCIQCKODNGMgaiDQxjyNoU1fFPJ0CDAB-u5vE2NdoRSjHYbQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AG3C_xAwRAIgHf-Gnzqo9ffjJThHM7r4bpLA-hfD_agNHv3hvwVouNECIHwR3fja1WdZsb9SCUtAlJ4CSkjWaBsUy6toAPd2luxV&ratebypass=yes
I want to rename and start the download automatically when the user clicks download button .So i need to know how to modify the URL to achieve this goal .
Upvotes: 2
Views: 22288