有没有办法使用youtube-dl获取直接下载网址?
我用youtube-dl -g https://www.youtube.com/watch?v=xxx
它会返回第一眼看上去正确的网址,但会显示一个显示视频播放器的空白页面。我想提取直接下载URL,如下例所示。
链接到播放器:https://r4---sn-fpoq-cgpl.googlevideo.com/videoplayback?mime=video%2Fmp4&key=yt6&itag=22&lmt=1476010871066368&source=youtube&upn=4B17cM_dGEU&ei=cNdSWM7CKMjMigbzv62ADA&ip=151.45.98.20&requiressl=yes&initcwndbps=695000&ms=au&mt=1481824045&mv=m&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&id=o-AHTIR887C2uesvqaEJtgUJhaFssm050soDMhiXfgLQ1f&pl=16&mm=31&mn=sn-fpoq-cgpl&ipbits=0&dur=226.649&ratebypass=yes&expire=1481845712&signature=34BB16F2B7F758CA44680A778F46AC49EBCA3BE3.B0452B32B62D4AA133BA2F59E78EFD66FEA6298D
直接链接到文件:https://r4---sn-cu-n1qs.googlevideo.com/videoplayback?id=o-AFc2eS8nuL2DLN608O3_QxaAQWNDCeIRl9oGTvRo-fKM&ip=81.140.223.31&sparams=dur,ei,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pcm2,pcm2cms,pl,ratebypass,requiressl,source,upn,expire&ei=qdVSWOP7BIK7WaTrkdgM&dur=226.649&pl=25&initcwndbps=1175000&source=youtube&ratebypass=yes&pcm2cms=yes&requiressl=yes&pcm2=yes&expire=1481845257&key=yt6&mime=video/mp4&ipbits=0&lmt=1476010871066368&itag=22&mv=m&mt=1481823436&ms=au&mn=sn-cu-n1qs&mm=31&upn=6EUZ1r48CCw&signature=9F514204B90A32936912E5134B58BD8200177AF1.5A5C8BAC42B32C62229D078F0B566890F7DA524B&&title=Bruno+Mars+-+24K+Magic+%5BOfficial+Video%5D
有办法吗?
答案 0 :(得分:2)
我自己找到了答案,我不知道为什么要生成下载网址,唯一要做的就是在网址末尾添加标题,因此在第一个结尾添加&title=Bruno+Mars+-+24K+Magic+%5BOfficial+Video%5D
网址解决了我的问题。