Greasy Fork

Greasy Fork is available in English.

视频时间戳(支持everything和alist)

在视频链接后面加上后缀 ?t=30 ,那么进入视频链接就会自动跳转到30秒。(everthing默认端口80。alist默认端口5244)

当前为 2023-11-07 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         视频时间戳(支持everything和alist)
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  在视频链接后面加上后缀 ?t=30 ,那么进入视频链接就会自动跳转到30秒。(everthing默认端口80。alist默认端口5244)
// @author       openAI
// @match        http://localhost/*
// @match        http://127.0.0.1/*
// @match        http://localhost:5244/*
// @match        http://127.0.0.1:5244/*
// @icon         https://img.icons8.com/?size=160&id=BiA4DdLOEKBN&format=png
// @license      MIT
// @grant        none
// ==/UserScript==

class myclass{
    static start(){
        return myclass.wait_video()
    }

    // 等待播放器加载
    static wait_video() {
        'use strict';
        let wait_video_interval = setInterval(() => {
            if(document.getElementsByTagName('video').length) {
                clearInterval(wait_video_interval)
                return myclass.modif_time()
            }
        }, 500);
    }

    static modif_time() {
        'use strict';
        //获取url参数
        const paramsStr = window.location.search
        const params = new URLSearchParams(paramsStr)
        const seconds = parseInt(params.get('t'))

        //进度条跳转
        let myVideo = document.getElementsByTagName("video")[0]
        if(seconds){
            myVideo.currentTime = seconds
            myVideo.play()
        }
    }
}

// 相当于主函数
(function() {
    'use strict';
    myclass.start()
})();