269 lines
76 KiB
JSON
269 lines
76 KiB
JSON
{
|
|
"created_by": "Tampermonkey",
|
|
"version": "1",
|
|
"scripts":
|
|
[
|
|
{
|
|
"name": "YouTube: Hide Watched Videos",
|
|
"options":
|
|
{
|
|
"check_for_updates": true,
|
|
"user_modified": null,
|
|
"comment": null,
|
|
"compatopts_for_requires": true,
|
|
"compat_wrappedjsobject": false,
|
|
"compat_metadata": false,
|
|
"compat_foreach": false,
|
|
"compat_powerful_this": null,
|
|
"sandbox": null,
|
|
"noframes": null,
|
|
"unwrap": null,
|
|
"run_at": null,
|
|
"tab_types": null,
|
|
"override":
|
|
{
|
|
"use_includes":
|
|
[],
|
|
"orig_includes":
|
|
[],
|
|
"merge_includes": true,
|
|
"use_matches":
|
|
[],
|
|
"orig_matches":
|
|
[
|
|
"http://*.youtube.com/*",
|
|
"http://youtube.com/*",
|
|
"https://*.youtube.com/*",
|
|
"https://youtube.com/*"
|
|
],
|
|
"merge_matches": true,
|
|
"use_excludes":
|
|
[],
|
|
"orig_excludes":
|
|
[],
|
|
"merge_excludes": true,
|
|
"use_connects":
|
|
[],
|
|
"orig_connects":
|
|
[],
|
|
"merge_connects": true,
|
|
"use_blockers":
|
|
[],
|
|
"orig_run_at": "document-idle",
|
|
"orig_noframes": true
|
|
}
|
|
},
|
|
"storage":
|
|
{
|
|
"ts": 1717332398540,
|
|
"data":
|
|
{}
|
|
},
|
|
"enabled": true,
|
|
"position": 1,
|
|
"file_url": "https://update.greasyfork.org/scripts/13040/YouTube%3A%20Hide%20Watched%20Videos.user.js",
|
|
"uuid": "f83161f4-fa69-45a5-a6f6-8396c33d456b",
|
|
"source": "Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBZb3VUdWJlOiBIaWRlIFdhdGNoZWQgVmlkZW9zCi8vIEBuYW1lc3BhY2UgICAgaHR0cHM6Ly93d3cuaGF1cy5nZy8KLy8gQHZlcnNpb24gICAgICA2LjMKLy8gQGxpY2Vuc2UgICAg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Rpb25zWzBdLmFkZGVkTm9kZXMubGVuZ3RoIHx8IG11dGF0aW9uc1swXS5yZW1vdmVkTm9kZXMubGVuZ3RoKSB7CgoJCQkJCQljYWxsYmFjayhtdXRhdGlvbnMpOwoJCQkJCX0KCQkJCX0pKTsKCgkJCQlvYnMub2JzZXJ2ZShvYmosIHtjaGlsZExpc3Q6IHRydWUsIHN1YnRyZWU6IHRydWV9KTsKCQkJfSBlbHNlIGlmIChldmVudExpc3RlbmVyU3VwcG9ydGVkKSB7CgkJCQlvYmouYWRkRXZlbnRMaXN0ZW5lcignRE9NTm9kZUluc2VydGVkJywgY2FsbGJhY2ssIGZhbHNlKTsKCQkJCW9iai5hZGRFdmVudExpc3RlbmVyKCdET01Ob2RlUmVtb3ZlZCcsIGNhbGxiYWNrLCBmYWxzZSk7CgkJCX0KCQl9OwoJfSgpKTsKCgkvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoKCWxvZ0RlYnVnKCdTdGFydGluZyBTY3JpcHQnKTsKCgkvLyBZb3VUdWJlIGRvZXMgbmF2aWdhdGlvbiB2aWEgaGlzdG9yeSBhbmQgYWxzbyBkb2VzIGEgYnVuY2gKCS8vIG9mIEFKQVggdmlkZW8gbG9hZGluZy4gSW4gb3JkZXIgdG8gZW5zdXJlIHdlJ3JlIGFsd2F5cyB1cAoJLy8gdG8gZGF0ZSwgd2UgaGF2ZSB0byBsaXN0ZW4gZm9yIEFOWSBET00gY2hhbmdlIGV2ZW50LCBhbmQKCS8vIHJlLXJ1biBvdXIgc2NyaXB0LgoJb2JzZXJ2ZURPTShkb2N1bWVudC5ib2R5LCBydW4pOwoKCXJ1bigpOwp9KCkpOwo=",
|
|
"requires":
|
|
[
|
|
{
|
|
"meta":
|
|
{
|
|
"name": "GM_config.js",
|
|
"url": "https://openuserjs.org/src/libs/sizzle/GM_config.js",
|
|
"ts": 1717332399295,
|
|
"mimetype": "text/javascript"
|
|
},
|
|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pbiBhcmcpIHsgLy8gY291bGQgYmUgYSBjYWxsYmFjayBmdW5jdGlvbnMgb3Igc2V0dGluZ3Mgb2JqZWN0DQogICAgICAgICAgICAgIGlmICh0eXBlb2YgYXJnW2pdICE9ICJmdW5jdGlvbiIpIHsgLy8gd2UgYXJlIGluIHRoZSBzZXR0aW5ncyBvYmplY3QNCiAgICAgICAgICAgICAgICBzZXR0aW5ncy5maWVsZHMgPSBhcmc7IC8vIHN0b3JlIHNldHRpbmdzIG9iamVjdA0KICAgICAgICAgICAgICAgIGJyZWFrOyAvLyBsZWF2ZSB0aGUgbG9vcA0KICAgICAgICAgICAgICB9IC8vIG90aGVyd2lzZSBpdCBtdXN0IGJlIGEgY2FsbGJhY2sgZnVuY3Rpb24NCiAgICAgICAgICAgICAgaWYgKCFzZXR0aW5ncy5ldmVudHMpIHNldHRpbmdzLmV2ZW50cyA9IHt9Ow0KICAgICAgICAgICAgICBzZXR0aW5ncy5ldmVudHNbal0gPSBhcmdbal07DQogICAgICAgICAgICB9DQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgICBjYXNlICdmdW5jdGlvbic6IC8vIHBhc3NpbmcgYSBiYXJlIGZ1bmN0aW9uIGlzIHNldCB0byBvcGVuIGNhbGxiYWNrDQogICAgICAgICAgICBzZXR0aW5ncy5ldmVudHMgPSB7b25PcGVuOiBhcmd9Ow0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgY2FzZSAnc3RyaW5nJzogLy8gY291bGQgYmUgY3VzdG9tIENTUyBvciB0aGUgdGl0bGUgc3RyaW5nDQogICAgICAgICAgICBpZiAoL1x3K1xzKlx7XHMqXHcrXHMqOlxzKlx3K1tcc3xcU10qXH0vLnRlc3QoYXJnKSkNCiAgICAgICAgICAgICAgc2V0dGluZ3MuY3NzID0gYXJnOw0KICAgICAgICAgICAgZWxzZQ0KICAgICAgICAgICAgICBzZXR0aW5ncy50aXRsZSA9IGFyZzsNCiAgICAgICAgICAgIGJyZWFrOw0KICAgICAg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gICAgICAgICBpZiAoZmllbGQpIHsNCiAgICAgICAgICAgIGlmIChjb25maWcuaXNPcGVuICYmIGZpZWxkRXhpc3RzKSB7DQogICAgICAgICAgICAgICAgY29uZmlnLmZpZWxkc1tpZF0ucmVtb3ZlKCk7DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIGNvbmZpZy5maWVsZHNbaWRdID0gbmV3IEdNX2NvbmZpZ0ZpZWxkKGZpZWxkLCBzdG9yZWRbaWRdLCBpZCwNCiAgICAgICAgICAgICAgY3VzdG9tVHlwZXNbZmllbGQudHlwZV0sIGNvbmZpZ0lkKTsNCg0KICAgICAgICAgICAgLy8gQWRkIGZpZWxkIHRvIG9wZW4gZnJhbWUNCiAgICAgICAgICAgIGlmIChjb25maWcuaXNPcGVuKSB7DQogICAgICAgICAgICAgIGNvbmZpZy5maWVsZHNbaWRdLndyYXBwZXIgPSBjb25maWcuZmllbGRzW2lkXS50b05vZGUoKTsNCiAgICAgICAgICAgICAgY29uZmlnLmZyYW1lU2VjdGlvbi5hcHBlbmRDaGlsZChjb25maWcuZmllbGRzW2lkXS53cmFwcGVyKTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICB9IGVsc2UgaWYgKCFmaWVsZCAmJiBmaWVsZEV4aXN0cykgew0KICAgICAgICAgICAgLy8gUmVtb3ZlIGZpZWxkIGZyb20gb3BlbiBmcmFtZQ0KICAgICAgICAgICAgaWYgKGNvbmZpZy5pc09wZW4pIHsNCiAgICAgICAgICAgICAgY29uZmlnLmZpZWxkc1tpZF0ucmVtb3ZlKCk7DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuZmllbGRzW2lkXTsNCiAgICAgICAgICB9DQogICAgICAgIH0NCg0KICAgICAgICBjb25maWcuaXNJbml0ID0gdHJ1ZTsNCiAgICAgICAgY29uZmlnLm9uSW5pdC5jYWxsKGNvbmZpZyk7DQogICAgICB9KTsNCiAgICB9IGVsc2Ugew0KICAgICAgY29uZml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yBBcHBlbmQgZWxlbWVudHMNCiAgICAgICAgbGV0IHNlY3Rpb24gPSBib2R5V3JhcHBlciwNCiAgICAgICAgICAgIHNlY051bSA9IDA7IC8vIFNlY3Rpb24gY291bnQNCg0KICAgICAgICAvLyBsb29wIHRocm91Z2ggZmllbGRzDQogICAgICAgIGZvciAobGV0IGlkIGluIGZpZWxkcykgew0KICAgICAgICAgIGxldCBmaWVsZCA9IGZpZWxkc1tpZF0sDQogICAgICAgICAgICAgIHNldHRpbmdzID0gZmllbGQuc2V0dGluZ3M7DQoNCiAgICAgICAgICBpZiAoc2V0dGluZ3Muc2VjdGlvbikgeyAvLyB0aGUgc3RhcnQgb2YgYSBuZXcgc2VjdGlvbg0KICAgICAgICAgICAgc2VjdGlvbiA9IGJvZHlXcmFwcGVyLmFwcGVuZENoaWxkKGNyZWF0ZSgnZGl2Jywgew0KICAgICAgICAgICAgICAgIGNsYXNzTmFtZTogJ3NlY3Rpb25faGVhZGVyX2hvbGRlcicsDQogICAgICAgICAgICAgICAgaWQ6IGNvbmZpZ0lkICsgJ19zZWN0aW9uXycgKyBzZWNOdW0NCiAgICAgICAgICAgICAgfSkpOw0KDQogICAgICAgICAgICBpZiAoIUFycmF5LmlzQXJyYXkoc2V0dGluZ3Muc2VjdGlvbikpDQogICAgICAgICAgICAgIHNldHRpbmdzLnNlY3Rpb24gPSBbc2V0dGluZ3Muc2VjdGlvbl07DQoNCiAgICAgICAgICAgIGlmIChzZXR0aW5ncy5zZWN0aW9uWzBdKQ0KICAgICAgICAgICAgICBzZWN0aW9uLmFwcGVuZENoaWxkKGNyZWF0ZSgnZGl2Jywgew0KICAgICAgICAgICAgICAgIGNsYXNzTmFtZTogJ3NlY3Rpb25faGVhZGVyIGNlbnRlcicsDQogICAgICAgICAgICAgICAgaWQ6IGNvbmZpZ0lkICsgJ19zZWN0aW9uX2hlYWRlcl8nICsgc2VjTnVtDQogICAgICAgICAgICAgIH0sIHNldHRpbmdzLnNlY3Rpb25bMF0pKTsNCg0KICAgICAgICAgICAgaWYgKHNldHRpbmdzLnNlY3Rpb25bMV0pDQogICAgICAgICAgICAgIHNlY3Rpb24uYXBwZW5kQ2hpbGQoY3JlYXRlKCdwJywgew0KICAgICAgICAgICAgICAgIGNsYXNzTmFtZTogJ3NlY3Rpb25fZGVzYyBjZW50ZXInLA0KICAgICAgICAgICAgICAgIGlkOiBjb25maWdJZCArICdfc2VjdGlvbl9kZXNjXycgKyBzZWNOdW0NCiAgICAgICAgICAgICAgfSwgc2V0dGluZ3Muc2VjdGlvblsxXSkpOw0KICAgICAgICAgICAgKytzZWNOdW07DQogICAgICAgICAgfQ0KICAgICAgICAgIA0KICAgICAgICAgIGlmIChzZWNOdW0gPT09IDApIHsNCiAgICAgICAgICAgIHNlY3Rpb24gPSBib2R5V3JhcHBlci5hcHBlbmRDaGlsZChjcmVhdGUoJ2RpdicsIHsNCiAgICAgICAgICAgICAgICBjbGFzc05hbWU6ICdzZWN0aW9uX2hlYWRlcl9ob2xkZXInLA0KICAgICAgICAgICAgICAgIGlkOiBjb25maWdJZCArICdfc2VjdGlvbl8nICsgKHNlY051bSsrKQ0KICAgICAgICAgICAgfSkpOw0KICAgICAgICAgIH0NCg0KICAgICAgICAgIC8vIENyZWF0ZSBmaWVsZCBlbGVtZW50cyBhbmQgYXBwZW5kIHRvIGN1cnJlbnQgc2VjdGlvbg0KICAgICAgICAgIHNlY3Rpb24uYXBwZW5kQ2hpbGQoKGZpZWxkLndyYXBwZXIgPSBmaWVsZC50b05vZGUoKSkpOw0KICAgICAgICB9DQogICAgICAgIA0KICAgICAgICBjb25maWcuZnJhbWVTZWN0aW9uID0gc2VjdGlvbjsNCg0KICAgICAgICAvLyBBZGQgc2F2ZSBhbmQgY2xvc2UgYnV0dG9ucw0KICAgICAgICBib2R5V3JhcHBlci5hcHBlbmRDaGlsZChjcmVhdGUoJ2RpdicsDQogICAgICAgICAge2lkOiBjb25maWdJZCArICdfYnV0dG9uc19ob2xkZXInfSwNCg0KICAgICAgICAgIGNyZWF0ZSgnYnV0dG9uJywgew0KICAgICAgICAgICAgaWQ6IGNvbmZpZ0lkICsgJ19zYXZlQnRuJywNCiAgICAgICAgICAgIHRleHRDb250ZW50OiAnU2F2ZScsDQogICAgICAgICAgICB0aXRsZTogJ1NhdmUgc2V0dGluZ3MnLA0KICAgICAgICAgICAgY2xhc3NOYW1lOiAnc2F2ZWNsb3NlX2J1dHRvbnMnLA0KICAgICAgICAgICAgb25jbGljazogZnVuY3Rpb24gKCkgeyBjb25maWcuc2F2ZSgpOyB9DQogICAgICAgICAgfSksDQoNCiAgICAgICAgICBjcmVhdGUoJ2J1dHRvbicsIHsNCiAgICAgICAgICAgIGlkOiBjb25maWdJZCArICdfY2xvc2VCdG4nLA0KICAgICAgICAgICAgdGV4dENvbnRlbnQ6ICdDbG9zZScsDQogICAgICAgICAgICB0aXRsZTogJ0Nsb3NlIHdpbmRvdycsDQogICAgICAgICAgICBjbGFzc05hbWU6ICdzYXZlY2xvc2VfYnV0dG9ucycsDQogICAgICAgICAgICBvbmNsaWNrOiBmdW5jdGlvbiAoKSB7IGNvbmZpZy5jbG9zZSgpOyB9DQogICAgICAgICAgfSksDQoNCiAgICAgICAgICBjcmVhdGUoJ2RpdicsDQogICAgICAgICAgICB7Y2xhc3NOYW1lOiAncmVzZXRfaG9sZGVyIGJsb2NrJ30sDQoNCiAgICAgICAgICAgIC8vIFJlc2V0IGxpbmsNCiAgICAgICAgICAgIGNyZWF0ZSgnYScsIHsNCiAgICAgICAgICAgICAgaWQ6IGNvbmZpZ0lkICsgJ19yZXNldExpbmsnLA0KICAgICAgICAgICAgICB0ZXh0Q29udGVudDogJ1Jlc2V0IHRvIGRlZmF1bHRzJywNCiAgICAgICAgICAgICAgaHJlZjogJyMnLA0KICAgICAgICAgICAgICB0aXRsZTogJ1Jlc2V0IGZpZWxkcyB0byBkZWZhdWx0IHZhbHVlcycsDQogICAgICAgICAgICAgIGNsYXNzTmFtZTogJ3Jlc2V0JywNCiAgICAgICAgICAgICAgb25jbGljazogZnVuY3Rpb24oZSkgeyBlLnByZXZlbnREZWZhdWx0KCk7IGNvbmZpZy5yZXNldCgpOyB9DQogICAgICAgICAgICB9KQ0KICAgICAgICApKSk7DQoNCiAgICAgICAgYm9keS5hcHBlbmRDaGlsZChib2R5V3JhcHBlcik7IC8vIFBhaW50IGV2ZXJ5dGhpbmcgdG8gd2luZG93IGF0IG9uY2UNCiAgICAgICAgY29uZmlnLmNlbnRlcigpOyAvLyBTaG93IGFuZCBjZW50ZXIgaWZyYW1lDQogICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdyZXNpemUnLCBjb25maWcuY2VudGVyLCBmYWxzZSk7IC8vIENlbnRlciBmcmFtZSBvbiByZXNpemUNCg0KICAgICAgICAvLyBDYWxsIHRoZSBvcGVuKCkgY2FsbGJhY2sgZnVuY3Rpb24NCiAgICAgICAgY29uZmlnLm9uT3Blbihjb25maWcuZnJhbWUuY29udGVudERvY3VtZW50IHx8IGNvbmZpZy5mcmFtZS5vd25lckRvY3VtZW50LA0KICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5mcmFtZS5jb250ZW50V2luZG93IHx8IHdpbmRvdywNCiAgICAgICAgICAgICAgICAgICAgICBjb25maWcuZnJhbWUpOw0KDQogICAgICAgIC8vIENsb3NlIGZyYW1lIG9uIHdpbmRvdyBjbG9zZQ0KICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcignYmVmb3JldW5sb2FkJywgZnVuY3Rpb24gKCkgew0KICAgICAgICAgICAgY29uZmlnLmNsb3NlKCk7DQogICAgICAgIH0sIGZhbHNlKTsNCg0KICAgICAgICAvLyBOb3cgdGhhdCBldmVyeXRoaW5nIGlzIGxvYWRlZCwgbWFrZSBpdCB2aXNpYmxlDQogICAgICAgIGNvbmZpZy5mcmFtZS5zdHlsZS5kaXNwbGF5ID0gImJsb2NrIjsNCiAgICAgICAgY29uZmlnLmlzT3BlbiA9IHRydWU7DQogICAg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nRMaXN0ZW5lcignbG9hZCcsIGZ1bmN0aW9uKGUpIHsNCiAgICAgICAgICAgIGxldCBmcmFtZSA9IGNvbmZpZy5mcmFtZTsNCiAgICAgICAgICAgIGlmICghZnJhbWUuY29udGVudERvY3VtZW50KSB7DQogICAgICAgICAgICAgIHRoYXQubG9nKCJHTV9jb25maWcgZmFpbGVkIHRvIGluaXRpYWxpemUgZGVmYXVsdCBzZXR0aW5ncyBkaWFsb2cgbm9kZSEiKTsNCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgIGxldCBib2R5ID0gZnJhbWUuY29udGVudERvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdib2R5JylbMF07DQogICAgICAgICAgICAgIGJvZHkuaWQgPSBjb25maWcuaWQ7IC8vIEFsbG93cyBmb3IgcHJlZml4aW5nIHN0eWxlcyB3aXRoIHRoZSBjb25maWcgaWQNCiAgICAgICAgICAgICAgYnVpbGRDb25maWdXaW4oYm9keSwgZnJhbWUuY29udGVudERvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdoZWFkJylbMF0pOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9LCBmYWxzZSk7DQogICAgICB9DQogICAgfSwNCg0KICAgIHNhdmU6IGZ1bmN0aW9uICgpIHsNCiAgICAgIHRoaXMud3JpdGUobnVsbCwgbnVsbCwgKHZhbHMpID0+IHRoaXMub25TYXZlKHZhbHMpKTsNCiAgICB9LA0KDQogICAgY2xvc2U6IGZ1bmN0aW9uKCkgew0KICAgICAgLy8gSWYgZnJhbWUgaXMgYW4gaWZyYW1lIHRoZW4gcmVtb3ZlIGl0DQogICAgICBpZiAodGhpcy5mcmFtZSAmJiB0aGlzLmZyYW1lLmNvbnRlbnREb2N1bWVudCkgew0KICAgICAgICB0aGlzLnJlbW92ZSh0aGlzLmZyYW1lKTsNCiAgICAgICAgdGhpcy5mcmFtZSA9IG51bGw7DQogICAgICB9IGVsc2UgaWYgKHRoaXMuZn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NCiAgICAgIGxldCBmaWVsZCA9IHRoaXMuZmllbGRzW25hbWVdLA0KICAgICAgICAgIGZpZWxkVmFsID0gbnVsbDsNCg0KICAgICAgaWYgKGdldExpdmUgJiYgZmllbGQubm9kZSkgew0KICAgICAgICBmaWVsZFZhbCA9IGZpZWxkLnRvVmFsdWUoKTsNCiAgICAgIH0NCg0KICAgICAgcmV0dXJuIGZpZWxkVmFsICE9IG51bGwgPyBmaWVsZFZhbCA6IGZpZWxkLnZhbHVlOw0KICAgIH0sDQoNCiAgICB3cml0ZTogZnVuY3Rpb24gKHN0b3JlLCBvYmosIGNiKSB7DQogICAgICBsZXQgZm9yZ290dGVuID0gbnVsbCwNCiAgICAgICAgICB2YWx1ZXMgPSBudWxsOw0KICAgICAgaWYgKCFvYmopIHsNCiAgICAgICAgbGV0IGZpZWxkcyA9IHRoaXMuZmllbGRzOw0KDQogICAgICAgIHZhbHVlcyA9IHt9Ow0KICAgICAgICBmb3Jnb3R0ZW4gPSB7fTsNCg0KICAgICAgICBmb3IgKGxldCBpZCBpbiBmaWVsZHMpIHsNCiAgICAgICAgICBsZXQgZmllbGQgPSBmaWVsZHNbaWRdOw0KICAgICAgICAgIGxldCB2YWx1ZSA9IGZpZWxkLnRvVmFsdWUoKTsNCg0KICAgICAgICAgIGlmIChmaWVsZC5zYXZlKSB7DQogICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgew0KICAgICAgICAgICAgICB2YWx1ZXNbaWRdID0gdmFsdWU7DQogICAgICAgICAgICAgIGZpZWxkLnZhbHVlID0gdmFsdWU7DQogICAgICAgICAgICB9IGVsc2UNCiAgICAgICAgICAgICAgdmFsdWVzW2lkXSA9IGZpZWxkLnZhbHVlOw0KICAgICAgICAgIH0gZWxzZQ0KICAgICAgICAgICAgZm9yZ290dGVuW2lkXSA9IHZhbHVlICE9IG51bGwgPyB2YWx1ZSA6IGZpZWxkLnZhbHVlOw0KICAgICAgICB9DQogICAgICB9DQoNCiAgICAgIChhc3luYy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QogICAgY3JlYXRlOiBmdW5jdGlvbiAoKSB7DQogICAgICBsZXQgQSA9IG51bGwsDQogICAgICAgICAgQiA9IG51bGw7DQogICAgICBzd2l0Y2goYXJndW1lbnRzLmxlbmd0aCkgew0KICAgICAgICBjYXNlIDE6DQogICAgICAgICAgQSA9IGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKGFyZ3VtZW50c1swXSk7DQogICAgICAgICAgYnJlYWs7DQogICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgQSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoYXJndW1lbnRzWzBdKTsNCiAgICAgICAgICBCID0gYXJndW1lbnRzWzFdOw0KICAgICAgICAgIGZvciAobGV0IGIgaW4gQikgew0KICAgICAgICAgICAgaWYgKGIuaW5kZXhPZigib24iKSA9PSAwKQ0KICAgICAgICAgICAgICBBLmFkZEV2ZW50TGlzdGVuZXIoYi5zdWJzdHJpbmcoMiksIEJbYl0sIGZhbHNlKTsNCiAgICAgICAgICAgIGVsc2UgaWYgKCIsc3R5bGUsYWNjZXNza2V5LGlkLG5hbWUsc3JjLGhyZWYsd2hpY2gsZm9yIi5pbmRleE9mKCIsIiArDQogICAgICAgICAgICAgICAgICAgICBiLnRvTG93ZXJDYXNlKCkpICE9IC0xKQ0KICAgICAgICAgICAgICBBLnNldEF0dHJpYnV0ZShiLCBCW2JdKTsNCiAgICAgICAgICAgIGVsc2UNCiAgICAgICAgICAgICAgQVtiXSA9IEJbYl07DQogICAgICAgICAgfQ0KICAgICAgICAgIGlmICh0eXBlb2YgYXJndW1lbnRzWzJdID09ICJzdHJpbmciKQ0KICAgICAgICAgICAgQS5pbm5lckhUTUwgPSBhcmd1bWVudHNbMl07DQogICAgICAgICAgZWxzZQ0KICAgICAgICAgICAgZm9yIChsZXQgaSA9IDIsIGxlbiA9IGFyZ3VtZW50cy5sZW5ndGg7IGkgPCBsZW47ICsraSkNCiAgICAgICAgICAgICAgQS5hcHBlbmRDaGlsZChhcmd1bW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ICAgICAgICBpZDogY29uZmlnSWQgKyAnXycgKyBpZCArICdfZmllbGRfbGFiZWwnLA0KICAgICAgICBmb3I6IGNvbmZpZ0lkICsgJ19maWVsZF8nICsgaWQsDQogICAgICAgIGNsYXNzTmFtZTogJ2ZpZWxkX2xhYmVsJw0KICAgICAgfSwgZmllbGQubGFiZWwpIDogbnVsbDsNCg0KICAgIGxldCB3cmFwID0gbnVsbDsNCiAgICBzd2l0Y2ggKHR5cGUpIHsNCiAgICAgIGNhc2UgJ3RleHRhcmVhJzoNCiAgICAgICAgcmV0Tm9kZS5hcHBlbmRDaGlsZCgodGhpcy5ub2RlID0gY3JlYXRlKCd0ZXh0YXJlYScsIHsNCiAgICAgICAgICBpbm5lckhUTUw6IHZhbHVlLA0KICAgICAgICAgIGlkOiBjb25maWdJZCArICdfZmllbGRfJyArIGlkLA0KICAgICAgICAgIGNsYXNzTmFtZTogJ2Jsb2NrJywNCiAgICAgICAgICBjb2xzOiAoZmllbGQuY29scyA/IGZpZWxkLmNvbHMgOiAyMCksDQogICAgICAgICAgcm93czogKGZpZWxkLnJvd3MgPyBmaWVsZC5yb3dzIDogMikNCiAgICAgICAgfSkpKTsNCiAgICAgICAgYnJlYWs7DQogICAgICBjYXNlICdyYWRpbyc6DQogICAgICAgIHdyYXAgPSBjcmVhdGUoJ2RpdicsIHsNCiAgICAgICAgICBpZDogY29uZmlnSWQgKyAnX2ZpZWxkXycgKyBpZA0KICAgICAgICB9KTsNCiAgICAgICAgdGhpcy5ub2RlID0gd3JhcDsNCg0KICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gb3B0aW9ucy5sZW5ndGg7IGkgPCBsZW47ICsraSkgew0KICAgICAgICAgIGxldCByYWRMYWJlbCA9IGNyZWF0ZSgnbGFiZWwnLCB7DQogICAgICAgICAgICBjbGFzc05hbWU6ICdyYWRpb19sYWJlbCcNCiAgICAgICAgICB9LCBvcHRpb25zW2ldKTsNCg0KICAgICAgICAgIGxldCByYWQgPSB3cmF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pKTsNCiAgICAgICAgfQ0KDQogICAgICAgIHJldE5vZGUuYXBwZW5kQ2hpbGQod3JhcCk7DQogICAgICAgIGJyZWFrOw0KICAgICAgZGVmYXVsdDogLy8gZmllbGRzIHVzaW5nIGlucHV0IGVsZW1lbnRzDQogICAgICAgIGxldCBwcm9wcyA9IHsNCiAgICAgICAgICBpZDogY29uZmlnSWQgKyAnX2ZpZWxkXycgKyBpZCwNCiAgICAgICAgICB0eXBlOiB0eXBlLA0KICAgICAgICAgIHZhbHVlOiB0eXBlID09ICdidXR0b24nID8gZmllbGQubGFiZWwgOiB2YWx1ZQ0KICAgICAgICB9Ow0KDQogICAgICAgIHN3aXRjaCAodHlwZSkgew0KICAgICAgICAgIGNhc2UgJ2NoZWNrYm94JzoNCiAgICAgICAgICAgIHByb3BzLmNoZWNrZWQgPSB2YWx1ZTsNCiAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgIGNhc2UgJ2J1dHRvbic6DQogICAgICAgICAgICBwcm9wcy5zaXplID0gZmllbGQuc2l6ZSA/IGZpZWxkLnNpemUgOiAyNTsNCiAgICAgICAgICAgIGlmIChmaWVsZC5zY3JpcHQpIGZpZWxkLmNsaWNrID0gZmllbGQuc2NyaXB0Ow0KICAgICAgICAgICAgaWYgKGZpZWxkLmNsaWNrKSBwcm9wcy5vbmNsaWNrID0gZmllbGQuY2xpY2s7DQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgICBjYXNlICdoaWRkZW4nOg0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgZGVmYXVsdDoNCiAgICAgICAgICAgIC8vIHR5cGUgPSB0ZXh0LCBpbnQsIG9yIGZsb2F0DQogICAgICAgICAgICBwcm9wcy50eXBlID0gJ3RleHQnOw0KICAgICAgICAgICAgcHJvcHMuc2l6ZSA9IGZpZWxkLnNpemUgPyBmaWVsZC5zaXplIDogMjU7DQogICAgICAgIH0NCg0KICAgICAgICByZXROb2RlLmFwcGVuZENoaWxkKCh0aGlzLm5vZ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YXNlICdyYWRpbyc6DQogICAgICAgIGxldCByYWRpb3MgPSBub2RlLmdldEVsZW1lbnRzQnlUYWdOYW1lKCdpbnB1dCcpOw0KICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gcmFkaW9zLmxlbmd0aDsgaSA8IGxlbjsgKytpKSB7DQogICAgICAgICAgaWYgKHJhZGlvc1tpXS5jaGVja2VkKQ0KICAgICAgICAgICAgcnZhbCA9IHJhZGlvc1tpXS52YWx1ZTsNCiAgICAgICAgfQ0KICAgICAgICBicmVhazsNCiAgICAgIGNhc2UgJ2J1dHRvbic6DQogICAgICAgIGJyZWFrOw0KICAgICAgY2FzZSAnaW50JzogY2FzZSAnaW50ZWdlcic6DQogICAgICBjYXNlICdmbG9hdCc6IGNhc2UgJ251bWJlcic6DQogICAgICAgIGxldCBudW0gPSBOdW1iZXIobm9kZS52YWx1ZSk7DQogICAgICAgIGxldCB3YXJuID0gJ0ZpZWxkIGxhYmVsZWQgIicgKyBmaWVsZC5sYWJlbCArICciIGV4cGVjdHMgYScgKw0KICAgICAgICAgICh1bnNpZ25lZCA/ICcgcG9zaXRpdmUgJyA6ICduICcpICsgJ2ludGVnZXIgdmFsdWUnOw0KDQogICAgICAgIGlmIChpc05hTihudW0pIHx8ICh0eXBlLnN1YnN0cigwLCAzKSA9PSAnaW50JyAmJg0KICAgICAgICAgICAgTWF0aC5jZWlsKG51bSkgIT0gTWF0aC5mbG9vcihudW0pKSB8fA0KICAgICAgICAgICAgKHVuc2lnbmVkICYmIG51bSA8IDApKSB7DQogICAgICAgICAgYWxlcnQod2FybiArICcuJyk7DQogICAgICAgICAgcmV0dXJuIG51bGw7DQogICAgICAgIH0NCg0KICAgICAgICBpZiAoIXRoaXMuX2NoZWNrTnVtYmVyUmFuZ2UobnVtLCB3YXJuKSkNCiAgICAgICAgICByZXR1cm4gbnVsbDsNCiAgICAgICAgcnZhbCA9IG51bTsNCiAgICAgICAgYnJlYWs7DQogICAgICBkZWZhdWx0Og0KICAg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gKyAnIGxlc3MgdGhhbiBvciBlcXVhbCB0byAnICsgZmllbGQubWF4ICsgJy4nKTsNCiAgICAgIHJldHVybiBudWxsOw0KICAgIH0NCiAgICByZXR1cm4gdHJ1ZTsNCiAgfQ0KfTsNCg=="
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "YouTube: Hide LONG Videos",
|
|
"options":
|
|
{
|
|
"check_for_updates": true,
|
|
"user_modified": null,
|
|
"comment": null,
|
|
"compatopts_for_requires": true,
|
|
"compat_wrappedjsobject": false,
|
|
"compat_metadata": false,
|
|
"compat_foreach": false,
|
|
"compat_powerful_this": null,
|
|
"sandbox": null,
|
|
"noframes": null,
|
|
"unwrap": null,
|
|
"run_at": null,
|
|
"tab_types": null,
|
|
"override":
|
|
{
|
|
"use_includes":
|
|
[],
|
|
"orig_includes":
|
|
[],
|
|
"merge_includes": true,
|
|
"use_matches":
|
|
[],
|
|
"orig_matches":
|
|
[
|
|
"https://*.youtube.com/*",
|
|
"https://youtube.com/*"
|
|
],
|
|
"merge_matches": true,
|
|
"use_excludes":
|
|
[],
|
|
"orig_excludes":
|
|
[],
|
|
"merge_excludes": true,
|
|
"use_connects":
|
|
[],
|
|
"orig_connects":
|
|
[],
|
|
"merge_connects": true,
|
|
"use_blockers":
|
|
[],
|
|
"orig_run_at": "document-idle",
|
|
"orig_noframes": true
|
|
}
|
|
},
|
|
"storage":
|
|
{
|
|
"ts": 1717338755736,
|
|
"data":
|
|
{}
|
|
},
|
|
"enabled": true,
|
|
"position": 2,
|
|
"file_url": "https://source.garden/scripts/yt-hide-long/raw/branch/latest/script.user.js",
|
|
"uuid": "8468d1fe-15ad-48f1-87ce-6c53fd8f927c",
|
|
"source": "Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUJCVlvdVR1YmU6IEhpZGUgTE9ORyBWaWRlb3MKLy8gQG5hbWVzcGFjZQlodHRwczovL3NvdXJjZS5nYXJkZW4KLy8gQHZlcnNpb24JCTEuMAovLyBAbGljZW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5xdWVyeVNlbGVjdG9yKCcjcGFnZS1tYW5hZ2VyJykKCQksIHsgY2hpbGRMaXN0OnRydWUsIHN1YnRyZWU6dHJ1ZSB9CgkpCgp9KSgpCg=="
|
|
},
|
|
{
|
|
"name": "YouTube: Hide UPCOMING Videos",
|
|
"options":
|
|
{
|
|
"check_for_updates": true,
|
|
"user_modified": null,
|
|
"comment": null,
|
|
"compatopts_for_requires": true,
|
|
"compat_wrappedjsobject": false,
|
|
"compat_metadata": false,
|
|
"compat_foreach": false,
|
|
"compat_powerful_this": null,
|
|
"sandbox": null,
|
|
"noframes": null,
|
|
"unwrap": null,
|
|
"run_at": null,
|
|
"tab_types": null,
|
|
"override":
|
|
{
|
|
"use_includes":
|
|
[],
|
|
"orig_includes":
|
|
[],
|
|
"merge_includes": true,
|
|
"use_matches":
|
|
[],
|
|
"orig_matches":
|
|
[
|
|
"https://youtube.com/*",
|
|
"https://*.youtube.com/*"
|
|
],
|
|
"merge_matches": true,
|
|
"use_excludes":
|
|
[],
|
|
"orig_excludes":
|
|
[],
|
|
"merge_excludes": true,
|
|
"use_connects":
|
|
[],
|
|
"orig_connects":
|
|
[],
|
|
"merge_connects": true,
|
|
"use_blockers":
|
|
[],
|
|
"orig_run_at": "document-idle",
|
|
"orig_noframes": true
|
|
}
|
|
},
|
|
"storage":
|
|
{
|
|
"ts": 1717340259739,
|
|
"data":
|
|
{}
|
|
},
|
|
"enabled": true,
|
|
"position": 3,
|
|
"file_url": "https://source.garden/scripts/yt-hide-upcoming/raw/branch/latest/script.user.js",
|
|
"uuid": "65a91564-169a-4350-b82b-0d2e705f8794",
|
|
"source": "Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUJCVlvdVR1YmU6IEhpZGUgVVBDT01JTkcgVmlkZW9zCi8vIEBuYW1lc3BhY2UJaHR0cHM6Ly9zb3VyY2UuZ2FyZGVuCi8vIEB2ZXJzaW9uCQkxLjEKLy8gQGxpY2Vuc2UJCUNDMAovLyBAZGVzY3J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oaWxkTGlzdDp0cnVlLCBzdWJ0cmVlOnRydWUgfQoJKQoKfSkoKQo="
|
|
},
|
|
{
|
|
"name": "YouTube: Hide LIVE Videos",
|
|
"options":
|
|
{
|
|
"check_for_updates": true,
|
|
"user_modified": null,
|
|
"comment": null,
|
|
"compatopts_for_requires": true,
|
|
"compat_wrappedjsobject": false,
|
|
"compat_metadata": false,
|
|
"compat_foreach": false,
|
|
"compat_powerful_this": null,
|
|
"sandbox": null,
|
|
"noframes": null,
|
|
"unwrap": null,
|
|
"run_at": null,
|
|
"tab_types": null,
|
|
"override":
|
|
{
|
|
"use_includes":
|
|
[],
|
|
"orig_includes":
|
|
[],
|
|
"merge_includes": true,
|
|
"use_matches":
|
|
[],
|
|
"orig_matches":
|
|
[
|
|
"https://youtube.com/*",
|
|
"https://*.youtube.com/*"
|
|
],
|
|
"merge_matches": true,
|
|
"use_excludes":
|
|
[],
|
|
"orig_excludes":
|
|
[],
|
|
"merge_excludes": true,
|
|
"use_connects":
|
|
[],
|
|
"orig_connects":
|
|
[],
|
|
"merge_connects": true,
|
|
"use_blockers":
|
|
[],
|
|
"orig_run_at": "document-idle",
|
|
"orig_noframes": true
|
|
}
|
|
},
|
|
"storage":
|
|
{
|
|
"ts": 1717340433941,
|
|
"data":
|
|
{}
|
|
},
|
|
"enabled": true,
|
|
"position": 4,
|
|
"file_url": "https://https://source.garden/scripts/yt-hide-live/raw/branch/latest/script.user.js",
|
|
"uuid": "e9c55f4e-a9f1-41f0-87e1-63a94d7e3cd2",
|
|
"source": "Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUJCVlvdVR1YmU6IEhpZGUgTElWRSBWaWRlb3MKLy8gQHZlcnNpb24JCTEuMwovLyBAbGljZW5zZQlDQzAKLy8gQGRlc2NyaXB0aW9uCUhpZGUgTElWRSB2aWRlb3Mgb24gWW91VHViZSdzIHBhZ2VzCi8vIEBhdXRob3IJCVdpbSBHb2RkZW4gPHdpbUB3aW1nb2RkZW4uYmU+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