sudoguy / tiktokpy Goto Github PK
View Code? Open in Web Editor NEWTool for automated TikTok interactions
License: MIT License
Tool for automated TikTok interactions
License: MIT License
When I type tiktokpy login and log in tiktok website I do get this error. I see that the opened browser is trying to access the profile and it displays error loading on tiktok website, maybe it is related?
C:\Users\elblo\Desktop>tiktokpy login
2020-09-06 13:54:45 | INFO | π₯³ TikTokPy initialized. Version: 0.8.6
2020-09-06 13:54:46 | INFO | π§ Settings successfully loaded
2020-09-06 13:54:46 | INFO | π Cookies not found, anonymous mode
2020-09-06 13:54:50 | INFO | β TikTokPy finished working. Session lasted: 4 seconds
Traceback (most recent call last):
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\elblo\AppData\Local\Programs\Python\Python38-32\Scripts\tiktokpy.exe\__main__.py", line 7, in <module>
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\typer\main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\typer\main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\tiktokpy\cli\utils.py", line 8, in wrapper
return asyncio.run(f(*args, **kwargs))
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\asyncio\runners.py", line 43, in run
return loop.run_until_complete(main)
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\tiktokpy\cli\__init__.py", line 13, in login
await bot.login_session()
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\tiktokpy\bot\__init__.py", line 85, in login_session
await Login().manual_login()
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\tiktokpy\client\login.py", line 18, in manual_login
await page.waitForSelector(".profile", options={"timeout": 0})
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\pyppeteer\frame_manager.py", line 853, in __await__
result = yield from self.promise
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\pyppeteer\frame_manager.py", line 875, in rerun
success = await context.evaluateHandle(
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\pyppeteer\execution_context.py", line 108, in evaluateHandle
_rewriteError(e)
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\pyppeteer\execution_context.py", line 238, in _rewriteError
raise error
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\pyppeteer\execution_context.py", line 99, in evaluateHandle
_obj = await self._client.send('Runtime.callFunctionOn', {
pyppeteer.errors.NetworkError: Protocol error Runtime.callFunctionOn: Target closed.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\site-packages\pyppeteer\launcher.py", line 151, in _close_process
self._loop.run_until_complete(self.killChrome())
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\asyncio\base_events.py", line 591, in run_until_complete
self._check_closed()
File "c:\users\elblo\appdata\local\programs\python\python38-32\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
sys:1: RuntimeWarning: coroutine 'Launcher.killChrome' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
How to use ?
Hello, I can't seem to find the functions to
Login
Getfollowers
Getfollowing
I would like to contribute to this project via Pull Request or other methods.
I have implemented a method to retrieve the followed users and follow/unfollow lists of usernames instead of the single call, because doing more than 10 single calls opens too many instances of chromium and cpu usage goes to 100%.
I also would like to add the log level in the TikTokPy constructor
Hello Guys, i cant login , why dont working? Can Please help me
C:\Users\Konta\Desktop\TikTokBot\tiktokpy-master>tiktokpy login
Traceback (most recent call last):
File "C:\Users\Konta\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Konta\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Konta\AppData\Local\Programs\Python\Python310\Scripts\tiktokpy.exe\__main__.py", line 4, in <module>
from tiktokpy.cli import app
File "C:\Users\Konta\AppData\Local\Programs\Python\Python310\lib\site-packages\tiktokpy\cli\__init__.py", line 1, in <module>
import typer
File "C:\Users\Konta\AppData\Local\Programs\Python\Python310\lib\site-packages\typer\__init__.py", line 12, in <module>
from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (C:\Users\Konta\AppData\Local\Programs\Python\Python310\lib\site-packages\click\termui.py)
Instructions, please, how do you start the PY?
So I managed to get it running.
The scripts apparently works smoothly, saying it's going to people's page and following them.
But when I check my profile, nothing actually happened. My following list did not change.
Read here. https://github.com/t1-x/TiToDoHelper
I installed but i get this error, is normal?
python3 '/home/ma/Scrivania/tiktok/tiktokbot (copia).py'
2021-02-13 11:57:13 | INFO | π₯³ TikTokPy initialized. Version: 0.8.9
2021-02-13 11:57:13 | INFO | π§ Settings successfully loaded
2021-02-13 11:57:13 | INFO | π Cookies not found, anonymous mode
2021-02-13 11:57:13 | INFO | π Getting trending items
π Getting trending EN: 0%| | 0/5 [00:00<?, ?it/s]2021-02-13 11:57:19 | INFO | β TikTokPy finished working. Session lasted: 6 seconds
Traceback (most recent call last):
File "/home/ma/Scrivania/tiktok/tiktokbot (copia).py", line 37, in
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/ma/Scrivania/tiktok/tiktokbot (copia).py", line 8, in main
trending_items = await bot.trending(amount=5)
File "/home/ma/.local/lib/python3.8/site-packages/tiktokpy/bot/init.py", line 57, in trending
items = await Trending(client=self.client).feed(amount=amount, lang=lang)
File "/home/ma/.local/lib/python3.8/site-packages/tiktokpy/client/trending.py", line 41, in feed
await page.evaluate(
File "/home/ma/.local/lib/python3.8/site-packages/pyppeteer/page.py", line 1184, in evaluate
return await frame.evaluate(pageFunction, *args, force_expr=force_expr)
File "/home/ma/.local/lib/python3.8/site-packages/pyppeteer/frame_manager.py", line 308, in evaluate
return await context.evaluate(
File "/home/ma/.local/lib/python3.8/site-packages/pyppeteer/execution_context.py", line 53, in evaluate
handle = await self.evaluateHandle(
File "/home/ma/.local/lib/python3.8/site-packages/pyppeteer/execution_context.py", line 92, in evaluateHandle
raise ElementHandleError(
pyppeteer.errors.ElementHandleError: Evaluation failed: TypeError: Cannot read property 'scrollIntoView' of null
at pyppeteer_evaluation_script:3:21
π Getting trending EN: 0%|
2021-01-18 15:31:30 | INFO | π₯³ TikTokPy initialized. Version: 0.8.8
2021-01-18 15:31:30 | INFO | π§ Settings successfully loaded
2021-01-18 15:31:30 | INFO | β
Used cookies of @xxxx._
Traceback (most recent call last):
File "tiktok.py", line 37, in
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "tiktok.py", line 6, in main
async with TikTokPy() as bot:
File "/home/zz/tiktok/tiktokpy/tiktokpy/bot/init.py", line 35, in aenter
await self._init_bot()
File "/home/zz/tiktok/tiktokpy/tiktokpy/bot/init.py", line 98, in _init_bot
self.client: Client = await Client.create()
File "/home/zz/tiktok/tiktokpy/tiktokpy/client/init.py", line 96, in create
self = Client()
File "/home/zz/tiktok/tiktokpy/tiktokpy/client/init.py", line 29, in init
self.cookies = json.loads(settings.get("COOKIES", "[]"))
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/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)
just wanted to say hello since you wont reply me on telegram haha
when i run the given example from readme:
import asyncio
from tiktokpy import TikTokPy
async def main():
async with TikTokPy() as bot:
# Do you want to get trending videos? You can!
trending_items = await bot.trending(amount=5)
for item in trending_items:
# β€οΈ you can like videos
await bot.like(item)
# or unlike them
await bot.unlike(item)
# or follow users
await bot.follow(item.author.username)
# as and unfollow
await bot.unfollow(item.author.username)
# π getting user's feed
user_feed_items = await bot.user_feed(username="justinbieber", amount=5)
for item in user_feed_items:
# π§ get music title, cover, link, author name..
print("Music title: ", item.music.title)
# #οΈβ£ print all tag's title of video
print([tag.title for tag in item.challenges])
# π check all video stats
print("Comments: ", item.stats.comments)
print("Plays: ", item.stats.plays)
print("Shares: ", item.stats.shares)
print("Likes: ", item.stats.likes)
# and many other things π
asyncio.run(main())
i get this error:
2021-11-28 20:27:07 | INFO | π₯³ TikTokPy initialized. Version: 0.8.9
2021-11-28 20:27:07 | INFO | π§ Settings successfully loaded
2021-11-28 20:27:07 | INFO | π Cookies not found, anonymous mode
2021-11-28 20:27:08 | INFO | π Getting trending items
2021-11-28 20:27:08 | INFO | β TikTokPy finished working. Session lasted: a second
Traceback (most recent call last):
File "C:\Users\pc\Desktop\tiktokbot\quickstart.py", line 37, in <module>
asyncio.run(main())
File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\pc\Desktop\tiktokbot\quickstart.py", line 8, in main
trending_items = await bot.trending(amount=5)
File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\site-packages\tiktokpy\bot\__init__.py", line 57, in trending
items = await Trending(client=self.client).feed(amount=amount, lang=lang)
File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\site-packages\tiktokpy\client\trending.py", line 26, in feed
_ = await self.client.goto(
File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\site-packages\tiktokpy\client\__init__.py", line 87, in goto
return await page.goto(full_url, *args, **kwargs)
File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\site-packages\pyppeteer\page.py", line 879, in goto
raise PageError(result)
pyppeteer.errors.PageError: net::ERR_INVALID_RESPONSE at https://www.tiktok.com/foryou?lang=en
how can i fix it?
How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?How the fuck do you use it???!?!?!??!?
Everything working as expected but I cannot loving because the command "tiktokpy loving" is unrecognized.
When I start the bot or another .py say somenthing like =RESTARD..... ; and idk how to use the quickstart is weird for me
Bot run but don`t do the actions
2022-04-01 14:42:45 | INFO | πΉ Found 3 videos 2022-04-01 14:42:45 | INFO | π§ Going to @ogisimeonov's video 7053820857914903814 page for like 2022-04-01 14:42:52 | INFO | π @ogisimeonov's video 7053820857914903814 liked 2022-04-01 14:42:52 | INFO | π§ Going to @ogisimeonov's page for following 2022-04-01 14:43:00 | INFO | β @ogisimeonov followed 2022-04-01 14:43:00 | INFO | π§ Going to @stoyan_yordanov1991's video 7074817726203596037 page for like 2022-04-01 14:43:11 | INFO | π @stoyan_yordanov1991's video 7074817726203596037 liked 2022-04-01 14:43:11 | INFO | π§ Going to @stoyan_yordanov1991's page for following 2022-04-01 14:43:20 | INFO | β @stoyan_yordanov1991 followed 2022-04-01 14:43:20 | INFO | π§ Going to @lilytihova's video 7051539740046249222 page for like 2022-04-01 14:43:26 | INFO | π @lilytihova's video 7051539740046249222 liked 2022-04-01 14:43:26 | INFO | π§ Going to @lilytihova's page for following 2022-04-01 14:43:33 | INFO | β @lilytihova followed 2022-04-01 14:43:33 | INFO | β TikTokPy finished working. Session lasted: a minute
This is the log when i observe in tiktok no actions are executed.
Probably need update I try to look around in the code but I am 0 with asyco and not very good at python.So if the owner of the repo or some contributor have a time to update the bot will be great.
Hi @sudoguy,
How it's going?
I've tried to play around with the library for a little bit today. However, it does not seem to function properly for me.
I have copied the code you've written in the README file and it just seems to get stuck at "Getting Trending Items..":
2020-09-06 18:03:25 | INFO | π₯³ TikTokPy initialized. Version: 0.8.6
2020-09-06 18:03:26 | INFO | π§ Settings successfully loaded
2020-09-06 18:03:26 | INFO | π Cookies not found, anonymous mode
2020-09-06 18:03:26 | INFO | π Getting trending items
Am I doing anything wrong?
I've tried using other functions as well but they all freeze after the program starts-up.
Thank you very much,
RoyIL
ΠΡΠΈΠ²Π΅Ρ. ΠΠ°ΠΊ Π»ΠΎΠ³ΠΈΠ½ΠΈΡΡΡΡ ΠΏΠΎΠ΄ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΌ? Π½Π΅ Π°Π½ΠΎΠ½ΠΈΠΌΠ½ΠΎ ΡΡΠΎΠ±Ρ. ΠΠ΅ Π½Π°ΡΠ΅Π» ΠΊΠ°ΠΊ Π²ΠΎΠΎΠ±ΡΠ΅ ΠΌΠΎΠΆΠ½ΠΎ ΡΠΊΠ°Π·Π°ΡΡ Π»ΠΎΠ³ΠΈΠ½ ΠΈ ΠΏΠ°ΡΠΎΠ»Ρ Π΄Π»Ρ Π²Ρ ΠΎΠ΄Π°
Hi, trying out this bot. I'm facing some problems:
Traceback (most recent call last):
File "quickstart.py", line 34, in
asyncio.run(main())
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "quickstart.py", line 6, in main
async with TikTokPy() as bot:
File "/home/pi/.local/lib/python3.7/site-packages/tiktokpy/bot/init.py", line 35, in aenter
await self._init_bot()
File "/home/pi/.local/lib/python3.7/site-packages/tiktokpy/bot/init.py", line 98, in _init_bot
self.client: Client = await Client.create()
File "/home/pi/.local/lib/python3.7/site-packages/tiktokpy/client/init.py", line 97, in create
await self.init_browser(headless=headless)
File "/home/pi/.local/lib/python3.7/site-packages/tiktokpy/client/init.py", line 42, in init_browser
self.browser: Browser = await launch(**params)
File "/home/pi/.local/lib/python3.7/site-packages/pyppeteer/launcher.py", line 305, in launch
return await Launcher(options, **kwargs).launch()
File "/home/pi/.local/lib/python3.7/site-packages/pyppeteer/launcher.py", line 147, in launch
self.cmd, **options, )
File "/usr/lib/python3.7/subprocess.py", line 775, in init
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/pi/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome'
I'm running on Raspberry Pi3. Is there any way to use Firefox?
Hi there, Thank you so much for sharing the library, i have a problem though, the bottom half of the example code works fine, but when i try to call the like function, it gets stuck at "Going to @ video page for like". how do i solve this, Thanks!
Hello, thanks for the bot, the concept and the usage feel pretty good.
But i found some issue whenever i try to get trending item and sending action, the script just stopped responding on
2020-11-13 07:39:16 | INFO | π§ Going to @ someuser video 1236817212736 page for like
Also whenever i try to get info form certain feed it just stuck on
2020-11-13 07:56:09 | INFO | π Getting @ somuser feed
I copy the cookie after I login the tiktok website with chrome and
paste it on settings.toml but it got error,
Traceback (most recent call last):
File "tiktok.py", line 37, in
File "/usr/local/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "tiktok.py", line 6, in main
File "/home/august/venv3.8/lib/python3.8/site-packages/tiktokpy/bot/init.py", line 27, in init
load_or_create_settings(path=settings_path)
File "/home/august/venv3.8/lib/python3.8/site-packages/tiktokpy/utils/settings.py", line 30, in load_or_create_settings
settings.load_file(path=path)
File "/home/august/venv3.8/lib/python3.8/site-packages/dynaconf/utils/parse_conf.py", line 206, in evaluate
value = f(settings, *args, **kwargs)
File "/home/august/venv3.8/lib/python3.8/site-packages/dynaconf/base.py", line 142, in getattr
self._setup()
File "/home/august/venv3.8/lib/python3.8/site-packages/dynaconf/base.py", line 184, in _setup
default_settings.reload(self._kwargs.get("load_dotenv"))
File "/home/august/venv3.8/lib/python3.8/site-packages/dynaconf/default_settings.py", line 71, in reload
start_dotenv(*args, **kwargs)
File "/home/august/venv3.8/lib/python3.8/site-packages/dynaconf/default_settings.py", line 57, in start_dotenv
or _find_file(".env", project_root=root_path)
File "/home/august/venv3.8/lib/python3.8/site-packages/dynaconf/utils/files.py", line 54, in find_file
script_dir = os.path.dirname(os.path.abspath(inspect.stack()[-1].filename))
File "/usr/local/lib/python3.8/inspect.py", line 1514, in stack
return getouterframes(sys._getframe(1), context)
File "/usr/local/lib/python3.8/inspect.py", line 1491, in getouterframes
frameinfo = (frame,) + getframeinfo(frame, context)
File "/usr/local/lib/python3.8/inspect.py", line 1465, in getframeinfo
lines, lnum = findsource(frame)
File "/usr/local/lib/python3.8/inspect.py", line 794, in findsource
lines = linecache.getlines(file, module.dict)
File "/usr/local/lib/python3.8/linecache.py", line 47, in getlines
return updatecache(filename, module_globals)
File "/usr/local/lib/python3.8/linecache.py", line 137, in updatecache
lines = fp.readlines()
File "/usr/local/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 558: invalid continuation byte
kts@HP-Laptop:~/Scrivania$ python3 TikTok.py
2021-04-25 10:29:41 | INFO | π₯³ TikTokPy initialized. Version: 0.8.9
2021-04-25 10:29:41 | INFO | π§ Settings successfully loaded
2021-04-25 10:29:41 | INFO | π Cookies not found, anonymous mode
2021-04-25 10:29:41 | INFO | π Getting trending items
π Getting trending EN: 0%| | 0/5 [00:00<?, ?it/s]2021-04-25 10:29:47 | INFO | β TikTokPy finished working. Session lasted: 6 seconds
Traceback (most recent call last):
File "TikTok.py", line 37, in
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "TikTok.py", line 8, in main
trending_items = await bot.trending(amount=5)
File "/home/kts/.local/lib/python3.8/site-packages/tiktokpy/bot/init.py", line 57, in trending
items = await Trending(client=self.client).feed(amount=amount, lang=lang)
File "/home/kts/.local/lib/python3.8/site-packages/tiktokpy/client/trending.py", line 41, in feed
await page.evaluate(
File "/home/kts/.local/lib/python3.8/site-packages/pyppeteer/page.py", line 1184, in evaluate
return await frame.evaluate(pageFunction, *args, force_expr=force_expr)
File "/home/kts/.local/lib/python3.8/site-packages/pyppeteer/frame_manager.py", line 308, in evaluate
return await context.evaluate(
File "/home/kts/.local/lib/python3.8/site-packages/pyppeteer/execution_context.py", line 53, in evaluate
handle = await self.evaluateHandle(
File "/home/kts/.local/lib/python3.8/site-packages/pyppeteer/execution_context.py", line 92, in evaluateHandle
raise ElementHandleError(
pyppeteer.errors.ElementHandleError: Evaluation failed: TypeError: Cannot read property 'scrollIntoView' of null
at pyppeteer_evaluation_script:3:21
π Getting trending EN: 0%|
MacBook-Pro:Desktop$ python3 tikapi.py
2020-09-09 11:15:34 | INFO | π₯³ TikTokPy initialized. Version: 0.8.6
2020-09-09 11:15:34 | INFO | π§ Settings successfully loaded
2020-09-09 11:15:34 | INFO | π Cookies not found, anonymous mode
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connection.py", line 360, in connect
ssl_context=context,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 423, in wrap_socket
session=session
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 870, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tikapi.py", line 28, in <module>
asyncio.run(main())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "tikapi.py", line 6, in main
async with TikTokPy() as bot:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tiktokpy/bot/__init__.py", line 35, in __aenter__
await self._init_bot()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tiktokpy/bot/__init__.py", line 98, in _init_bot
self.client: Client = await Client.create()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tiktokpy/client/__init__.py", line 101, in create
await self.init_browser(headless=headless)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tiktokpy/client/__init__.py", line 44, in init_browser
self.browser: Browser = await launch(**params)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyppeteer/launcher.py", line 305, in launch
return await Launcher(options, **kwargs).launch()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyppeteer/launcher.py", line 119, in __init__
download_chromium()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyppeteer/chromium_downloader.py", line 146, in download_chromium
extract_zip(download_zip(get_url()), DOWNLOADS_FOLDER / REVISION)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyppeteer/chromium_downloader.py", line 85, in download_zip
data = http.request('GET', url, preload_content=False)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/request.py", line 76, in request
method, url, fields=fields, headers=headers, **urlopen_kw
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/request.py", line 97, in request_encode_url
return self.urlopen(method, url, **extra_kw)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/poolmanager.py", line 330, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connectionpool.py", line 760, in urlopen
**response_kw
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connectionpool.py", line 760, in urlopen
**response_kw
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connectionpool.py", line 760, in urlopen
**response_kw
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded with url: /chromium-browser-snapshots/Mac/588429/chrome-mac.zip (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))
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.
How to actually login?
It is not in quickstart. Is it possible to include the login command before the other functions in quickstart?
Hey I have the bot up and running but it dosnt actually do anything although it says it is working:
2021-02-09 22:23:42 | INFO | π Getting trending items
π Getting trending EN: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 5/5 [00:00<00:00, 1249.87it/s]
2021-02-09 22:23:46 | INFO | πΉ Found 5 videos
2021-02-09 22:23:46 | INFO | π§ Going to @timothytancre's video 6925302735428422917 page for like
2021-02-09 22:23:51 | INFO | π @timothytancre's video 6925302735428422917 liked
2021-02-09 22:23:51 | INFO | π§ Going to @timothytancre's page for following
2021-02-09 22:23:58 | INFO | β @timothytancre followed
2021-02-09 22:23:58 | INFO | π§ Going to @tiakbhatia's video 6917690109928295685 page for like
2021-02-09 22:24:02 | INFO | π @tiakbhatia's video 6917690109928295685 liked
2021-02-09 22:24:03 | INFO | π§ Going to @tiakbhatia's page for following
2022-04-06 15:23:54 | INFO | π₯³ TikTokPy initialized. Version: 0.9.0
2022-04-06 15:23:54 | INFO | π§ Settings successfully loaded
2022-04-06 15:23:54 | INFO | π Cookies not found, anonymous mode
2022-04-06 15:23:55 | INFO | π Getting trending items
π Getting trending EN: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 5/5 [00:03<00:00, 1.56it/s]
2022-04-06 15:24:17 | INFO | πΉ Found 5 videos
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "like" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unlike" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "follow" without login! Run "tiktokpy login" first and do login
2022-04-06 15:24:17 | ERROR | π‘ You cannot use function "unfollow" without login! Run "tiktokpy login" first and do login
(toks) 11:59 ~/code/toks (master)$ python
Python 3.8.0 (default, Nov 14 2019, 22:29:45)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> from tiktokpy import TikTokPy
>>>
>>>
>>> async def main():
... async with TikTokPy() as bot:
... user_feed_items = TikTokPy().user_feed(username="bfeldman89", amount=5)
... for item in user_feed_items:
... print("Plays: ", item.stats.plays)
... print("Shares: ", item.stats.shares)
... print("Likes: ", item.stats.likes)
...
>>>
>>> asyncio.run(main())
2021-07-17 12:01:13 | INFO | π₯³ TikTokPy initialized. Version: 0.8.9
2021-07-17 12:01:14 | INFO | π§ Settings successfully loaded
2021-07-17 12:01:14 | INFO | π Cookies not found, anonymous mode
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 108773488/108773488 [00:00<00:00, 264727549.24it/s]
2021-07-17 12:01:27 | INFO | π₯³ TikTokPy initialized. Version: 0.8.9
2021-07-17 12:01:27 | INFO | π§ Settings successfully loaded
2021-07-17 12:01:27 | INFO | π Cookies not found, anonymous mode
2021-07-17 12:01:27 | INFO | β TikTokPy finished working. Session lasted: 14 seconds
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 608, in run_until_complete
return future.result()
File "<stdin>", line 4, in main
TypeError: 'coroutine' object is not iterable
when i run
pip install tiktokpy
i get this error:
ERROR: Could not find a version that satisfies the requirement tiktokpy (from versions: none)
ERROR: No matching distribution found for tiktokpy
Hi!
The code id pending on 'Getting trends':
2021-04-18 17:26:07 | INFO | π₯³ TikTokPy initialized. Version: 0.8.9
2021-04-18 17:26:07 | INFO | π§ Settings in path directory not found "...". I'll create default settings here: ///
2021-04-18 17:26:07 | INFO | π§ Settings successfully loaded
2021-04-18 17:26:07 | INFO | π Cookies not found, anonymous mode
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 136913619/136913619 [00:11<00:00, 11954654.37it/s]
2021-04-18 17:26:22 | INFO | π Getting trending items
Could you please clarify, how the authentication is passed? Where I can specify login data?
Thanks!
What loud be the code for python 3.6.1st time I see asyncio.Don`t have time to break the code.
Also where is thee documentations for all the futures.Thank you
Already install and follow guide.
for item in user_feed_items:
# π§ get music title, cover, link, author name..
print("Music title: ", item.music.title)
# #οΈβ£ print all tag's title of video
print([tag.title for tag in item.challenges])
# π check all video stats
print("Comments: ", item.stats.comments)
print("Plays: ", item.stats.plays)
print("Shares: ", item.stats.shares)
print("Likes: ", item.stats.likes)
can u give advice sir? thank you.
Seems like many people want to use this Bot but are struggeling with the basic usage:
I created this written guide for beginner programmers "How to use TikTokPy".
This will help you to get started with this project.
the code after i run it it just gives === Restart " bot script path"
can anyone help me fix this ?
OSError: [Errno 8] Exec format error: '/data/data/com.termux/files/home/.local/share/pyppeteer/local-chromium/588429/chrome-linux/chrome'
I want to use Google Chrome to login to tiktok instead of Chromium.
Get this error when i try to login:
"You are visiting our service too frequently."
Even try to paste the cookies for my chrome browser, but get this error:
File "/usr/local/bin/tiktokpy", line 8, in <module>
sys.exit(app())
File "/usr/local/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/typer/main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "/usr/local/lib/python3.8/site-packages/tiktokpy/cli/utils.py", line 8, in wrapper
return asyncio.run(f(*args, **kwargs))
File "/usr/local/Cellar/[email protected]/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/Cellar/[email protected]/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/usr/local/lib/python3.8/site-packages/tiktokpy/cli/__init__.py", line 12, in login
async with TikTokPy() as bot:
File "/usr/local/lib/python3.8/site-packages/tiktokpy/bot/__init__.py", line 27, in __init__
load_or_create_settings(path=settings_path)
File "/usr/local/lib/python3.8/site-packages/tiktokpy/utils/settings.py", line 30, in load_or_create_settings
settings.load_file(path=path)
File "/usr/local/lib/python3.8/site-packages/dynaconf/base.py", line 141, in __getattr__
self._setup()
File "/usr/local/lib/python3.8/site-packages/dynaconf/base.py", line 191, in _setup
self._wrapped = Settings(
File "/usr/local/lib/python3.8/site-packages/dynaconf/base.py", line 255, in __init__
self.execute_loaders()
File "/usr/local/lib/python3.8/site-packages/dynaconf/base.py", line 947, in execute_loaders
settings_loader(
File "/usr/local/lib/python3.8/site-packages/dynaconf/loaders/__init__.py", line 124, in settings_loader
loader["loader"].load(
File "/usr/local/lib/python3.8/site-packages/dynaconf/loaders/toml_loader.py", line 31, in load
loader.load(filename=filename, key=key, silent=silent)
File "/usr/local/lib/python3.8/site-packages/dynaconf/loaders/base.py", line 62, in load
source_data = self.get_source_data(files)
File "/usr/local/lib/python3.8/site-packages/dynaconf/loaders/base.py", line 83, in get_source_data
content = self.file_reader(open_file)
File "/usr/local/lib/python3.8/site-packages/dynaconf/vendor/toml/decoder.py", line 83, in load
try:return loads(f.read(),B,A)
File "/usr/local/lib/python3.8/site-packages/dynaconf/vendor/toml/decoder.py", line 97, in loads
if E==_G:raise TomlDecodeError('Key name found without value. Reached end of line.',I,A)
dynaconf.vendor.toml.decoder.TomlDecodeError: Key name found without value. Reached end of line. (line 216 column 2 char 4996)
Maybe settings.toml isn't write? I just copy the cookie file and place it after this code:
[default]
BASE_URL = "https://www.tiktok.com/"
HEADLESS = true
LANG = "en"
HOME_DIR = "/Users/xxx"
how the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use thishow the fuck do we use this
Hello,
Iβm testing out tiktokpy because it supports authentication and has got the feature to follow people. However, Iβm unable to follow people, I get this error (my @ is replaced with XXX):
2021-07-17 19:42:53 | INFO | π₯³ TikTokPy initialized. Version: 0.8.9
2021-07-17 19:42:54 | INFO | π§ Settings successfully loaded
2021-07-17 19:42:54 | INFO | β
Used cookies of @XXX
2021-07-17 19:42:54 | INFO | π§ Going to @l.a.zulkarnain's page for following
2021-07-17 19:42:54 | INFO | β TikTokPy finished working. Session lasted: a moment
Traceback (most recent call last):
File "/home/maxime/Documents/coding/cerise/test/test.py", line 9, in <module>
asyncio.run(main())
File "/usr/lib64/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib64/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/maxime/Documents/coding/cerise/test/test.py", line 7, in main
await bot.follow("l.a.zulkarnain")
File "/home/maxime/Documents/coding/cerise/test/env/lib64/python3.9/site-packages/tiktokpy/bot/__init__.py", line 66, in follow
await User(client=self.client).follow(username=username)
File "/home/maxime/Documents/coding/cerise/test/env/lib64/python3.9/site-packages/tiktokpy/client/user.py", line 109, in follow
await self.client.goto(
File "/home/maxime/Documents/coding/cerise/test/env/lib64/python3.9/site-packages/tiktokpy/client/__init__.py", line 87, in goto
return await page.goto(full_url, *args, **kwargs)
File "/home/maxime/Documents/coding/cerise/test/env/lib64/python3.9/site-packages/pyppeteer/page.py", line 879, in goto
raise PageError(result)
pyppeteer.errors.PageError: net::ERR_INVALID_RESPONSE at https://www.tiktok.com/@l.a.zulkarnain
Here is the very basic python script:
import asyncio
from tiktokpy import TikTokPy
async def main():
async with TikTokPy() as bot:
await bot.follow("l.a.zulkarnain")
asyncio.run(main())
First, I had a lot of trouble to authenticate and by looking through the code, I saw I needed a "COOKIES" entry on the settings.toml file. Hereβs what I put in it (in json.. and value fields are replaced with XXX):
[{"name": "tt_webid_v2", "value": "XXX", "domain": ".tiktok.com"}, {"name": "tt_webid", "value": "XXX", "domain": ".tiktok.com"}, {"name": "tt_csrf_token", "value": "XXX", "domain": ".tiktok.com"}, {"name": "R6kq3TV7", "value": "XXX", "domain": ".tiktok.com"}, {"name": "csrf_session_id", "value": "XXX", "domain": "www.tiktok.com"}, {"name": "s_v_web_id", "value": "XXX", "domain": "www.tiktok.com"}, {"name": "passport_csrf_token_default", "value": "XXX", "domain": ".tiktok.com"}, {"name": "passport_csrf_token", "value": "XXX", "domain": ".tiktok.com"}, {"name": "MONITOR_WEB_ID", "value": "XXX", "domain": ".www.tiktok.com"}, {"name": "sid_guard", "value": "XXX", "domain": ".tiktok.com"}, {"name": "uid_tt", "value": "XXX", "domain": ".tiktok.com"}, {"name": "uid_tt_ss", "value": "XXX", "domain": ".tiktok.com"}, {"name": "sid_tt", "value": "XXX", "domain": ".tiktok.com"}, {"name": "sessionid", "value": "XXX", "domain": ".tiktok.com"}, {"name": "sessionid_ss", "value": "XXX", "domain": ".tiktok.com"}, {"name": "store-idc", "value": "XXX", "domain": ".tiktok.com"}, {"name": "store-country-code", "value": "XXX", "domain": ".tiktok.com"}, {"name": "cmpl_token", "value": "XXX", "domain": ".tiktok.com"}, {"name": "passport_fe_beating_status", "value": "XXX", "domain": ".www.tiktok.com"}, {"name": "odin_tt", "value": "XXX", "domain": ".tiktok.com"}, {"name": "ttwid", "value": "XXX", "domain": ".tiktok.com"}, {"name": "tt_webid_v2", "value": "XXX", "domain": ".tiktok.com"}, {"name": "tt_webid", "value": "XXX", "domain": ".tiktok.com"}, {"name": "tt_csrf_token", "value": "XXX", "domain": ".tiktok.com"}, {"name": "R6kq3TV7", "value": "XXX", "domain": ".tiktok.com"}, {"name": "csrf_session_id", "value": "XXX", "domain": "www.tiktok.com"}, {"name": "s_v_web_id", "value": "XXX", "domain": "www.tiktok.com"}, {"name": "passport_csrf_token_default", "value": "XXX", "domain": ".tiktok.com"}, {"name": "passport_csrf_token", "value": "XXX", "domain": ".tiktok.com"}, {"name": "MONITOR_WEB_ID", "value": "XXX", "domain": ".www.tiktok.com"}, {"name": "sid_guard", "value": "XXX", "domain": ".tiktok.com"}, {"name": "uid_tt", "value": "XXX", "domain": ".tiktok.com"}, {"name": "uid_tt_ss", "value": "XXX", "domain": ".tiktok.com"}, {"name": "sid_tt", "value": "XXX", "domain": ".tiktok.com"}, {"name": "sessionid", "value": "XXX", "domain": ".tiktok.com"}, {"name": "sessionid_ss", "value": "XXX", "domain": ".tiktok.com"}, {"name": "store-idc", "value": "XXX", "domain": ".tiktok.com"}, {"name": "store-country-code", "value": "XXX", "domain": ".tiktok.com"}, {"name": "cmpl_token", "value": "XXX", "domain": ".tiktok.com"}, {"name": "passport_fe_beating_status", "value": "XXX", "domain": ".www.tiktok.com"}, {"name": "odin_tt", "value": "XXX", "domain": ".tiktok.com"}, {"name": "ttwid", "value": "XXX", "domain": ".tiktok.com"}]
The problem might not be correlated with the cookies, but I share it anyways.
What should I do to fix this?
Thanks in advance.
ERROR | π‘ You cannot use function "like" without login! Run "tiktokpy login" first and do login ,error correction instructions, thanks
Anybody can help me how to use this tools?
2020-08-15 12:49:59 | INFO | β
Used cookies of @SomeRandomGuy
2020-08-15 12:50:36 | INFO | β TikTokPy finished working. Session lasted: 36 seconds
Traceback (most recent call last):
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\SomeRandomGuy\AppData\Local\Programs\Python\Python38\Scripts\tiktokpy.exe_main.py", line 7, in
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\typer\main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 829, in call
return self.main(*args, **kwargs)
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1259, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\typer\main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\tiktokpy\cli\utils.py", line 8, in wrapper
return asyncio.run(f(*args, **kwargs))
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\asyncio\runners.py", line 43, in run
return loop.run_until_complete(main)
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\tiktokpy\cli_init.py", line 13, in login
await bot.login_session()
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\tiktokpy\bot_init.py", line 83, in login_session
await Login().manual_login()
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\tiktokpy\client\login.py", line 21, in manual_login
await page.waitFor(".profile-actions > li:first-child")
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\pyppeteer\frame_manager.py", line 855, in await
raise result
pyppeteer.errors.TimeoutError: Waiting for selector ".profile-actions > li:first-child" failed: timeout 30000ms exceeds.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\site-packages\pyppeteer\launcher.py", line 151, in _close_process
self._loop.run_until_complete(self.killChrome())
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\asyncio\base_events.py", line 591, in run_until_complete
self._check_closed()
File "c:\users\SomeRandomGuy\appdata\local\programs\python\python38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
sys:1: RuntimeWarning: coroutine 'Launcher.killChrome' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\SomeRandomGuy\Desktop\TikTok\tiktokpy-master>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.