2012-09-03 42 views
2

我可以使用卷曲抓取视频吗? 我使用网站从liveleak下载视频,但它停止工作。我需要这个用于我的一个脚本。CURL:抓住liveleak视频

基本上这是链接: http://www.liveleak.com/e/955_1345380192

重定向到这个 http://edge.liveleak.com/80281E/u/u/ll2_player_files/mp55/player.swf?config=http://www.liveleak.com/player?a=config%26item_token=955_1345380192%26embed=1%26extra_params=

和CONF链接包含视频链接。每次我尝试下载它,我得到 --->确保设置了file_url,file_token或playlist_token! http://www.liveleak.com/player?a=config%26item_token=955_1345380192%26embed=1%26extra_params=

是我到目前为止已经试过:

curl http://edge.liveleak.com/80281E/u/u/ll2_player_files/mp55/player.swf?config=http://www.liveleak.com/player?a=config%26item_token=955_1345380192%26embed=1%26extra_params= -s -L -b LCOOKIE -c LCOOKIE -o LIVE 

    curl http://edge.liveleak.com/80281E/u/u/ll2_player_files/mp55/player.swf?config=http://www.liveleak.com/player?a=config%26item_token=955_1345380192%26embed=1%26extra_params= -I 

    curl http://edge.liveleak.com/80281E/u/u/ll2_player_files/mp55/player.swf?config=http://www.liveleak.com/player?a=config%26item_token=955_1345380192%26embed=1%26extra_params= -v 

    curl http://www.liveleak.com/player?a=config&item_token=955_1345380192&embed=1&extra_params= 

    wget http://www.liveleak.com/player?a=config&item_token=955_1345380192&embed=1&extra_params= 

curl -A "Mozilla/5.0 (X11; U; Linux x86_64; ru; rv:1.9.2.15) Gecko/20110303 Ubuntu/10.10 (maverick) Firefox/3.6.15" http://www.liveleak.com/player?a=config&item_token=955_1345380192&embed=1&extra_params= 

回答

3

这是你的史诗一行代码:

UA="Mozilla/5.0 (X11; U; Linux x86_64; ru; rv:1.9.2.15) Gecko/20110303 Ubuntu/10.10 (maverick) Firefox/3.6.15"; curl -A "$UA" $(sed -n -e 's/.*<file>\(.*\)<\/file>.*/\1/p' <(wget -q -O - $(wget -U "$UA" -nv -r -np -nd -H --spider "http://www.liveleak.com/e/955_1345380192" 2>&1 | egrep ' URL:' | awk '{print $4}' | sed "s/.*\?config\=//g" | sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e))) 

按照要求,它使用卷曲(和一些额外的工具);请参阅bash手册和其他命令的文档以获得解释。

简短摘要:他们在xml文件中移动了关于视频的信息。让下一次使用最新的Firefox变得容易,它能够监视所有的HTTP请求并记录它们的内容(不需要附加组件!)