From 5fe465a061c6a44c55f586d6bd768aba4a269fda Mon Sep 17 00:00:00 2001 From: qsniyg Date: Sat, 23 Sep 2023 11:50:50 +0000 Subject: [PATCH] Possibly fix #1218 --- src/userscript.ts | 9 ++++++--- userscript.user.js | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/userscript.ts b/src/userscript.ts index e130c6ef..feb74eee 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -56895,13 +56895,16 @@ var $$IMU_EXPORT$$; if (domain_nowww === "instagram.com") { newsrc = website_query({ - website_regex: /^[a-z]+:\/\/[^/]+\/+p\/+([^/]+)(?:\/+(?:(?:media|embed).*)?)?(?:[?#].*)?$/, - id: "post:${id}", + website_regex: { + regex: /^[a-z]+:\/\/[^/]+\/+(p|tv|reel)\/+([^/]+)(?:\/+(?:(?:media|embed).*)?)?(?:[?#].*)?$/, + groups: ["type", "id"] + }, + id: "post:${type}:${id}", run: function(cb, match) { var info:any = [{ type: "post", subtype: "link", - url: "https://www.instagram.com/p/" + match[1] + "/", + url: "https://www.instagram.com/" + match[1] + "/" + match[2] + "/", element: options.element }]; diff --git a/userscript.user.js b/userscript.user.js index 211aa02f..21a46833 100644 --- a/userscript.user.js +++ b/userscript.user.js @@ -51665,13 +51665,16 @@ var $$IMU_EXPORT$$; } if (domain_nowww === "instagram.com") { newsrc = website_query({ - website_regex: /^[a-z]+:\/\/[^/]+\/+p\/+([^/]+)(?:\/+(?:(?:media|embed).*)?)?(?:[?#].*)?$/, - id: "post:${id}", + website_regex: { + regex: /^[a-z]+:\/\/[^/]+\/+(p|tv|reel)\/+([^/]+)(?:\/+(?:(?:media|embed).*)?)?(?:[?#].*)?$/, + groups: ["type", "id"] + }, + id: "post:${type}:${id}", run: function(cb, match) { var info = [{ type: "post", subtype: "link", - url: "https://www.instagram.com/p/" + match[1] + "/", + url: "https://www.instagram.com/" + match[1] + "/" + match[2] + "/", element: options.element }]; var queries = common_functions["parse_imu_hash"](src);