cyberdevil.invidious.settings.user.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // ==UserScript==
  2. // @name Invidious Settings
  3. // @version 1
  4. // @grant GM_cookie
  5. // @run-at document-start
  6. // @include https://yewtu.be/*
  7. // @include https://vid.puffyan.us/*
  8. // @include https://inv.riverside.rocks/*
  9. // @include https://invidious.kavin.rocks/*
  10. // @include https://invidio.xamh.de/*
  11. // @include https://y.com.sb/*
  12. // @include https://invidious.nerdvpn.de/*
  13. // @include https://yt.artemislena.eu/*
  14. // @include https://invidious.tiekoetter.com/*
  15. // @include https://invidious.flokinet.to/*
  16. // @include https://inv.bp.projectsegfau.lt/*
  17. // @include https://inv.vern.cc/*
  18. // @include https://inv.odyssey346.dev/*
  19. // @include https://invidious.snopyta.org/*
  20. // @include https://invidious.baczek.me/*
  21. // @include https://invidious.sethforprivacy.com/*
  22. // @include https://yt.funami.tech/*
  23. // @include https://invidious.drivet.xyz/*
  24. // @include https://vid.priv.au/*
  25. // @include https://invidious.silur.me/*
  26. // @include https://invidious.epicsite.xyz/*
  27. // @include https://invidious.slipfox.xyz/*
  28. // @include https://iv.ggtyler.dev/*
  29. // @include https://invidious.dhusch.de/*
  30. // @include https://invidious.weblibre.org/*
  31. // @include https://invidious.esmailelbob.xyz/*
  32. // @include https://iv.melmac.space/*
  33. // @include https://invidious.privacydev.net/*
  34. // @include https://invidious.lidarshield.cloud/*
  35. // @include https://invidious.namazso.eu/*
  36. // ==/UserScript==
  37. const options = {
  38. "annotations" : false,
  39. "annotations_subscribed" : false,
  40. "autoplay" : true,
  41. "automatic_instance_redirect": false,
  42. "continue" : true,
  43. "continue_autoplay" : true,
  44. "dark_mode" : "dark",
  45. "latest_only" : false,
  46. "listen" : false,
  47. "local" : true,
  48. "watch_history" : false,
  49. "vr_mode" : true,
  50. "show_nick" : false,
  51. "locale" : "en-US",
  52. "region" : "US",
  53. "max_results" : 40,
  54. "notifications_only" : false,
  55. "player_style" : "invidious",
  56. "quality" : "hd720",
  57. "quality_dash" : "auto",
  58. "default_home" : "Popular",
  59. "related_videos" : true,
  60. "sort" : "published",
  61. "speed" : 1.0,
  62. "thin_mode" : false,
  63. "unseen_only" : false,
  64. "video_loop" : false,
  65. "extend_desc" : false,
  66. "volume" : 100,
  67. "save_player_pos" : false
  68. }
  69. function getPrefs() {
  70. for (cookie of document.cookie.split('; ')) {
  71. const [name, value] = cookie.split("=");
  72. if (name === "PREFS") {
  73. return JSON.parse(decodeURIComponent(value));
  74. }
  75. }
  76. return {};
  77. }
  78. let prefs = getPrefs();
  79. let changed = false;
  80. for (opt in options) {
  81. if (prefs[opt] !== options[opt]) {
  82. prefs[opt] = options[opt];
  83. changed = true;
  84. }
  85. }
  86. if (changed === true) {
  87. document.cookie = "PREFS=" + encodeURIComponent(JSON.stringify(prefs)) + ";";
  88. }