Anti Youtube Shorts in inoreader

try to hide YT Shorts in inoreader

当前为 2023-02-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Anti Youtube Shorts in inoreader
  3. // @namespace Anong0u0
  4. // @version 0.1
  5. // @description try to hide YT Shorts in inoreader
  6. // @author Anong0u0
  7. // @match https://www.inoreader.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=inoreader.com
  9. // @require https://cdn.jsdelivr.net/npm/arrive@2.4.1/minified/arrive.min.js
  10. // @grant GM_xmlhttpRequest
  11. // @connect youtube.com
  12. // @license Beerware
  13. // ==/UserScript==
  14.  
  15. Node.prototype.getParentElement = function(times = 0){let e=this;for(let i=0;i<times;i++)e=e.parentElement;return e;}
  16.  
  17. const isShorts = (vid) =>
  18. {
  19. return new Promise((reslove) =>
  20. {
  21. const url = `https://www.youtube.com/shorts/${vid}`;
  22. GM_xmlhttpRequest(
  23. {
  24. method: "head",
  25. url: url,
  26. onload: (e) => reslove(e.finalUrl == url)
  27. });
  28. })
  29. }
  30.  
  31. document.arrive("a.article_title_link[href^='https://www.youtube.com']", async (e) =>
  32. {
  33. const vid = e.href.split("v=")[1].split("&")[0],
  34. iss = await isShorts(vid);
  35. //console.log(vid, iss)
  36. if (iss)
  37. {
  38. e.getParentElement(3).remove();
  39. }
  40. })
  41. //console.log(isShorts("zXmfvYeFViY"))