YouTube Shorts to regular URL Converter

Converts YouTube Shorts URLs to regular URLs

当前为 2024-12-09 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name YouTube Shorts to regular URL Converter
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Converts YouTube Shorts URLs to regular URLs
  6. // @author You
  7. // @match https://www.youtube.com/shorts/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. //
  16. const currentUrl = window.location.href;
  17. // Check if its a Shorts URL
  18. if (currentUrl.includes('/shorts/')) {
  19. // Extrahiere die Video-ID
  20. const videoId = currentUrl.split('/shorts/')[1].split('?')[0];
  21. // Create new URLURL
  22. const newUrl = `https://www.youtube.com/watch?v=${videoId}`;
  23. // redirect to regular Youtube Site
  24. window.location.href = newUrl;
  25. }
  26. })();