tiktokpy
tiktokpy copied to clipboard
ERROR - Tried to run the sample code and it won't work
Hey, so i'm trying to run the sample code given in the README, but most of the time it just prints
2022-03-04 12:21:03 | INFO | 🥳 TikTokPy initialized. Version: 0.9.0
2022-03-04 12:21:03 | INFO | 🔧 Settings successfully loaded
2022-03-04 12:21:03 | INFO | 🛑 Cookies not found, anonymous mode
2022-03-04 12:21:04 | INFO | 📈 Getting trending items
📈 Getting trending EN: 0%| | 0/5 [00:00<?, ?it/s]
and then the number 00:00 counts up in seconds but the bar never fills up at all, and i never actually get the trending page.
Every once in a while, instead, it will get the trending page and then tell me:
2022-03-04 13:59:35 | INFO | 📹 Found 5 videos
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-03-04 13:59:35 | ERROR | 😡 You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
I've tried running "tiktokpy login" in the console and it opened a popup on tiktoks website asking me to log in, when i do, it logs me in and then quickly closes the window. In the command line it prints this, the first half before logging in and the second half after:
2022-03-04 14:02:18 | INFO | 🥳 TikTokPy initialized. Version: 0.9.0
2022-03-04 14:02:18 | INFO | 🔧 Settings successfully loaded
2022-03-04 14:02:18 | INFO | 🛑 Cookies not found, anonymous mode
2022-03-04 14:03:27 | INFO | 🔑 Logged as @XXXX aka XXXX
2022-03-04 14:03:28 | INFO | ✋ TikTokPy finished working. Session lasted: a minute
/Users/XXXX/.XXXX/XXXX/XXXX/lib/python3.7/asyncio/unix_events.py:878: RuntimeWarning: A loop is being detached from a child watcher with pending handlers RuntimeWarning)
That doesn't seem to affect what happens when I run the code, which still won't work. Not sure what to do with this, and can't find docs anywhere for the API, can anybody set me on the right path?
In order to run the sample code, i didn't edit it at all except for putting if __name__ == '__main__':
above the line asyncio.run(main())
so i can run it.