Vimeo Download

Adds a download button to the Vimeo video player. This is a rewrite of "Vimeo Embed Download" originally created by aleixdev (https://gf.qytechs.cn/en/scripts/376551).

当前为 2022-09-26 提交的版本,查看 最新版本

// ==UserScript==
// @name        Vimeo Download
// @namespace   http://tampermonkey.net/
// @version     1.0
// @description Adds a download button to the Vimeo video player. This is a rewrite of "Vimeo Embed Download" originally created by aleixdev (https://gf.qytechs.cn/en/scripts/376551).
// @author      You
// @match       https://vimeo.com/*
// @icon        https://www.google.com/s2/favicons?sz=64&domain=vimeo.com
// @grant       GM_download
// ==/UserScript==
(async function() {
    'use strict';
    if (document.title === 'VimeUhOh') return;
    const clips = vimeo.clips;
    const videoId = Object.keys(clips).at();
    if (!videoId) {
        throw new Error('[Vimeo Download] Error retrieving video meta data:', vimeo);
    }
    const { request, video } = clips[videoId];
    const streams = request.files.progressive.sort((a, b) => b.width - a.width);
    console.log(streams);
    const { url, quality } = streams[0];
    const button = Object.assign(document.createElement('button'), {
        innerHTML: '⥥',
        title: 'Download ' + quality,
        style: 'display: inline-block; font-size: 1.75em; margin: -0.25em 0 0 0.3em; color: #fff',
        onclick: function() {
            console.log(url, quality);
            GM_download(url, video.title.replace(/[<>:"\/\\|?*]/g, '') + '.mp4');
        },
        onmouseenter: function() {
            this.style.color = 'rgb(68,187,255)';
        },
        onmouseleave: function() {
            this.style.color = '#fff';
        }
    })
    const interval = setInterval(function() {
        if (!document.querySelector('.player .play-bar')) return;
        clearInterval(interval)
        document.querySelector('.player .play-bar').appendChild(button);
    }, 100);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址