!pip install TikTokApi
from TikTokApi import TikTokApi
from playwright.sync_api import sync_playwright
verifyFp = "aaa"
api = TikTokApi.get_instance(custom_verifyFp=verifyFp, user_test_endpoints=True)
api.by_hashtag('funny')
Currently using 4.0.1 version of TikTokApi. I was able to get the function api.get_user to work but when I tried to call api.by_hashtag I got the following error. Has anyone else seen the error and know how to deal with it? The verifyFp = "aaa" code can be extracted by visiting tiktok.com and get the s_v_web_id value from cookies
Thank you!
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-105-3ba9a6be8f4f> in <module>
----> 1 api.by_hashtag('funny')
~\anaconda3\lib\site-packages\TikTokApi\tiktok.py in by_hashtag(self, hashtag, count, offset, **kwargs)
952 kwargs["custom_device_id"] = device_id
953 id = self.get_hashtag_object(hashtag)["challengeInfo"]["challenge"]["id"]
--> 954 response = []
955
956 required_count = count
~\anaconda3\lib\site-packages\TikTokApi\tiktok.py in get_hashtag_object(self, hashtag, **kwargs)
1002 api_url = "{}node/share/tag/{}?{}&{}".format(
1003 BASE_URL, quote(hashtag), self.__add_url_params__(), urlencode(query)
-> 1004 )
1005 data = self.get_data(url=api_url, **kwargs)
1006 if data["challengeInfo"].get("challenge") is None:
~\anaconda3\lib\site-packages\TikTokApi\tiktok.py in __add_url_params__(self)
1653 "region": self.region or "US",
1654 "priority_region": "",
-> 1655 "os": "ios",
1656 "referer": "",
1657 "root_referer": "",
AttributeError: 'TikTokApi' object has no attribute 'region'