carcabot / tiktok-signature

Generate tiktok signature token using node
733 stars 283 forks source link

How to sign a hashtag request? #196

Closed tonywangcn closed 1 year ago

tonywangcn commented 1 year ago

I am able to run the hashtag code successfully, but my concern is how to change challenge id and re-sign it with this repo?

Here is the url to be signed without verifyFp, X-bogus and _signature. Are there anything wrong ?

https://www.tiktok.com/api/challenge/item_list/?aid=1988&app_language=en&app_name=tiktok_web&battery_info=0.54&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=MacIntel&browser_version=5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_7%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F109.0.0.0%20Safari%2F537.36&challengeID=13187&channel=tiktok_web&cookie_enabled=true&count=30&cursor=30&device_id=7195820289077478917&device_platform=web_pc&focus_state=true&from_page=hashtag&history_len=5&is_fullscreen=false&is_page_visible=true&language=en&os=mac&priority_region=&referer=&region=RO&root_referer=https%3A%2F%2Fwww.tiktok.com%2F404%3FfromUrl%3D%2Fhashtag&screen_height=1120&screen_width=1792&tz_name=Europe%2FBucharest&webcast_language=en&msToken=8G5wMuMotboG4hiWsuvDxdQ-VbOZh29r-tMYpFzA56ODNmsk1_RL6xYfiJJvzznY8jK4h4m9CHR2QHJLayqE7lzKFm97L5pmXen7VCGVVIt9s6vU2nNnlmiZW-HTn10YT83WW__OMEaK42s=

And here is the signed url, and response is empty.

https://www.tiktok.com/api/challenge/item_list/?aid=1988&app_language=en&app_name=tiktok_web&battery_info=0.54&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=MacIntel&browser_version=5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_7%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F109.0.0.0%20Safari%2F537.36&challengeID=13187&channel=tiktok_web&cookie_enabled=true&count=30&cursor=30&device_id=7195820289077478917&device_platform=web_pc&focus_state=true&from_page=hashtag&history_len=5&is_fullscreen=false&is_page_visible=true&language=en&os=mac&priority_region=&referer=&region=RO&root_referer=https%3A%2F%2Fwww.tiktok.com%2F404%3FfromUrl%3D%2Fhashtag&screen_height=1120&screen_width=1792&tz_name=Europe%2FBucharest&webcast_language=en&msToken=8G5wMuMotboG4hiWsuvDxdQ-VbOZh29r-tMYpFzA56ODNmsk1_RL6xYfiJJvzznY8jK4h4m9CHR2QHJLayqE7lzKFm97L5pmXen7VCGVVIt9s6vU2nNnlmiZW-HTn10YT83WW__OMEaK42s=&verifyFp=verify_lhetxsnw_NjaJJvOJ_29UU_4g0m_9Bok_BKbPa2e7w7yO&_signature=_02B4Z6wo00f01Tz2MMwAAIBBpudYm9dKBoU85jRAACtf33&X-Bogus=DFSzswSL2yJANGyRtt6t8t9WcBnX
tonywangcn commented 1 year ago

Finally works after changed it to below:

const PARAMS = {
  aid: 1988,
  app_language: "en",
  app_name: "tiktok_web",
  battery_info: 0.54,
  browser_language: "en-US",
  browser_name: "Mozilla",
  browser_online: true,
  browser_platform: "MacIntel",
  browser_version: "5.0%20%28Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_7%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F109.0.0.0%20Safari%2F537.36",
  challengeID: 13187,
  channel: "tiktok_web",
  cookie_enabled: true,
  count: 30,
  cursor: 30,
  device_id: 7195820289077478917,
  device_platform: "web_pc",
  focus_state: true,
  from_page: "hashtag",
  history_len: 5,
  is_fullscreen: false,
  is_page_visible: true,
  language: "en",
  os: "mac",
  priority_region: "",
  referer: "",
  region: "RO",
  root_referer: "https%3A%2F%2Fwww.tiktok.com%2F404%3FfromUrl%3D%2Fhashtag",
  screen_height: 1120,
  screen_width: 1792,
  tz_name: "Europe%2FBucharest",
  webcast_language: "en",
};

Great Repo. Thanks for your work!