Skip to content

best way to save what you love

tiktok: fix shortlink parsing

dumbmoron2831bc06ad48
diff --git a/src/modules/processing/services/tiktok.js b/src/modules/processing/services/tiktok.js
index 6d3cf314..8edb2a5b 100644
--- a/src/modules/processing/services/tiktok.js
+++ b/src/modules/processing/services/tiktok.js
@@ -20,7 +20,8 @@ export default async function(obj) {
if (!html) return { error: 'ErrorCouldntFetch' };
if (html.startsWith('<a href="https://')) {
- const { patternMatch } = extract(html.split('<a href="https://')[1].split('?')[0]);
+ const extractedURL = html.split('<a href="')[1].split('?')[0];
+ const { patternMatch } = extract(extractedURL);
postId = patternMatch.postId
}
}