Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Like don't work #35

Closed
MsLolita opened this issue Jul 14, 2023 · 1 comment
Closed

Like don't work #35

MsLolita opened this issue Jul 14, 2023 · 1 comment

Comments

@MsLolita
Copy link

Seems as api was changed.
Traceback (most recent call last):
File "D:\user\prog\threads_bot\v2\tests\test.py", line 21, in
loop.run_until_complete(main())
File "C:\Users\Bou\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\user\prog\threads_bot\v2\tests\test.py", line 17, in main
await post()
File "D:\user\prog\threads_bot\v2\tests\test.py", line 9, in post
result = await api.like_post("1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\user\prog\threads_bot\v2\venv\Lib\site-packages\threads_api\src\threads_api.py", line 501, in like_post
return res["status"] == "ok"
~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable


from threads_api.src.threads_api import ThreadsAPI
import asyncio
import os


async def post():
    api = ThreadsAPI()
    await api.login("user", "pass", cached_token_path="..\\data\\.session")
    result = await api.like_post("1")
    print(result)
    if result:
        print("Post has been successfully posted")
    else:
        print("Unable to post.")

async def main():
    await post()

# Create an event loop and run the main function
loop = asyncio.get_event_loop()
loop.run_until_complete(main())

By hands, on phone, liking works.

@Danie1
Copy link
Owner

Danie1 commented Jul 14, 2023

Fixing this at this moment. Thanks for opening an issue! :)

Fixed here: #36

@Danie1 Danie1 closed this as completed Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants