diff --git a/threads-api/src/threads-api.ts b/threads-api/src/threads-api.ts index 93a7a9c..3389cec 100644 --- a/threads-api/src/threads-api.ts +++ b/threads-api/src/threads-api.ts @@ -499,7 +499,7 @@ export class ThreadsAPI { ...(!!username ? { referer: `https://www.threads.net/@${username}` } : undefined), }); - getProfilePage = async (url: string, username: string, options?: AxiosRequestConfig) => { + _getCleanedProfileHTML = async (url: string, username: string, options?: AxiosRequestConfig) => { const res = await axios.get(`${url}${username}`, { ...options, httpAgent: this.httpAgent, @@ -536,7 +536,7 @@ export class ThreadsAPI { username: string, options?: AxiosRequestConfig, ): Promise => { - const text = await this.getProfilePage('https://www.instagram.com/', username, options); + const text = await this._getCleanedProfileHTML('https://www.instagram.com/', username, options); const userID: string | undefined = text.match(/"user_id":"(\d+)",/)?.[1]; const lsdToken: string | undefined = text.match(/"LSD",\[\],{"token":"(\w+)"},\d+\]/)?.[1]; @@ -555,7 +555,7 @@ export class ThreadsAPI { username: string, options?: AxiosRequestConfig, ): Promise => { - const text = await this.getProfilePage('https://www.threads.net/@', username, options); + const text = await this._getCleanedProfileHTML('https://www.threads.net/@', username, options); const userID: string | undefined = text.match(/"user_id":"(\d+)"/)?.[1]; const lsdToken: string | undefined = text.match(/"LSD",\[\],{"token":"(\w+)"},\d+\]/)?.[1];