Added finish methods to downloader and scraper.

This commit is contained in:
moonstar-x 2021-06-12 01:09:42 -05:00
parent ab65c9f15a
commit 7549e5b3f8
2 changed files with 11 additions and 0 deletions

View File

@ -16,6 +16,11 @@ class JDownloaderClient {
Logger.info(`Connected to JDownloader ${this.device.name}`);
}
async finish() {
await this.client.core.disconnect();
Logger.info(`Disconnected from JDownloader ${this.device.name}`);
}
async addLinks(media) {
if (!(media instanceof Media)) {
throw new TypeError('Invalid Media instance passed to downloader!');

View File

@ -17,6 +17,12 @@ class KissAsianScraper {
Logger.info('Cloudflare DDOS Protection bypassed, redirected to main site.');
}
async finish(browser) {
await this.page.close();
await browser.close();
Logger.info('Closed browser instance.');
}
async authenticate(credentials) {
await this.page.click('#topHolderBox a[href="/Login"]');
await this.page.waitForSelector('#btnSubmit');