iamatef / xbogus

Generate X-Bogus parameter used for tiktok requests
31 stars 10 forks source link

Iteam Detail URL not Returning Data #3

Open zakrian07 opened 4 months ago

zakrian07 commented 4 months ago

Hi this URL is returning empty data any clue what can be reason ? do we need a specific node version as well ? const axios = require('axios'); const xbogus = require('xbogus');

// Hypothetical function that generates an X-Bogus value

const url = "https://www.tiktok.com/api/post/item_list/?WebIdLastTime=1700205982&aid=1988&app_language=en&app_name=tiktok_web&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Linux%20x86_64&browser_version=5.0%20%28X11%3B%20Linux%20x86_64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F121.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&count=35&coverFormat=2&cursor=0&device_id=7302329037723616769&device_platform=web_pc&focus_state=false&from_page=user&history_len=3&is_fullscreen=false&is_page_visible=true&language=en&os=linux&priority_region=PK&referer=&region=PK&screen_height=1080&screen_width=1920&secUid=MS4wLjABAAAABKjQkOz_IIzXXzEAl_9LGsWhvK-gBnlczwRPXK8EmxAp6K3X0qiaP5_OEqmm0XwG&tz_name=Asia%2FKarachi&webcast_language=en&msToken=6hIknNk5N6Oa3wN28BwqrRz0S8B0qqg4jbrem-VnUlcVn8FMaMnmob4wEPzJSAOYq4Cs9G2xDZEPOXkRTTvOXNC4xHXOoZrpT6W722ZF_pN6zgJilwvBbqXQSEoT18tUjkIPC5Kr_h0=&_signature=_02B4Z6wo0000184GwiAAAIDA1RXb5UVLlvvOBsaAAJXH26"; const user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0' const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53";

const tiktok_xbogus = xbogus(url, USER_AGENT);

// Append the generated X-Bogus value to the URL const newUrl = url + "&X-Bogus=" + tiktok_xbogus;

console.log(newUrl);

// Optionally, make the request axios.get(newUrl, { headers: { 'User-Agent': USER_AGENT } }).then(response => { console.log("Data received:", response); }).catch(error => { console.error("Error making the request:", error); }); any help would be appreciated

JeffersonGibin commented 21 hours ago

Hi this URL is returning empty data any clue what can be reason ? do we need a specific node version as well ? const axios = require('axios'); const xbogus = require('xbogus');

// Hypothetical function that generates an X-Bogus value

const url = "https://www.tiktok.com/api/post/item_list/?WebIdLastTime=1700205982&aid=1988&app_language=en&app_name=tiktok_web&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Linux%20x86_64&browser_version=5.0%20%28X11%3B%20Linux%20x86_64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F121.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&count=35&coverFormat=2&cursor=0&device_id=7302329037723616769&device_platform=web_pc&focus_state=false&from_page=user&history_len=3&is_fullscreen=false&is_page_visible=true&language=en&os=linux&priority_region=PK&referer=&region=PK&screen_height=1080&screen_width=1920&secUid=MS4wLjABAAAABKjQkOz_IIzXXzEAl_9LGsWhvK-gBnlczwRPXK8EmxAp6K3X0qiaP5_OEqmm0XwG&tz_name=Asia%2FKarachi&webcast_language=en&msToken=6hIknNk5N6Oa3wN28BwqrRz0S8B0qqg4jbrem-VnUlcVn8FMaMnmob4wEPzJSAOYq4Cs9G2xDZEPOXkRTTvOXNC4xHXOoZrpT6W722ZF_pN6zgJilwvBbqXQSEoT18tUjkIPC5Kr_h0=&_signature=_02B4Z6wo0000184GwiAAAIDA1RXb5UVLlvvOBsaAAJXH26"; const user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0' const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53";

const tiktok_xbogus = xbogus(url, USER_AGENT);

// Append the generated X-Bogus value to the URL const newUrl = url + "&X-Bogus=" + tiktok_xbogus;

console.log(newUrl);

// Optionally, make the request axios.get(newUrl, { headers: { 'User-Agent': USER_AGENT } }).then(response => { console.log("Data received:", response); }).catch(error => { console.error("Error making the request:", error); }); any help would be appreciated

Hi @zakrian07,

Maybe you need to pass other headers as: cookies, agent, x-secsdk-csrf-token but careful with IP lock.