threads-py
threads-py copied to clipboard
the code doesn't seem to work for me
i tried to run app.py
i get this when I try to get user_id
{'data': None, 'errors': [{'message': 'A server error noncoercible_field_result occured. Check server logs for details.', 'severity': 'ERROR'}], 'extensions': {'is_final': True}}
26444807
tbh I haven't got a chance check this out. I promise to test and package the Python version soon too!
I found the same issue. thanks for the hard work.
Running:
api = ThreadsAPI()
username = "stkildafc"
user_id = api.get_user_id_from_username(username)
user_profile = api.get_user_profile(username)
user_threads = api.get_user_profile_threads(username)
print(user_id)
print("\n", user_profile)
print("\n", user_threads)
This is what I get:
{'data': None, 'errors': [{'message': 'A server error noncoercible_field_result occured. Check server logs for details.', 'severity': 'ERROR'}], 'extensions': {'is_final': True}}
26444807
{'is_private': False, 'profile_pic_url': 'https://scontent.cdninstagram.com/v/t51.2885-19/358096727_3588265128116746_1695549457359323889_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent.cdninstagram.com&_nc_cat=110&_nc_ohc=H3G-6tEtE-YAX9Wh8_T&edm=APs17CUBAAAA&ccb=7-5&oh=00_AfAE8VxTGb1kuuBLyqoIyV22bOTgL46lXi8v0S0Envnm6g&oe=64AD5164&_nc_sid=10d13b', 'username': 'stkildafc', 'hd_profile_pic_versions': [{'height': 320, 'url': 'https://scontent.cdninstagram.com/v/t51.2885-19/358096727_3588265128116746_1695549457359323889_n.jpg?stp=dst-jpg_s320x320&_nc_ht=scontent.cdninstagram.com&_nc_cat=110&_nc_ohc=H3G-6tEtE-YAX9Wh8_T&edm=APs17CUBAAAA&ccb=7-5&oh=00_AfC589pGhhd5hsxbvmdhVpWczY7uQqMcjAXokJFH0-SZDw&oe=64AD5164&_nc_sid=10d13b', 'width': 320}], 'is_verified': True, 'biography': 'Home of #SaintsFooty 😇', 'biography_with_entities': None, 'follower_count': 3789, 'profile_context_facepile_users': None, 'bio_links': [{'url': 'https://www.saints.com.au/'}], 'pk': '26444807', 'full_name': 'St Kilda Football Club', 'id': None}
{'data': None, 'errors': [{'message': 'A server error noncoercible_field_result occured. Check server logs for details.', 'severity': 'ERROR'}], 'extensions': {'is_final': True}}
Okay I'll really start working on this thing
It's working now. Any suggestions for handling this exception? I guess I made two many calls in a row.
TooManyRedirects: Exceeded 30 redirects.
I think the response format has changed because the script doesn't work to me anymore :(
I wonder why this thing does not works on normal code but it's unittest seems to work
This is the error that I get for Get Thread From Post ID:
\site-packages\dataclasses_json\core.py:184: RuntimeWarning: `NoneType` object value of non-optional type data detected when decoding GetUserProfileThreadResponse.
warnings.warn(
ThreadData(reply_threads=[], containing_thread=None)
@abdhan I figured out why get_user_id_from_username returns boolean which cause parameter type mismatch
This is the error that I get for Get Thread From Post ID:
\site-packages\dataclasses_json\core.py:184: RuntimeWarning: `NoneType` object value of non-optional type data detected when decoding GetUserProfileThreadResponse. warnings.warn( ThreadData(reply_threads=[], containing_thread=None)
That's not an error, it's a warning message about the dataclasses-json
package.
@abdhan I figured out why get_user_id_from_username returns boolean which cause parameter type mismatch
@mirageoasis I've merged PR #14 and fixed all the code related to the changes in PR #16 .
Thanks for the explanation.
@frapierri said:
It's working now.
How'd you fix that?
{
"data": null,
"errors": [
{
"message": "A server error noncoercible_field_result occured. Check server logs for details.",
"severity": "ERROR"
}
],
"extensions": {
"is_final": true
}
}
on get_threads
@frapierri said:
It's working now.
How'd you fix that?
{ "data": null, "errors": [ { "message": "A server error noncoercible_field_result occured. Check server logs for details.", "severity": "ERROR" } ], "extensions": { "is_final": true } }
on get_threads
can you show me your code?
here's another library for threads in python. I believe this seems to work for now https://github.com/dmytrostriletskyi/threads-net
here's another library for threads in python. I believe this seems to work for now https://github.com/dmytrostriletskyi/threads-net
code still not working? if you update package I think it will work if it doesn't can you show me your code?
Looks like they keep changing the endpoint on the Threads side, so it's gonna be hellish for the next few weeks....
p.s. the JS version still works great, kudos to @junhoyeo once again
Looks like they keep changing the endpoint on the Threads side, so it's gonna be hellish for the next few weeks....
p.s. the JS version still works great, kudos to @junhoyeo once again
show us the code you ran.
Looks like they keep changing the endpoint on the Threads side, so it's gonna be hellish for the next few weeks.... p.s. the JS version still works great, kudos to @junhoyeo once again
show us the code you ran.
I just ran the examples. I also tried the other library (https://github.com/dmytrostriletskyi/threads-net) but I get unstable results (working with "zuck" but not with other random usernames).
@frapierri said:
It's working now.
How'd you fix that?
{ "data": null, "errors": [ { "message": "A server error noncoercible_field_result occured. Check server logs for details.", "severity": "ERROR" } ], "extensions": { "is_final": true } }
on get_threads
can you show me your code?
I was actually trying to convert your python into javascript. But I found the library by @elijah-wright so he had already done this.
https://github.com/stevenlafl/threads-web-client/blob/master/src/pages/api/feed.ts
Thanks though!
I got the noncoercible_field_result
error when I was querying with the wrong account (that has a Instagram profile but hadn't registered to Threads yet)