From e19837417b62e507a4f9393660761f667197b38f Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 30 Jul 2022 17:36:18 +0600 Subject: [PATCH] removed mobile user agent because douyin doesnt need it --- src/config.json | 1 - src/modules/config.js | 1 - src/modules/services/douyin.js | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/config.json b/src/config.json index b2a1c757..4b0885b5 100644 --- a/src/config.json +++ b/src/config.json @@ -2,7 +2,6 @@ "streamLifespan": 1800000, "maxVideoDuration": 1920000, "genericUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", - "mobileUserAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1", "authorInfo": { "name": "wukko", "link": "https://wukko.me/", diff --git a/src/modules/config.js b/src/modules/config.js index 34e3acf3..da7f7081 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -9,7 +9,6 @@ version = packageJson.version, streamLifespan = config.streamLifespan, maxVideoDuration = config.maxVideoDuration, genericUserAgent = config.genericUserAgent, -mobileUserAgent = config.mobileUserAgent, repo = packageJson["bugs"]["url"].replace('/issues', ''), authorInfo = config.authorInfo, supportedLanguages = config.supportedLanguages, diff --git a/src/modules/services/douyin.js b/src/modules/services/douyin.js index 3e45ad60..e3224ebc 100644 --- a/src/modules/services/douyin.js +++ b/src/modules/services/douyin.js @@ -1,6 +1,6 @@ import got from "got"; import loc from "../../localization/manager.js"; -import { genericUserAgent, mobileUserAgent } from "../config.js"; +import { genericUserAgent } from "../config.js"; export default async function(obj) { try { @@ -17,7 +17,7 @@ export default async function(obj) { } let iteminfo = await got.get(`https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=${obj.postId}`, {headers: { 'authority': 'www.iesdouyin.com', - 'user-agent': mobileUserAgent, + 'user-agent': genericUserAgent, 'content-type': 'application/x-www-form-urlencoded', 'accept': '*/*', 'referer': `https://www.iesdouyin.com/share/video/${obj.postId}/?region=CN&u_code=15b9142gf&titleType=title&utm_source=copy_link&utm_campaign=client_share&utm_medium=android&app=aweme`,