feat: ddinstagram.com support (#402)

Co-authored-by: dumbmoron <log@riseup.net>
This commit is contained in:
hyperdefined 2024-04-29 15:11:25 -04:00 committed by GitHub
parent 6392f912ad
commit 709d14ee9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View file

@ -79,6 +79,7 @@
},
"instagram": {
"alias": "instagram reels, posts & stories",
"altDomains": ["ddinstagram.com"],
"patterns": [
"reels/:postId", ":username/reel/:postId", "reel/:postId", "p/:postId", ":username/p/:postId",
"tv/:postId", "stories/:username/:storyId"

View file

@ -64,6 +64,12 @@ 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(host.domain) && [null, 'd', 'g'].includes(host.subdomain)) {
url.hostname = 'instagram.com';
}
break;
}
return url

View file

@ -878,6 +878,30 @@
"code": 200,
"status": "redirect"
}
}, {
"name": "ddinstagram link",
"url": "https://ddinstagram.com/p/CmCVWoIr9OH/",
"params": {},
"expected": {
"code": 200,
"status": "redirect"
}
}, {
"name": "d.ddinstagram.com link",
"url": "https://d.ddinstagram.com/p/CmCVWoIr9OH/",
"params": {},
"expected": {
"code": 200,
"status": "redirect"
}
}, {
"name": "g.ddinstagram.com link",
"url": "https://g.ddinstagram.com/p/CmCVWoIr9OH/",
"params": {},
"expected": {
"code": 200,
"status": "redirect"
}
}],
"vine": [{
"name": "regular vine link (9+10=21)",