Vimeo视频下载脚本,可以在视频下方生成下载按钮,只支持含有1080p的视频,有个跨域请求,请允许该操作,可到上面我的博客反映Bug。
< Σχολιασμός για τον κώδικα Vimeo视频下载脚本
The Hello Brothers, the link to my script is "https://vimeo.com/" instead of "https://player.vimeo.com/", their domain names are different, and secondly, If the page already provides a download link, the script will no longer create a download link, but in the latest version, I fixed it, even if there is a download link, I will still create it, I found an interesting thing, vimeo HTML The class name will change, which may make my script unable to create the download button, but I will continue to fix it.
Thanks for your quick answer !
For the video link; i use the same than you, but when i copy it in the Greasemonkey forum, it automatically transform in a Vimeo video player. About your fix: Now i see the download button , but when i click on it , it do nothing.
@decembre 说道: Thanks for your quick answer !
For the video link; i use the same than you, but when i copy it in the Greasemonkey forum, it automatically transform in a Vimeo video player. About your fix: Now i see the download button , but when i click on it , it do nothing.
我知道了,比如相同的Html,
<button class="sc-gZMcBi deFSmv" style="margin-left: 20px;"><a href="https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/01/3606/11/293033666/1112637818.mp4?token=1538646936-0x3eb1aded014ffecfaccf9322bf71494a7dc51843" style="color:rgb(248, 249, 250)" target="_blank"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">+下载</font></font></a></button>
在谷歌浏览器中它是可以点击的,但是在火狐浏览器中它是不可以点击的,我觉得你是因为这个原因。
I know, like the same Html,
<button class="sc-gZMcBi deFSmv" style="margin-left: 20px;"><a href="https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/01/3606/ 11/293033666/1112637818.mp4?token=1538646936-0x3eb1aded014ffecfaccf9322bf71494a7dc51843" style="color:rgb(248, 249, 250)" target="_blank"><font style="vertical-align: inherit;"><font style ="vertical-align: inherit;">+download</font></font></a></button>
It is clickable in Google Chrome, but it is not clickable in Firefox, I think you are for this reason.
Yes work perfectly in Chrome:
Just a request: Can you keep the name of the movie for the downloaded video ?
About firefox, an you do something ?
It seems related to CSP ?
My script needs to send a GET request. This is a dangerous operation. If the url is malicious, Tampermonkey will ask the user whether it is authorized. It can be directly authorized in Google Chrome, but it can't be in Firefox. I think For this reason, I need debug.
You try to edit the code and change the 'button' to 'div' so that you can solve the problem.
????
`// ==UserScript== // @name Vimeo视频下载脚本 // @namespace https://zhang18.top // @version 0.3.5 // @description Vimeo视频下载脚本,可以在视频下方生成下载按钮,只支持含有1080p的视频,有个跨域请求,请允许该操作,可到上面我的博客反映Bug。 // @author ZLOE // @match https://player.vimeo.com/video/?autoplay=1 // @match https://vimeo.com/ // @grant GMxmlhttpRequest // @grant GMdownload // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
// ==/UserScript==
(function() { 'use strict'; //获取视频下载链接 function getmp4(text){ var restr = /"mime":"video\/mp4","fps":\S?,"url":"(\S?)","cdn":"\S*?","quality":"1080p"/ var find = text.match(re_str)[1] console.log(find) return find }
//请求HTML
function get_find(url){
GM_xmlhttpRequest({
method: "GET",
url: url,
onload: function(res) {
console.log("请求HTML成功!")
if (res.status == 200) {
var text = res.responseText;
var find = get_mp4(text)
$('.clip_info-subline--watch .sc-jhAzac').after("<div class='sc-jhAzac cejtKN' style='margin-left: 20px;'><a href='"+find+"' style='color:rgb(248, 249, 250)' target='_blank'>+ Download</a></div>")
$('button.sc-gZMcBi.deFSmv').after("<div class='sc-gZMcBi deFSmv' style='margin-left: 20px;'><a href='"+find+"' style='color:rgb(248, 249, 250)' target='_blank'>+ Download</a></div>")
}
}
});
}
//不判断了,就是干
function run(){
var url = $('meta[property="og:video:url"]').attr("content")
console.log("获取url成功")
//调用获取下载链接函数
get_find(url)
}
//运行脚本
run()
// Your code here...
})();`
Fine :smile: was simple change ! Thanks Just for curiosity (i am not coder): why just changing "button" to "div" make a difference for firefox and CSP ?
:D I don't know, I am not a professional programmer. My major is to learn architecture.
:-)
Vimeo 视频下载脚本 [Script de téléchargement de vidéos Vimeo ] Seems not working ?
I don't see the Download button .... Test link: https://vimeo.com/156468821 I use Firefox (Waterfox 56.2.3)
Can you translate a lit bit , by example the download button: FR "Telecharger" US "Download"