This commit is contained in:
2023-06-23 16:59:44 +08:00
parent 02a0d975a4
commit d38c98aee4
3 changed files with 113 additions and 2 deletions

View File

@@ -129,10 +129,12 @@ export class Client {
* Fetch a gallery page (use HTML)
* @param gid Gallery ID
* @param token Token
* @param page Page number
* @returns
*/
async fetchGalleryPage(gid: number, token: string) {
const url = `https://${this.host}/g/${gid}/${token}/`;
async fetchGalleryPage(gid: number, token: string, page?: number) {
let url = `https://${this.host}/g/${gid}/${token}/`;
if (page) url += `?p=${page}`;
const re = await this.get(url);
if (re.status != 200) {
throw new Error(