Greasy Fork 支持简体中文。

YTBetter - Enable Rewind/DVR

Unlocks rewind for YouTube live streams with disabled DVR

安裝腳本?
作者推薦腳本

您可能也會喜歡 YouTube All Videos Playlists (YAVP)

安裝腳本
  1. // ==UserScript==
  2. // @name YTBetter - Enable Rewind/DVR
  3. // @namespace YTBetter
  4. // @version 2.4
  5. // @description Unlocks rewind for YouTube live streams with disabled DVR
  6. // @description:ru Позволяет перематывать YouTube-стримы, где такая возможность заблокирована
  7. // @author copyMister
  8. // @match https://www.youtube.com/*
  9. // @match https://m.youtube.com/*
  10. // @run-at document-start
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  12. // @grant none
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. "use strict";
  17.  
  18. // Interop with "Simple YouTube Age Restriction Bypass"
  19. const {
  20. get: getter,
  21. set: setter,
  22. } = Object.getOwnPropertyDescriptor(Object.prototype, "playerResponse") ?? {
  23. set(value) {
  24. this[Symbol.for("YTBetter")] = value;
  25. },
  26. get() {
  27. return this[Symbol.for("YTBetter")];
  28. },
  29. };
  30.  
  31. const isObject = (value) => value != null && typeof value === "object";
  32.  
  33. Object.defineProperty(Object.prototype, "playerResponse", {
  34. set(value) {
  35. if (isObject(value)) {
  36. const { streamingData, videoDetails } = value;
  37. if (isObject(videoDetails) && videoDetails.isLive && !videoDetails.isLiveDvrEnabled) {
  38. videoDetails.isLiveDvrEnabled = true;
  39. if (isObject(streamingData)) {
  40. delete streamingData.serverAbrStreamingUrl;
  41. }
  42. }
  43. }
  44. setter.call(this, value);
  45. },
  46. get() {
  47. return getter.call(this);
  48. },
  49. configurable: true,
  50. });