How can I get direct youtube video URL? I tried to do this with Chrome Network monitor. I used this video as example: https://www.youtube.com/watch?v=dQw4w9WgXcQ With this way i got this URL(It will expire tomorrow):
https://r2---sn-bpb5oxu-vqne.googlevideo.com/videoplayback?expire=1565036255&ei=fzpIXau_FYLwyQXAk7_IAw&ip=213.231.39.107&id=o-AMYUX0_QrQNg9MVm5kZz__GshDwdFlff2L5-DeeZzaoC&itag=248&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278%2C394%2C395%2C396%2C397%2C398&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-bpb5oxu-vqne%2Csn-3c27sn7k&ms=au%2Crdu&mv=m&mvi=1&pl=18&nh=%2CIgpwcjAxLmticDAxKgkxMjcuMC4wLjE&gcr=ua&initcwndbps=433750&mime=video%2Fwebm&gir=yes&clen=57856215&dur=212.040&lmt=1544415215209302&mt=1565014541&fvip=13&keepalive=yes&beids=9466586&c=web&txp=5535432&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cgcr%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cnh%2Cinitcwndbps&lsig=AHylml4wRAIgZVL3xFoRK47BJCnUf8Ngmdtzb06uxvo7EqoMFrRSua4CIGRoriCRXeEa_ZF2rRZN-KztSbS9l4vzkCQuD1VKpjDr&alr=yes&sig=ALgxI2wwRgIhAOzFGe22cfpqpEjyp_QIW6BacKYIICEqPT98Mj2SPHU8AiEA_leke3wKKgzJZq4tw2D8tlX30NYpFirEnmSnjDLqjLo%3D&cpn=G9F192iSCg-PzEPT&cver=html5
But the problem is that I can get only with built-in network monitor. I want to know how to do this programmatically? So how services and programs like youtube-dl obtain direct video and audio URL/URI? Can I get video URL with audio and video without using ffmpeg
to mux it?
youtube-dl
spends a lot of time reverse engineering Youtube and other sites and figuring that out. You won't get a better answer than by looking at the Python code yourself and trying to understand it.