@tobyg74/tiktok-api-dl
Advanced tools
Comparing version 1.1.0 to 1.1.1
export declare const _userPostsParams: () => string; | ||
export declare const _userSearchParams: (keyword: any, page?: number) => any; | ||
export declare const _tiktokApiParams: (args: any) => any; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._tiktokApiParams = exports._userPostsParams = void 0; | ||
exports._tiktokApiParams = exports._userSearchParams = exports._userPostsParams = void 0; | ||
const qs_1 = __importDefault(require("qs")); | ||
@@ -42,2 +42,41 @@ const _userPostsParams = () => { | ||
exports._userPostsParams = _userPostsParams; | ||
const _userSearchParams = (keyword, page = 1) => { | ||
let cursor = 0; | ||
for (let i = 1; i < page; i++) { | ||
cursor += 10; | ||
} | ||
return qs_1.default.stringify({ | ||
WebIdLastTime: Date.now(), | ||
aid: "1988", | ||
app_language: "en", | ||
app_name: "tiktok_web", | ||
browser_language: "en-US", | ||
browser_name: "Mozilla", | ||
browser_online: true, | ||
browser_platform: "Win32", | ||
browser_version: "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0", | ||
channel: "tiktok_web", | ||
cookie_enabled: true, | ||
cursor: cursor, | ||
device_id: "7340508178566366722", | ||
device_platform: "web_pc", | ||
focus_state: false, | ||
from_page: "search", | ||
history_len: 5, | ||
is_fullscreen: false, | ||
is_page_visible: true, | ||
keyword: keyword, | ||
os: "windows", | ||
priority_region: "ID", | ||
referer: "", | ||
region: "ID", | ||
screen_height: 768, | ||
screen_width: 1366, | ||
search_id: "20240329123238075BE0FECBA0FE11C76B", | ||
tz_name: "Asia/Jakarta", | ||
web_search_code: { tiktok: { client_params_x: { search_engine: { ies_mt_user_live_video_card_use_libra: 1, mt_search_general_user_live_card: 1 } }, search_server: {} } }, | ||
webcast_language: "en" | ||
}); | ||
}; | ||
exports._userSearchParams = _userSearchParams; | ||
const _tiktokApiParams = (args) => { | ||
@@ -44,0 +83,0 @@ return { |
@@ -14,8 +14,9 @@ import { MusicalDownResponse } from "./types/downloader/musicaldown"; | ||
type: T_1; | ||
cookie: string; | ||
cookie?: string; | ||
page?: number; | ||
}) => Promise<TiktokSearchResponse<T_1>>; | ||
StalkUser: (username: string, options: { | ||
cookie: string; | ||
StalkUser: (username: string, options?: { | ||
cookie?: string; | ||
}) => Promise<StalkResult>; | ||
}; | ||
export default Tiktok; |
@@ -33,7 +33,7 @@ "use strict"; | ||
case "user": { | ||
const response = await (0, tiktok_user_search_1.SearchUser)(query, options.cookie); | ||
const response = await (0, tiktok_user_search_1.SearchUser)(query, options?.cookie, options?.page); | ||
return response; | ||
} | ||
default: { | ||
const response = await (0, tiktok_user_search_1.SearchUser)(query, options?.cookie); | ||
const response = await (0, tiktok_user_search_1.SearchUser)(query, options?.cookie, options?.page); | ||
return response; | ||
@@ -44,3 +44,3 @@ } | ||
StalkUser: async (username, options) => { | ||
const response = await (0, tiktok_stalker_1.StalkUser)(username, options.cookie); | ||
const response = await (0, tiktok_stalker_1.StalkUser)(username, options?.cookie); | ||
return response; | ||
@@ -47,0 +47,0 @@ } |
import { TiktokUserSearchResponse } from "../../types/search/userSearch"; | ||
export declare const SearchUser: (username: string, cookie?: any) => Promise<TiktokUserSearchResponse>; | ||
export declare const SearchUser: (username: string, cookie?: any, page?: number) => Promise<TiktokUserSearchResponse>; |
@@ -9,37 +9,5 @@ "use strict"; | ||
const api_1 = require("../../constants/api"); | ||
const params = (keyword) => { | ||
return { | ||
WebIdLastTime: Date.now(), | ||
aid: "1988", | ||
app_language: "en", | ||
app_name: "tiktok_web", | ||
browser_language: "en-US", | ||
browser_name: "Mozilla", | ||
browser_online: true, | ||
browser_platform: "Win32", | ||
browser_version: "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0", | ||
channel: "tiktok_web", | ||
cookie_enabled: true, | ||
cursor: 0, | ||
device_id: "7340508178566366722", | ||
device_platform: "web_pc", | ||
focus_state: false, | ||
from_page: "search", | ||
history_len: 5, | ||
is_fullscreen: false, | ||
is_page_visible: true, | ||
keyword: keyword, | ||
os: "windows", | ||
priority_region: "ID", | ||
referer: "", | ||
region: "ID", | ||
screen_height: 768, | ||
screen_width: 1366, | ||
tz_name: "Asia/Jakarta", | ||
web_search_code: { tiktok: { client_params_x: { search_engine: { ies_mt_user_live_video_card_use_libra: 1, mt_search_general_user_live_card: 1 } }, search_server: {} } }, | ||
webcast_language: "en" | ||
}; | ||
}; | ||
const SearchUser = (username, cookie) => new Promise(async (resolve, reject) => { | ||
(0, axios_1.default)((0, api_1._tiktokSearchUserFull)(params(username)), { | ||
const params_1 = require("../../constants/params"); | ||
const SearchUser = (username, cookie, page) => new Promise(async (resolve, reject) => { | ||
(0, axios_1.default)((0, api_1._tiktokSearchUserFull)((0, params_1._userSearchParams)(username, page)), { | ||
method: "GET", | ||
@@ -46,0 +14,0 @@ headers: { |
{ | ||
"name": "@tobyg74/tiktok-api-dl", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Scraper for downloading media in the form of videos, images and audio from Tiktok. Also for stalking Tiktok Users", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -106,2 +106,3 @@ <h1 align="center"> | ||
type: "user", | ||
page: 1, | ||
cookie: process.env.COOKIE || "Your Cookie" | ||
@@ -108,0 +109,0 @@ }).then((result) => { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48006
1085
314
1