Youtube Utils (shorts => regular view)

3/15/2022, 10:19:34 PM

当前为 2022-07-15 提交的版本,查看 最新版本

// ==UserScript==
// @name        Youtube Utils (shorts => regular view)
// @namespace   Violentmonkey Scripts
// @include     https://*.youtube.*
// @version     2.2
// @author      KraXen72
// @grant       GM_registerMenuCommand
// @icon        https://img2.apksum.com/f9/com.google.android.youtube/16.01.34/icon.png
// @description 3/15/2022, 10:19:34 PM
// ==/UserScript==

const autoFixShorts = false

function shortsRegularView() {
  url = window.location.href
  parts = url.split("/")
    .filter(part => part !== "")
  shortsIndex = parts.indexOf("shorts")
  idIndex = shortsIndex + 1
  
  newurl = `https://youtube.com/watch?v=${parts[idIndex]}`
  window.location.href = newurl
  
  console.log("href:", parts)
  
}

function playbackRate(rate) {
  document.querySelector('video.html5-main-video').playbackRate = rate
}

GM_registerMenuCommand("shorts => regular view", shortsRegularView)
GM_registerMenuCommand("2x speed", () => { playbackRate(2) })
GM_registerMenuCommand("2.5x speed", () => { playbackRate(2.5) })
GM_registerMenuCommand("3x speed", () => { playbackRate(3) })
GM_registerMenuCommand("3.5x speed", () => { playbackRate(3.5) })

if (window.location.href.toString().includes("shorts") && autoFixShorts) shortsRegularView();

QingJ © 2025

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