我想用bash
下载(.smil)文件该文件的链接看起来像
http://website.fr:1535/3PBOLaEQ2kC19nmxtIYg8a4ziKlPQ9l0Jkn2hecxIexEZYc32znTlugcyxus%3D-08Fw3XtDFE9wrMbCGOZTOw%3D%3D.mp4?audioindex=0.smil
文件名 - 最后/
之后和.mp4
之前的所有内容 - 每次重新加载时都会更改,并嵌入到flashvars
内的网站代码中参数:
<param name="flashvars" value="netstreambasepath=http%3A%2F%2Fwebsite.fr%2Fvideo%2Fcelestial_method%2F5675-episode-4-04-fragments-d-emotions&id=yui_3_17_2_13_1414622045495_169&image=http%3A%2F%2Fi.jpg&skin=%2Fcomponents%2Fcom_vodvideo%2Fmediaplayer%2Fskin%2Fadn%2Fadn.xml&bufferlength=16000&repeat=list&title=undefined&logo=undefined&plugins=http%3A%2F%2Fwebsite.fr%2Fcomponents%2Fcom_vodvideo%2Fmediaplayer%2Fplugins%2Fcontrol%2Fcontrol.swf%2Chttp%3A%2F%2...wJgu2BiCfbqlqd6sQDZUlMO56C270iwoWT7GZ6txc%253D-ep69DPqWGsFsiQgVBAbiHQ%253D%253D.mp4%3Faudioindex%3D0.smil%22%2C%22default%22%3A%22http%3A%2F%website.fr%3A1935%2FS2v5wo0p7Fum7GI8_WlyBJU%252BXtVRjXY%252BkTuo_TXa0Wv0tpLLzR37DWx0AQkK52G9FMwJgu2BiCfbqlqd6sQDZUlMO56C270iwoWT7GZ6txc%253D-ep69DPqWGsFsiQgVBAbiHQ%253D%253D.mp4%3Faudioindex%3D0.smil%22%7D%5D&control.pluginmode=FLASH&mulutibu_v4_3.back=false&mulutibu_v4_3.cc=true&mulutibu_v4_3.pluginmode=FLASH&controlbar.position=over&dock.position=true">
如何直接提取链接以使用该文件启动VLC?
答案 0 :(得分:1)
以下是一个开始的地方:
# credit to https://gist.github.com/cdown/1163649
urldecode() {
local url_encoded="${1//+/ }"
printf '%b' "${url_encoded//%/\x}"
}
flashvars_u=$(
curl http://your-website/ | \
xmllint --html --xmlout - | \
xmlstarlet sel -t -m '//param[@name="flashvars"]' -v @value
)
flashvars=$(urldecode "$flashvars")
进一步从flashvars
中提取内容受到仅以编辑/修改形式提供的内容的阻碍,从而无法测试代码是否正确。