davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.76k stars 962 forks source link

[BUG] #66

Closed socialmediaguy closed 4 years ago

socialmediaguy commented 4 years ago

Hey all, I am getting the below error when trying to run the quick start code in pycharm. Can anyone help please?

Error:

C:\USERS\USER1\PycharmProjects\untitled\venv\Scripts\python.exe C:/Users/USER1/PycharmProjects/untitled/testtiktok.py 2020-04-19 18:04:41.351 | INFO | tiktok_bot.api.api:list_for_you_feed:76 - Getting 25 posts from your feed List for you feed: 0%| | 0/25 [00:00<?, ?it/s] Traceback (most recent call last): File "C:/Users/USER1/PycharmProjects/untitled/testtiktok.py", line 6, in my_feed = bot.list_for_you_feed(count=25) File "C:\Users\USER1\PycharmProjects\untitled\venv\lib\site-packages\tiktok_bot\bot\bot.py", line 60, in list_for_you_feed feed = self.api.list_for_you_feed(count=count) File "C:\Users\USER1\PycharmProjects\untitled\venv\lib\site-packages\tiktok_bot\api\api.py", line 87, in list_for_you_feed response = self._list_for_you_feed(list_feed_request=request) File "C:\Users\USER1\PycharmProjects\untitled\venv\lib\site-packages\tiktok_bot\api\api.py", line 68, in _list_for_you_feed feed = ListForYouFeedResponse(response.json()) File "C:\Users\USER1\PycharmProjects\untitled\venv\lib\site-packages\httpx\models.py", line 930, in json return jsonlib.loads(self.text, kwargs) File "C:\Users\USER1\AppData\Local\Programs\Python\Python38-32\lib\json__init__.py", line 357, in loads return _default_decoder.decode(s) File "C:\Users\USER1\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\USER1\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Process finished with exit code 1


davidteather commented 4 years ago

Api is broken at the moment due to tiktok blocking server requests better than before

socialmediaguy commented 4 years ago

@davidteather ah ok, thanks!

socialmediaguy commented 4 years ago

@davidteather Sorry, another question. Do you know if you will be able to fix it and/or if there is any way that I can find the most popular videos by certain criteria like hashtags? I don't need to download them, just need to find the most popular ones. Thanks

adebayor123 commented 4 years ago

@socialmediaguy I've tried many other methods including hashtag searches, but I'm getting None (same error that you're having). I think the only way would be scraping instead of using the api, if you need it asap

socialmediaguy commented 4 years ago

@adebayor123 Do you have anything that can be used for scraping? would be so much help. thank you

davidteather commented 4 years ago

A new version has been released that may solve your problem update with the following

pip install TikTokApi --upgrade