Skip to content

Commit

Permalink
feat: update info
Browse files Browse the repository at this point in the history
  • Loading branch information
Achaak committed Jun 27, 2023
1 parent 30047b5 commit 92de6ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/services/API/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@ export const api = gotScraping.extend({
prefixUrl: "https://apptoogoodtogo.com/api/",
headers: {
"User-Agent":
"TooGoodToGo/21.9.0 (813) (iPhone/iPhone 7 (GSM); iOS 15.1; Scale/2.00)",
"TGTG/22.5.5 Dalvik/2.1.0 (Linux; Android 12; SM-G920V Build/MMB29K)",
"Content-Type": "application/json; charset=utf-8",
Accept: "application/json",
"Accept-Language": "en-US",
"Accept-Encoding": "gzip",
},
responseType: "json",
resolveBodyOnly: true,
retry: {
limit: 2,
methods: ["GET", "POST", "PUT", "HEAD", "DELETE", "OPTIONS", "TRACE"],
statusCodes: [401, 403, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
},
// @ts-ignore
headerGeneratorOptions: {
browsers: [
{
name: "safari",
name: "chrome",
},
],
devices: ["mobile"],
Expand Down
5 changes: 3 additions & 2 deletions src/services/API/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const authByEmail = () =>
polling_id: string;
}>("auth/v3/authByEmail", {
json: {
device_type: "IOS",
device_type: "ANDROID",
email: env.CREDENTIAL_EMAIL,
},
});
Expand All @@ -22,7 +22,7 @@ export const authByRequestPollingId = ({
startup_data: { user: { user_id: number } };
}>("auth/v3/authByRequestPollingId", {
json: {
device_type: "IOS",
device_type: "ANDROID",
email: env.CREDENTIAL_EMAIL,
request_polling_id: polling_id,
},
Expand All @@ -34,6 +34,7 @@ export const refresh = ({ refreshToken }: { refreshToken: string }) =>
refresh_token: string;
}>("auth/v3/token/refresh", {
json: {
device_type: "ANDROID",
refresh_token: refreshToken,
},
});
1 change: 1 addition & 0 deletions src/services/API/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const getFavorite = ({
},
radius: 200,
user_id: userId,
device_type: "ANDROID",
},
headers: {
Authorization: `Bearer ${accessToken}`,
Expand Down

0 comments on commit 92de6ae

Please sign in to comment.