問題描述
我看到今天 vimeo 改變了他們播放視頻的方式,我不能再播放他們的視頻了.我在生成視頻鏈接時看到了這一點,例如:
I saw that today vimeo changed the way they are streaming the videos and I can't stream their videos anymore. I saw that when I generate the link to the video, which was for example:
http://vimeo.com/moogaloop/play/clip:6649390/1eab2a25f30f1aadaf5e306d0f40fd6c/1292498602/?q=hd
它將我重定向到一個頁面,上面寫著權限被拒絕".我嘗試使用 curl,但沒有任何成功.我嗅探了流量,我看到它來自以下內容:
It's redirecting me to a page saying "Permission denied". I tried using curl, but without any success. I sniffed the traffic and I saw that it's streaming from something like:
http://av.vimeo.com/02047/623/34209065.mp4?token=1292496582_34de09a6d13212cf26af08357d311c30
有人知道如何獲取視頻文件的工作網址嗎?
Does anybody know how to get the working URL to the video file?
我目前獲取視頻的方式是:
The way I'm getting the videos at the moment is:
- 選擇鏈接
http://vimeo.com/video_id
. - 僅獲取
video_id
. - 獲取視頻的 XML
http://vimeo.com/moogaloop/load/clip:video_id;
. 解析 XML 并找到必要的信息:
- Choose link
http://vimeo.com/video_id
. - Get only the
video_id
. - Get the XML for the video
http://vimeo.com/moogaloop/load/clip:video_id;
. parse the XML and find the necessary information:
- request_signature
- request_signature_expires
- isHD
生成鏈接:
$video_link = "http://vimeo.com/moogaloop/play/clip:".$video_id."/".$request_signature."/".$request_signature_expires."/?q=".$quality."";
如果我通過瀏覽器手動執行此操作,它可以工作,但如果我通過腳本執行此操作,則不會.
If I do this manually through the browser it works, but if I do it through the script it doesn't.
推薦答案
在花了幾個小時尋找如何獲得 vimeo 的直接鏈接后,我找到了一個很好的解決方案.所以這里是那些想要直接從 vimeo 下載和流式傳輸視頻 src 的用戶的步驟.請記住,他們會阻止所有 IP 地址以及可能以這種方式下載視頻的主機,所以我只是停止使用他們的服務,以后再也不會使用它們了 :)
After spending a few hours on finding out how I can get the direct link to vimeo I found a good solution. So here are the steps for the users who want to download and stream video src directly from vimeo. Keep in mind that they block all IP addresses and probably hosts which are downloading the videos in this way, so I just stopped using their services and I will never use them again :).
獲取視頻源的步驟:
- 選擇鏈接
http://vimeo.com/video_id
- 只獲取
video_id
- 獲取視頻的 xml
http://vimeo.com/moogaloop/load/clip:video_id;
解析 xml,我找到了我需要的必要信息:
- choose link
http://vimeo.com/video_id
- get only the
video_id
- get the xml for the video
http://vimeo.com/moogaloop/load/clip:video_id;
parse the xml and I find the necessary information I need:
request_signature
request_signature_expires
isHD
然后我生成鏈接:
$video_link = "http://vimeo.com/moogaloop/play/clip:".$video_id."/".$request_signature."/".$request_signature_expires."/?q=".$quality."";
那如果你是php dev,就這樣通過exec調用wget命令
Then if you are php dev, you call wget command through exec in this way
exec("wget -b '$video_link' -a 'wget.log' -O -");
然后您閱讀日志并找到您要查找的鏈接.您可以簡單地解析日志文件.直接鏈接位于位置:"和[以下]"之間
Then you read the log and find out the link you are looking for. You can simply parse the log file. The direct link is between "Location: " and "[following]"
您返回直接鏈接并清理日志文件:)
You return the direct link and clean the log file :)
注意:再次記住,這不會永遠有效.他們遲早會封鎖你的 IP :).
NOTE: keep in mind again that this won't work forever. Sooner or later they will block your ip :).
這篇關于如何找到 vimeo 視頻的下載鏈接?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!