2012-09-03 93 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請求並記錄它們的內容(不需要附加組件!)