Skip to content

best way to save what you love

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

wukkod87613a1fd3e
diff --git a/docs/api.md b/docs/api.md
index 6b3b9aaa..f2dc5492 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -27,7 +27,6 @@ Content-Type: application/json
| `aFormat` | `string` | `best / mp3 / ogg / wav / opus` | `mp3` | |
| `filenamePattern` | `string` | `classic / pretty / basic / nerdy` | `classic` | changes the way files are named. previews can be seen in the web app. |
| `isAudioOnly` | `boolean` | `true / false` | `false` | |
-| `isNoTTWatermark` | `boolean` | `true / false` | `false` | changes whether downloaded tiktok videos have watermarks. |
| `isTTFullAudio` | `boolean` | `true / false` | `false` | enables download of original sound used in a tiktok video. |
| `isAudioMuted` | `boolean` | `true / false` | `false` | disables audio track in video downloads. |
| `dubLang` | `boolean` | `true / false` | `false` | backend uses Accept-Language header for youtube video audio tracks when `true`. |
diff --git a/src/front/cobalt.js b/src/front/cobalt.js
index 6d24247e..e24fbe5d 100644
--- a/src/front/cobalt.js
+++ b/src/front/cobalt.js
@@ -24,7 +24,6 @@ const checkboxes = [
"alwaysVisibleButton",
"disableChangelog",
"downloadPopup",
- "disableTikTokWatermark",
"fullTikTokAudio",
"muteAudio",
"reduceTransparency",
@@ -369,13 +368,11 @@ async function download(url) {
if (sGet("vimeoDash") === "true") req.vimeoDash = true;
if (sGet("audioMode") === "true") {
req.isAudioOnly = true;
- req.isNoTTWatermark = true; // video tiktok no watermark
if (sGet("fullTikTokAudio") === "true") req.isTTFullAudio = true; // audio tiktok full
} else {
req.vQuality = sGet("vQuality").slice(0, 4);
if (sGet("muteAudio") === "true") req.isAudioMuted = true;
if (url.includes("youtube.com/") || url.includes("/youtu.be/")) req.vCodec = sGet("vCodec").slice(0, 4);
- if ((url.includes("tiktok.com/") || url.includes("douyin.com/")) && sGet("disableTikTokWatermark") === "true") req.isNoTTWatermark = true;
}
if (sGet("disableMetadata") === "true") req.disableMetadata = true;
diff --git a/src/localization/languages/en.json b/src/localization/languages/en.json
index 587b7ca7..baf67261 100644
--- a/src/localization/languages/en.json
+++ b/src/localization/languages/en.json
@@ -62,7 +62,6 @@
"SettingsAudioFormatBest": "best",
"SettingsAudioFormatDescription": "when \"best\" format is selected, you get audio the way it is on service's side. it's not re-encoded. everything else will be re-encoded.",
"Keyphrase": "save what you love",
- "SettingsRemoveWatermark": "disable watermark",
"ErrorPopupCloseButton": "got it",
"ErrorLengthAudioConvert": "i can't convert audio longer than {s} minutes. pick \"best\" format if you want to avoid limitations!",
"SettingsAudioFullTikTok": "full audio",
diff --git a/src/localization/languages/ru.json b/src/localization/languages/ru.json
index 5b7214c1..ebb38d62 100644
--- a/src/localization/languages/ru.json
+++ b/src/localization/languages/ru.json
@@ -62,7 +62,6 @@
"SettingsAudioFormatBest": "лучший",
"SettingsAudioFormatDescription": "когда выбран \"лучший\", ты получишь аудио без каких-либо изменений. такое, какое оно есть на стороне сервиса. если же выбрано что-то другое, то аудио будет немного сжато.",
"Keyphrase": "сохраняй то, что любишь",
- "SettingsRemoveWatermark": "убрать ватермарку",
"ErrorPopupCloseButton": "ясно",
"ErrorLengthAudioConvert": "я не могу конвертировать аудио дольше чем {s} минут(ы). выбери \"лучший\" формат, чтобы обойти ограничения.",
"SettingsAudioFullTikTok": "полное аудио",
diff --git a/src/modules/pageRender/page.js b/src/modules/pageRender/page.js
index e4bf4d6c..954a0c73 100644
--- a/src/modules/pageRender/page.js
+++ b/src/modules/pageRender/page.js
@@ -336,15 +336,6 @@ export default function(obj) {
}]
})
})
- + settingsCategory({
- name: "tiktok-watermark",
- title: "tiktok",
- body: checkbox([{
- action: "disableTikTokWatermark",
- name: t("SettingsRemoveWatermark"),
- padding: "no-margin"
- }])
- })
+ settingsCategory({
name: "twitter",
title: "twitter",
diff --git a/src/modules/processing/match.js b/src/modules/processing/match.js
index 16f48afc..41690571 100644
--- a/src/modules/processing/match.js
+++ b/src/modules/processing/match.js
@@ -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
});
diff --git a/src/modules/processing/services/tiktok.js b/src/modules/processing/services/tiktok.js
index 6b455a8d..38f8ae85 100644
--- a/src/modules/processing/services/tiktok.js
+++ b/src/modules/processing/services/tiktok.js
@@ -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")) {
diff --git a/src/modules/sub/utils.js b/src/modules/sub/utils.js
index bb21bbb4..13fbb756 100644
--- a/src/modules/sub/utils.js
+++ b/src/modules/sub/utils.js
@@ -9,7 +9,7 @@ const apiVar = {
aFormat: ["best", "mp3", "ogg", "wav", "opus"],
filenamePattern: ["classic", "pretty", "basic", "nerdy"]
},
- booleanOnly: ["isAudioOnly", "isNoTTWatermark", "isTTFullAudio", "isAudioMuted", "dubLang", "vimeoDash", "disableMetadata", "twitterGif"]
+ booleanOnly: ["isAudioOnly", "isTTFullAudio", "isAudioMuted", "dubLang", "vimeoDash", "disableMetadata", "twitterGif"]
}
const forbiddenCharsString = ['}', '{', '%', '>', '<', '^', ';', '`', '$', '"', "@", '='];
@@ -79,7 +79,6 @@ export function checkJSONPost(obj) {
aFormat: "mp3",
filenamePattern: "classic",
isAudioOnly: false,
- isNoTTWatermark: false,
isTTFullAudio: false,
isAudioMuted: false,
disableMetadata: false,
diff --git a/src/test/tests.json b/src/test/tests.json
index e404859f..bd8b33c5 100644
--- a/src/test/tests.json
+++ b/src/test/tests.json
@@ -562,125 +562,10 @@
"status": "error"
}
}],
- "douyin": [{
- "name": "short link video, with watermark",
- "url": "https://v.douyin.com/2p4Aya7/",
- "params": {},
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "short link video (isNoTTWatermark)",
- "url": "https://v.douyin.com/2p4Aya7/",
- "params": {
- "isNoTTWatermark": true
- },
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "short link video (isAudioOnly)",
- "url": "https://v.douyin.com/2p4Aya7/",
- "params": {
- "isAudioOnly": true
- },
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "short link video (isAudioOnly, isTTFullAudio)",
- "url": "https://v.douyin.com/2p4Aya7/",
- "params": {
- "isAudioOnly": true,
- "isTTFullAudio": true
- },
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "long link video (isNoTTWatermark)",
- "url": "https://www.douyin.com/video/7120601033314716968",
- "params": {
- "isNoTTWatermark": true
- },
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "images",
- "url": "https://v.douyin.com/MdVwo31/",
- "params": {},
- "expected": {
- "code": 200,
- "status": "picker"
- }
- }, {
- "name": "long link inexistent",
- "url": "https://www.douyin.com/video/7120851458451417478",
- "params": {},
- "expected": {
- "code": 400,
- "status": "error"
- }
- }, {
- "name": "short link inexistent",
- "url": "https://v.douyin.com/2p4ewa7/",
- "params": {},
- "expected": {
- "code": 400,
- "status": "error"
- }
- }],
"tiktok": [{
- "name": "short link (vt) video, with watermark",
- "url": "https://vt.tiktok.com/ZS85U86aa/",
- "params": {},
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "short link (vt) video (isNoTTWatermark)",
- "url": "https://vt.tiktok.com/ZS85U86aa/",
- "params": {
- "isNoTTWatermark": true
- },
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "short link (vm) video (isAudioOnly)",
- "url": "https://vm.tiktok.com/ZMYrYAf34/",
- "params": {
- "isAudioOnly": true
- },
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "short link (vm) video (isAudioOnly, isTTFullAudio)",
- "url": "https://vm.tiktok.com/ZMYrYAf34/",
- "params": {
- "isAudioOnly": true,
- "isTTFullAudio": true
- },
- "expected": {
- "code": 200,
- "status": "stream"
- }
- }, {
- "name": "long link video (isNoTTWatermark)",
+ "name": "long link video",
"url": "https://www.tiktok.com/@fatfatmillycat/video/7195741644585454894",
- "params": {
- "isNoTTWatermark": true
- },
+ "params": {},
"expected": {
"code": 200,
"status": "stream"