diff --git a/src/modules/processing/services/tiktok.js b/src/modules/processing/services/tiktok.js index 60f3fb76..97bacf36 100644 --- a/src/modules/processing/services/tiktok.js +++ b/src/modules/processing/services/tiktok.js @@ -4,10 +4,10 @@ import { extract } from "../url.js"; import Cookie from "../cookie/cookie.js"; const shortDomain = "https://vt.tiktok.com/"; -export const cookie = new Cookie({}) +export const cookie = new Cookie({}); export default async function(obj) { - let postId = obj.postId + let postId = obj.postId; if (!postId) { let html = await fetch(`${shortDomain}${obj.id}`, { @@ -20,7 +20,7 @@ export default async function(obj) { if (!html) return { error: 'ErrorCouldntFetch' }; if (html.startsWith('')[1] @@ -64,9 +64,14 @@ export default async function(obj) { video = playAddr; videoFilename = `${filenameBase}.mp4`; } else { - audio = detail.music.playUrl || playAddr; + audio = playAddr; audioFilename = `${filenameBase}_audio`; - if (audio.endsWith(".mp3")) bestAudio = 'mp3'; + + if (obj.fullAudio) { + audio = detail.music.playUrl; + audioFilename += `_original` + } + if (audio.includes("mime_type=audio_mpeg")) bestAudio = 'mp3'; } if (video) return {