junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.59k stars 134 forks source link

fix: methods failing because of token or headers #216

Closed Aerglonus closed 1 year ago

Aerglonus commented 1 year ago

The PR add new methods for some that do not require authentication and fixes the issues of not retrieving data. #188 and #175

Added

_getUnAuthenticatedHeaders

Reason This was added because some methods that do not require the header Authorization were failing because of it.

Added

_getDefaultUserDataHeaders

Reason

Simply to pass the getUnAuthenticatedHeaders to methods that do not require authentication like getUserProfile getThreads getThreadsLikers

Added

_getDefaultRepliesHeaders  | _requestRepliesQuery 

Reason

The motive to add these two were because the referer header to the threads.net/api/graphql endpoint includes the /replies path when is not logged in.

Note :

getProfilePage and getUserIDfromUsername are still bugged

getProfilePage returns 404 Not Found html as response getUserIDFromUsername returns Data: ' ' with error 429 too many requests when running by itself but when it works fine when running through getCurrentUserID

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **threads-api** | ⬜️ Ignored ([Inspect](https://vercel.com/junhoyeo/threads-api/Fq7Ttch3KcUb9bqTy4VFS4zqPj1R)) | | | Jul 19, 2023 4:53am |