Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
0aub authored Jul 24, 2022
1 parent 3b21f45 commit e338b5e
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions tiktok_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,23 @@ def update_user():
path = "/api/user/detail/?uniqueId={}&msToken={}".format(
USERNAME, PARAMS["msToken"]
)
# update secret user id in params dictionery with the extracted secUid from user detail api
response = tiktok_request(path, x_tt_params=None)
PARAMS["secUid"] = response["userInfo"]["user"]["secUid"]
# assign global user details object
global USER_DETAILS
USER_DETAILS = response["userInfo"]
# catch if the user input was invalid
try:
# update secret user id in params dictionery with the extracted secUid from user detail api
response = tiktok_request(path, x_tt_params=None)
PARAMS["secUid"] = response["userInfo"]["user"]["secUid"]
# assign global user details object
global USER_DETAILS
USER_DETAILS = response["userInfo"]
except:
raise Exception(
f"""
We could not find data about {USERNAME}.
Take a look to these tips and try again.
- Do not add @ in the beginning of the username
- This script does not accept private accounts yet
"""
)


# function to get all user posts ids
Expand Down

0 comments on commit e338b5e

Please sign in to comment.