From bef9b5b172ae3a475f4fd550dcb99e65238040ca Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 3 Aug 2024 16:50:57 +0600 Subject: [PATCH] snapchat: add support for android short links --- api/src/processing/match.js | 5 +---- api/src/processing/service-config.js | 3 ++- api/src/processing/services/snapchat.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/api/src/processing/match.js b/api/src/processing/match.js index c40d89bc..89579524 100644 --- a/api/src/processing/match.js +++ b/api/src/processing/match.js @@ -193,10 +193,7 @@ export default async function(host, patternMatch, lang, obj) { r = await dailymotion(patternMatch); break; case "snapchat": - r = await snapchat({ - hostname: url.hostname, - ...patternMatch - }); + r = await snapchat(patternMatch); break; case "loom": r = await loom({ diff --git a/api/src/processing/service-config.js b/api/src/processing/service-config.js index 68164ace..192e59fe 100644 --- a/api/src/processing/service-config.js +++ b/api/src/processing/service-config.js @@ -91,7 +91,8 @@ export const services = { "add/:username/:storyId", "u/:username/:storyId", "add/:username", - "u/:username" + "u/:username", + "t/:shortLink", ], subdomains: ["t", "story"], }, diff --git a/api/src/processing/services/snapchat.js b/api/src/processing/services/snapchat.js index 1c1eaf6d..00efaa9d 100644 --- a/api/src/processing/services/snapchat.js +++ b/api/src/processing/services/snapchat.js @@ -69,7 +69,7 @@ async function getStory(username, storyId) { export default async function (obj) { let params = obj; - if (obj.hostname === 't.snapchat.com' && obj.shortLink) { + if (obj.shortLink) { const link = await getRedirectingURL(`https://t.snapchat.com/${obj.shortLink}`); if (!link?.startsWith('https://www.snapchat.com/')) {