updated domain
This commit is contained in:
186932
dealers.json
186932
dealers.json
File diff suppressed because it is too large
Load Diff
14582
distributors.json
14582
distributors.json
File diff suppressed because it is too large
Load Diff
14
src/lib/server/external/api.scraping.helpers.ts
vendored
14
src/lib/server/external/api.scraping.helpers.ts
vendored
@@ -2,6 +2,15 @@ import { getRandomUserAgent, getULID, sleep } from "$lib/utils";
|
||||
import { constants } from "$lib/utils/constants";
|
||||
import type { BookingEntry, Draw, LooseApiUser } from "$lib/utils/data.types";
|
||||
import { rng } from "$lib/utils/rng";
|
||||
// import fs from "fs";
|
||||
|
||||
// function dumpDistributors(distributors: LooseApiUser[]) {
|
||||
// fs.writeFileSync("distributors.json", JSON.stringify(distributors, null, 2));
|
||||
// }
|
||||
|
||||
// function dumpDealers(dealers: LooseApiUser[]) {
|
||||
// fs.writeFileSync("dealers.json", JSON.stringify(dealers, null, 2));
|
||||
// }
|
||||
|
||||
export const testIfSessionIsValid = async (jwt: string) => {
|
||||
try {
|
||||
@@ -128,6 +137,9 @@ export const getDealers = async (jwt: string, distributor_ids: string[]) => {
|
||||
};
|
||||
}
|
||||
const dealers = data.data.items.map((item) => item.dealer);
|
||||
|
||||
// dumpDealers(dealers);
|
||||
|
||||
return {
|
||||
dealers,
|
||||
ok: res.status === 200 && data.success,
|
||||
@@ -195,6 +207,8 @@ export const getDistributors = async (jwt: string) => {
|
||||
// JSON.stringify(json.data.items, null, 2),
|
||||
// );
|
||||
|
||||
// dumpDistributors(json.data.items.map((item) => item.distributor));
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
message: "",
|
||||
|
||||
@@ -3,10 +3,10 @@ export const constants = {
|
||||
SESSION_EXPIRE_TIME_MS: 6 * 60 * 60 * 1000,
|
||||
POST_SESSION_KEY: "postsession",
|
||||
LAST_FETCHED_KEY: "LAST_FETCHED",
|
||||
SCRAP_API_URL: "https://ritmuglobal.com:8443/lottery",
|
||||
SCRAP_API_URL: "https://ritmu7.com:8443/lottery",
|
||||
SCRAP_API_SESSION_KEY: "SRAJWT",
|
||||
SCRAP_API_BASE_HEADERS: {
|
||||
Host: "ritmuglobal.com:8443",
|
||||
Host: "ritmu7.com:8443",
|
||||
"Sec-Ch-Ua": '"Not/A)Brand";v="8", "Chromium";v="126"',
|
||||
"Sec-Ch-Ua-Mobile": "?0",
|
||||
"Sec-Ch-Ua-Platform": '"Windows"',
|
||||
@@ -17,8 +17,8 @@ export const constants = {
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Accept: "application/json, text/plain, */*",
|
||||
Origin: "https://www.ritmuglobal.com",
|
||||
Referer: "https://www.ritmuglobal.com/",
|
||||
Origin: "https://www.ritmu7.com",
|
||||
Referer: "https://www.ritmu7.com/",
|
||||
Priority: "u=1, i",
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user