From 1d39bdd7aa4ac64ac6b42f6df30688bff9e262b1 Mon Sep 17 00:00:00 2001 From: hyperdefined Date: Sun, 14 Apr 2024 21:36:39 -0400 Subject: [PATCH] improve domain handling --- src/modules/processing/servicesConfig.json | 3 ++- src/modules/processing/url.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/processing/servicesConfig.json b/src/modules/processing/servicesConfig.json index 970a8010..9ed97b32 100644 --- a/src/modules/processing/servicesConfig.json +++ b/src/modules/processing/servicesConfig.json @@ -78,7 +78,8 @@ }, "instagram": { "alias": "instagram reels, posts & stories", - "altDomains": ["ddinstagram.com", "d.ddinstagram.com", "g.ddinstagram.com"], + "subdomains": ["d", "g"], + "altDomains": ["ddinstagram.com"], "patterns": [ "reels/:postId", ":username/reel/:postId", "reel/:postId", "p/:postId", ":username/p/:postId", "tv/:postId", "stories/:username/:storyId" diff --git a/src/modules/processing/url.js b/src/modules/processing/url.js index 11f073d1..7e08712b 100644 --- a/src/modules/processing/url.js +++ b/src/modules/processing/url.js @@ -64,9 +64,10 @@ export function aliasURL(url) { if (url.hostname === 'dai.ly' && parts.length === 2) { url = new URL(`https://dailymotion.com/video/${parts[1]}`) } + break; case "ddinstagram": - if (services.instagram.altDomains.includes(url.hostname)) { - url.hostname = 'instagram.com' + if (services.instagram.altDomains.includes(host.domain) && (host.subdomain === null || services.instagram.subdomains.includes(host.subdomain))) { + url.hostname = 'instagram.com'; } break; }