improve domain handling

This commit is contained in:
hyperdefined 2024-04-14 21:36:39 -04:00
parent bf1876f8b4
commit 1d39bdd7aa
No known key found for this signature in database
GPG Key ID: EB0B55B31E88AB03
2 changed files with 5 additions and 3 deletions

View File

@ -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"

View File

@ -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;
}