Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Unofficial, Reverse-Engineered Python client for Meta's Threads.
Looking for the TypeScript version? Check out junhoyeo/threads-api.
pip install --no-cache-dir --upgrade threads-py
from threadspy import ThreadsAPI
api = ThreadsAPI()
username = "{username}"
# get a user id
user_id = api.get_user_id_from_username(username)
print(user_id)
# get a profile info
profile = api.get_user_profile(username, user_id=user_id)
print(profile)
# get a profile's threads tab
threads = api.get_user_profile_threads(username, user_id=user_id)
print(threads)
# get a profile's replies tab
replies = api.get_user_profile_replies(username, user_id=user_id)
print(replies)
# 3-ways to get the {post_id}
thread_id = "CuX_UYABrr7"
post_id = api.get_post_id_from_thread_id(thread_id)
print(post_id)
post_url = "https://www.threads.net/t/CuX_UYABrr7/?igshid=MzRlODBiNWFlZA=="
post_id = api.get_post_id_from_url(post_url)
print(post_id)
thread_id = "CuX_UYABrr7"
post_id = api.get_post_id_from_thread_id(thread_id)
print(post_id)
# get threads info
thread = api.get_threads(post_id)
print(thread)
# get who liked a thread
linkers = api.get_thread_likers(post_id)
print(linkers)
from threadspy import ThreadsAPI
api = ThreadsAPI(username="username", password="password")
api.publish(caption="🤖 Hello World!")
api.publish(caption= '🤖 Threads with Link Image', image_path="https://github.com/junhoyeo/threads-py/raw/main/.github/logo.jpg")
api.publish(caption= '🤖 Threads with Link Attachment', url="https://github.com/junhoyeo/threads-py)")
parent_post_url = 'https://www.threads.net/t/CugF-EjhQ3r'
parent_post_id = api.get_post_id_from_url(parent_post_url) # or use `get_post_id_from_thread_id`
api.publish({
text: '🤖 Beep',
link: 'https://github.com/junhoyeo/threads-py',
parent_post_id: parent_post_id,
})
search_parameter = "DrunkLeen"
# 💡 Uses current credentials
api.search(search_parameter)
post_url = 'https://www.threads.net/t/CugF-EjhQ3r'
post_id = api.get_post_id_from_url(post_url) # or use `get_post_id_from_thread_id`
# 💡 Uses current credentials
api.like(postIDToLike)
api.unlike(postIDToLike)
user_id = api.get_user_id_from_username('junhoyeo')
# 💡 Uses current credentials
api.follow(user_id)
api.unfollow(user_id)
user_id = api.get_user_id_from_username('junhoyeo')
# 💡 Uses current credentials
api.block(user_id)
api.unblock(user_id)
user_id = api.get_user_id_from_username('junhoyeo')
# 💡 Uses current credentials
api.mute(user_id)
api.unmute(user_id)
user_id = api.get_user_id_from_username('junhoyeo')
# 💡 Uses current credentials
api.restrict(user_id)
api.unrestrict(user_id)
user_id = api.get_user_id_from_username('junhoyeo')
# 💡 Uses current credentials
api.friendship_status(user_id)
user_id = api.get_user_id_from_username('junhoyeo')
# 💡 Uses current credentials
api.get_followings(user_id)
api.get_followers(user_id)
# 💡 Uses current credentials
api.get_suggested_users()
# or
api.get_suggested_users(count=5)
# or
api.get_suggested_users(paging=3)
# or
api.get_suggested_users(count=5, paging=2)
# "count" and "paging" parameters are optional
# default: count = 15 "paging" are optional
# default: paging = None
314216
) via username(zuck
)3140957200974444958
) via ThreadID(CuW6-7KyXme
) or PostURL(https://www.threads.net/t/CuW6-7KyXme
)threadspy.ai
)
MIT © Junho Yeo
If you find this project intriguing, please consider starring it(⭐) or following me on GitHub (I wouldn't say Threads).
MIT License
Copyright (c) 2023 Junho Yeo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unofficial, Reverse-Engineered Python client for Meta's Threads.
We found that threads-py demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.