Skip to content

Commit

Permalink
Merge pull request #443 from davidteather/nightly
Browse files Browse the repository at this point in the history
V3.6.7 - Fix non-latin-1 on getUserObject & getSecuid
  • Loading branch information
davidteather authored Dec 23, 2020
2 parents 9f19f04 + 7165a4c commit d15fa62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions TikTokApi/tiktok.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def userPage(
) = self.__process_kwargs__(kwargs)
kwargs["custom_did"] = did

api_url = "https://m.tiktok.com/api/item_list/?{}&count={}&id={}&type=1&secUid={}" "&minCursor={}&maxCursor={}&sourceType=8&appId=1233&region={}&language={}".format(
api_url = BASE_URL + "api/item_list/?{}&count={}&id={}&type=1&secUid={}" "&minCursor={}&maxCursor={}&sourceType=8&appId=1233&region={}&language={}".format(
self.__add_new_params__(),
page_size,
str(userID),
Expand Down Expand Up @@ -1102,11 +1102,11 @@ def getUser(self, username, **kwargs) -> dict:
did,
) = self.__process_kwargs__(kwargs)
r = requests.get(
"https://tiktok.com/@{}?lang=en".format(username),
"https://tiktok.com/@{}?lang=en".format(quote(username)),
headers={
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"authority": "www.tiktok.com",
"path": "/{}".format(username),
"path": "/@{}".format(quote(username)),
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Host": "www.tiktok.com",
Expand Down Expand Up @@ -1484,11 +1484,11 @@ def get_music_title(self, id, **kwargs):

def get_secUid(self, username, **kwargs):
r = requests.get(
"https://tiktok.com/@{}?lang=en".format(username),
"https://tiktok.com/@{}?lang=en".format(quote(username)),
headers={
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"authority": "www.tiktok.com",
"path": "/{}".format(username),
"path": "/@{}".format(quote(username)),
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Host": "www.tiktok.com",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setuptools.setup(
name="TikTokApi",
packages=["TikTokApi"],
version="3.8.6",
version="3.8.7",
license="MIT",
description="The Unofficial TikTok API Wrapper in Python 3.",
author="David Teather",
Expand Down

0 comments on commit d15fa62

Please sign in to comment.