feat: ddinstagram.com support (#402)
Co-authored-by: dumbmoron <log@riseup.net>
This commit is contained in:
parent
6392f912ad
commit
709d14ee9e
3 changed files with 31 additions and 0 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)",
|
||||
|
|
Loading…
Reference in a new issue