From 5dcbe397dc06f936b44a5307befb6b410b83a4f9 Mon Sep 17 00:00:00 2001 From: wukko Date: Fri, 29 Mar 2024 06:44:07 +0600 Subject: [PATCH] tiktok: default to h264 but fall back to h265 --- src/modules/processing/services/tiktok.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/processing/services/tiktok.js b/src/modules/processing/services/tiktok.js index c7645211..046b08b3 100644 --- a/src/modules/processing/services/tiktok.js +++ b/src/modules/processing/services/tiktok.js @@ -47,11 +47,15 @@ export default async function(obj) { images = detail.image_post_info ? detail.image_post_info.images : false; + let playAddr = detail.video.play_addr_h264; + + if (!playAddr) playAddr = detail.video.play_addr; + if (!obj.isAudioOnly && !images) { - video = detail.video.play_addr.url_list[0]; + video = playAddr.url_list[0]; videoFilename = `${filenameBase}.mp4`; } else { - let fallback = detail.video.play_addr.url_list[0]; + let fallback = playAddr.url_list[0]; audio = fallback; audioFilename = `${filenameBase}_audio_fv`; // fv - from video if (obj.fullAudio || fallback.includes("music")) {