junhoyeo / threads-api

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

Fix: getToken not returning userID #223

Closed Aerglonus closed 11 months ago

Aerglonus commented 11 months ago

Fixes

Edit: removed the change on getProfilePage headers method because uncertainty on how this is meant to be used aside from being used by other functions

getTokenID not returning userID

The regex was not properly working now it should return the token with the userID

- #148 Not related

vercel[bot] commented 11 months 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/F1y2Xu72kP2TVbr5ruqioXzvM5iv)) | [Visit Preview](https://threads-api-git-fork-aerglonus-fixes-junhoyeo.vercel.app) | | Jul 20, 2023 5:17am |
Aerglonus commented 11 months ago

Thanks! I'm outside rn, will test & publish soon!

Quick question the getProfilePage, should be used on its own and return some data? like this:

    const userProfile = await threadsAPI.getProfilePage('https://www.threads.net/@', username);
    console.log(userProfile);
junhoyeo commented 11 months ago

getTokenID not returning userID

Oh hey, I just ran getToken with the fixed test code in #225 and confirmed the userID work correctly! Thanks.

Quick question the getProfilePage, should be used on its own and return some data? like this:

I don't think everyone got this right, but this was actually an internal method added at https://github.com/junhoyeo/threads-api/pull/106/files#diff-a0ae255b36f5cb107ebf68b94c00973a564b5dd5450e3c041cf8b44ecd0233b0R181 (to fetch raw doc as HTML, but cleaned)

cc @yssf-io

junhoyeo commented 11 months ago

I don't think everyone got this right, but this was actually an internal method added at https://github.com/junhoyeo/threads-api/pull/106/files#diff-a0ae255b36f5cb107ebf68b94c00973a564b5dd5450e3c041cf8b44ecd0233b0R181 (to fetch raw doc as HTML, but cleaned)

Think it'll be better to rename getProfilePage to _getProfileHTML or something more direct

junhoyeo commented 11 months ago

I'll merge this. Gonna close the issues after releasing next version.