🔥【就是爽】某度盘视频跳转(自动跳转)-不需安装UA agent....看网课专用!

直接上效果图,见下面........(2020122修改-适应了新链接)自动将百度网盘视频链接从play转换为pfile,方便下载。支持新的视频链接格式。(比如https://pan.baidu.com/play/video?_at_=1705936554287#/video?path=xxxxx.mp4&t=-1)

// ==UserScript==
// @name 🔥【就是爽】某度盘视频跳转(自动跳转)-不需安装UA agent....看网课专用!
// @namespace http://tampermonkey.net/
// @match https://pan.baidu.com/
// @match https://pan.baidu.com/*
// @exclude       *://pan.baidu.com/disk/*
// @version 0.2
// @description 直接上效果图,见下面........(2020122修改-适应了新链接)自动将百度网盘视频链接从play转换为pfile,方便下载。支持新的视频链接格式。(比如https://pan.baidu.com/play/video?_at_=1705936554287#/video?path=xxxxx.mp4&t=-1)
// @author   Yolanda Morgan
// @license  Yolanda Morgan
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==

(function() {
'use strict';

//如果是play,跳转到pfile
if (window.location.href.startsWith("https://pan.baidu.com/play/video#/video?path")) {
var url = window.location.href;
var newUrl = url.replace("/play/video#", "/pfile");
window.location.href = newUrl;
} else if (window.location.href.startsWith("https://pan.baidu.com/play")) { // 新的视频链接格式
    var urla = window.location.href;
    var pathIndex = urla.indexOf("path=") + 5;
    var tIndex = urla.indexOf("t=") + 2;

    var path = urla.substring(pathIndex, urla.indexOf("&", pathIndex));
    var t = urla.substring(tIndex, urla.length);

    var newUrla = "https://pan.baidu.com/pfile/video?path=" + path + "&t=" + t;

    window.location.href = newUrla;
}
})();