gpt4 book ai didi

android - 如何从YouTube视频获取flv网址

转载 作者:行者123 更新时间:2023-12-03 05:46:38 26 4
gpt4 key购买 nike

嘿,我知道这个问题太旧且重复,但是考虑到youtube API的不断变化的性质及其各种表示结构,我想再次提出这个问题。
如何获取YouTube视频的.flv网址。
请建议我链接或方式或代码(首选Java python c)。
谢谢

最佳答案

get_video_info页面很有趣。但是请考虑以下脚本

function urldecode {
awk -niord '{printf RT ? $0 chr("0x" substr(RT,2)) : $0}' RS=%..
}
curl -s 'www.youtube.com/get_video_info?el=detailpage&video_id=0KSOMA3QBU0' |
awk '/url_encoded_fmt_stream_map/ {print $2}' RS='&' FS== |
urldecode |
awk '
NR==1 {
gsub("=", "\n")
gsub("&", "\n\n")
print
}
' RS=, |
urldecode

这是输出

类型
video / mp4; + codecs =“avc1.64001F,+ mp4a.40.2”

网址
http://r15---sn-q4f7dnsd.googlevideo.com/videoplayback?ratebypass=yes&sver=3&expire=1416924562&sparams=gcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmm%2Cms%2Cmv%2Crateby 2Cexpire&UPN = 46fju6Z8Qm4&ITAG = 22&GCR = US&键= YT5&ID =邻AHo9GtJdhAeC8V2gYsFz5DB3nSacKl7ZCBp7vwMdfmyO&FEXP = 904845%2C907259%2C913430%2C914074%2C915516%2C927622%2C932404%2C943909%2C947209%2C947215%2C948124%2C952302%2C952605%2C952901%2C953912%2C957103%2C957105%2C957201&ipbits = 0&mm = 31&initcwndbps = 966250&mt = 1416902815&ip = 99.109.97.214&ms = au&mv = m&source = youtube

质量
hd720

s
D04D0409FCFC5CFF7BF2ACD0199DCE16AB298DD22B164.EC75C05FC8EE97A55A296B53B85456E915DDBC7F7D

Itag
22

fallback_host
tc.v17.cache7.googlevideo.com

如果按原样尝试该URL,它将无法正常工作。仅当您包含
decrypted s value

关于android - 如何从YouTube视频获取flv网址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27109139/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com