Skip to content

Commit

Permalink
Better handle bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed May 31, 2024
1 parent 15ff42d commit 8437bf1
Show file tree
Hide file tree
Showing 36 changed files with 320 additions and 227 deletions.
6 changes: 3 additions & 3 deletions client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { load_mpv_page } from "./page/MPVPage.ts";
import { load_single_page } from "./page/SinglePage.ts";
import { RecoverableError, TimeoutError, toJSON } from "./utils.ts";

export type GID = [number, string];
export type GID = [number | bigint, string];

export class Client {
cfg;
Expand Down Expand Up @@ -189,7 +189,7 @@ export class Client {
* @param page Page number
* @returns
*/
async fetchGalleryPage(gid: number, token: string, page?: number) {
async fetchGalleryPage(gid: number | bigint, token: string, page?: number) {
let url = `https://${this.host}/g/${gid}/${token}/`;
if (page) url += `?p=${page}`;
const re = await this.get(url);
Expand All @@ -206,7 +206,7 @@ export class Client {
* @param token Token
* @returns
*/
async fetchMPVPage(gid: number, token: string) {
async fetchMPVPage(gid: number | bigint, token: string) {
const url = `https://${this.host}/mpv/${gid}/${token}/`;
const re = await this.get(url);
if (re.status != 200) {
Expand Down
Loading

0 comments on commit 8437bf1

Please sign in to comment.