global: disable tiktok watermark by default and remove a way to change it

tiktok replaced uploader's username in watermark with some corny shit like "Laughter awaits", making watermarks absolutely useless

instead of this feature the uploader's username is now always in the filename
This commit is contained in:
wukko
2024-03-16 22:26:04 +06:00
parent 24c03566e8
commit d87613a1fd
9 changed files with 9 additions and 143 deletions

View File

@ -89,7 +89,6 @@ export default async function(host, patternMatch, url, lang, obj) {
host: host,
postId: patternMatch.postId,
id: patternMatch.id,
noWatermark: obj.isNoTTWatermark,
fullAudio: obj.isTTFullAudio,
isAudioOnly: isAudioOnly
});

View File

@ -58,7 +58,9 @@ export default async function(obj) {
detail = selector(detail, obj.host, postId);
if (!detail) return { error: 'ErrorCouldntFetch' };
let video, videoFilename, audioFilename, isMp3, audio, images, filenameBase = `${obj.host}_${postId}`;
let video, videoFilename, audioFilename, isMp3, audio, images,
filenameBase = `${obj.host}_${detail.author.unique_id}_${postId}`;
if (obj.host === "tiktok") {
images = detail.image_post_info ? detail.image_post_info.images : false
} else {
@ -66,14 +68,10 @@ export default async function(obj) {
}
if (!obj.isAudioOnly && !images) {
video = obj.host === "tiktok" ? detail.video.download_addr.url_list[0] : detail.video.play_addr.url_list[2].replace("/play/", "/playwm/");
videoFilename = `${filenameBase}_video.mp4`;
if (obj.noWatermark) {
video = obj.host === "tiktok" ? detail.video.play_addr.url_list[0] : detail.video.play_addr.url_list[0];
videoFilename = `${filenameBase}_video_nw.mp4` // nw - no watermark
}
video = obj.host === "tiktok" ? detail.video.play_addr.url_list[0] : detail.video.play_addr.url_list[0];
videoFilename = `${filenameBase}.mp4`;
} else {
let fallback = obj.host === "douyin" ? detail.video.play_addr.url_list[0].replace("playwm", "play") : detail.video.play_addr.url_list[0];
let fallback = detail.video.play_addr.url_list[0];
audio = fallback;
audioFilename = `${filenameBase}_audio_fv`; // fv - from video
if (obj.fullAudio || fallback.includes("music")) {