mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +02:00
merge: api 10.9.3 from main
This commit is contained in:
commit
4202c954d1
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@imput/cobalt-api",
|
"name": "@imput/cobalt-api",
|
||||||
"description": "save what you love",
|
"description": "save what you love",
|
||||||
"version": "10.9.2",
|
"version": "10.9.3",
|
||||||
"author": "imput",
|
"author": "imput",
|
||||||
"exports": "./src/cobalt.js",
|
"exports": "./src/cobalt.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
@ -116,6 +116,7 @@ export const services = {
|
|||||||
"add/:username",
|
"add/:username",
|
||||||
"u/:username",
|
"u/:username",
|
||||||
"t/:shortLink",
|
"t/:shortLink",
|
||||||
|
"o/:spotlightId",
|
||||||
],
|
],
|
||||||
subdomains: ["t", "story"],
|
subdomains: ["t", "story"],
|
||||||
},
|
},
|
||||||
|
@ -78,5 +78,5 @@ export const testers = {
|
|||||||
|
|
||||||
"xiaohongshu": pattern =>
|
"xiaohongshu": pattern =>
|
||||||
pattern.id?.length <= 24 && pattern.token?.length <= 64
|
pattern.id?.length <= 24 && pattern.token?.length <= 64
|
||||||
|| pattern.shareId?.length <= 12,
|
|| pattern.shareId?.length <= 24,
|
||||||
}
|
}
|
||||||
|
@ -102,10 +102,10 @@ export default async function (obj) {
|
|||||||
params = await resolveRedirectingURL(`https://t.snapchat.com/${obj.shortLink}`);
|
params = await resolveRedirectingURL(`https://t.snapchat.com/${obj.shortLink}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.spotlightId) {
|
if (params?.spotlightId) {
|
||||||
const result = await getSpotlight(params.spotlightId);
|
const result = await getSpotlight(params.spotlightId);
|
||||||
if (result) return result;
|
if (result) return result;
|
||||||
} else if (params.username) {
|
} else if (params?.username) {
|
||||||
const result = await getStory(params.username, params.storyId, obj.alwaysProxy);
|
const result = await getStory(params.username, params.storyId, obj.alwaysProxy);
|
||||||
if (result) return result;
|
if (result) return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user