-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da8229b
commit be3274b
Showing
11 changed files
with
208 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import got from 'got' | ||
import { ScraperError } from '../utils' | ||
import type { NameFreeFire } from './types' | ||
|
||
export default async function nameFreeFire(id: string | number): Promise<NameFreeFire> { | ||
id = id.toString() | ||
const json: any = await got('https://api.duniagames.co.id/api/transaction/v1/top-up/inquiry/store', { | ||
headers: { | ||
accept: 'application/json, text/plain, */*', | ||
'content-type': 'application/json', | ||
origin: 'https://duniagames.co.id', | ||
referer: 'https://duniagames.co.id/', | ||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', | ||
}, | ||
body: JSON.stringify({ | ||
catalogId: 66, | ||
gameId: id, | ||
itemId: 11, | ||
paymentId: 750, | ||
productId: 3, | ||
product_ref: "AE", | ||
product_ref_denom: "AE" | ||
}), | ||
method: 'POST' | ||
}).json() | ||
if (json.status.message !== 'success') throw new ScraperError(`Can't get nameFreeFire for id ${id}\n${JSON.stringify(json, null, 2)}`) | ||
return { | ||
id: json.data.gameId, | ||
username: json.data.userNameGame | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.