best way to save what you love
Svelte collaborationdownloaderinstagramjavascriptmusicredditsocial-mediasoundcloudsveltetiktoktwittertypescriptvideovimeovkwebappyoutubeyoutube-downloader
api/tiktok: validate that redirected link is still tiktok
wukkod69100c68d03
diff --git a/api/src/processing/services/tiktok.js b/api/src/processing/services/tiktok.jsindex 4524596d..3f5ea1fc 100644--- a/api/src/processing/services/tiktok.js+++ b/api/src/processing/services/tiktok.js@@ -24,8 +24,10 @@ export default async function(obj) {if (html.startsWith('<a href="https://')) {const extractedURL = html.split('<a href="')[1].split('?')[0];- const { patternMatch } = extract(normalizeURL(extractedURL));- postId = patternMatch?.postId;+ const { host, patternMatch } = extract(normalizeURL(extractedURL));+ if (host === "tiktok") {+ postId = patternMatch?.postId;+ }}}if (!postId) return { error: "fetch.short_link" };