Skip to content

best way to save what you love

fixed tiktok support and updated ytdl-core version

wukko1acfb14d2c1c
diff --git a/package.json b/package.json
index 2c61d5b0..55067f91 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "cobalt",
"description": "save what you love",
- "version": "3.3.5",
+ "version": "3.3.6",
"author": "wukko",
"exports": "./src/cobalt.js",
"type": "module",
@@ -32,6 +32,6 @@
"node-cache": "^5.1.2",
"url-pattern": "1.0.3",
"xml-js": "^1.6.11",
- "ytdl-core": "4.11.0"
+ "ytdl-core": "4.11.1"
}
}
diff --git a/src/modules/services/tiktok.js b/src/modules/services/tiktok.js
index b7e8bbc9..ef634553 100644
--- a/src/modules/services/tiktok.js
+++ b/src/modules/services/tiktok.js
@@ -3,10 +3,12 @@ import loc from "../../localization/manager.js";
import { genericUserAgent } from "../config.js";
import { unicodeDecode } from "../sub/utils.js";
+let userAgent = genericUserAgent.split(' Chrome/1')[0]
+
export default async function(obj) {
try {
if (!obj.postId) {
- let html = await got.get(`https://vt.tiktok.com/${obj.id}`, { headers: { "user-agent": genericUserAgent } });
+ let html = await got.get(`https://vt.tiktok.com/${obj.id}`, { headers: { "user-agent": userAgent } });
html.on('error', (err) => {
return { error: loc(obj.lang, 'ErrorCantConnectToServiceAPI', 'tiktok') };
});
@@ -18,7 +20,7 @@ export default async function(obj) {
}
}
if (!obj.noWatermark && !obj.isAudioOnly) {
- let html = await got.get(`https://tiktok.com/@video/video/${obj.postId}`, { headers: { "user-agent": genericUserAgent } });
+ let html = await got.get(`https://tiktok.com/@video/video/${obj.postId}`, { headers: { "user-agent": userAgent } });
html.on('error', (err) => {
return { error: loc(obj.lang, 'ErrorCantConnectToServiceAPI', 'tiktok') };
});