Skip to content

Commit

Permalink
hubcloud resolver fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mnsrulz committed Aug 31, 2024
1 parent 0aa210f commit d76eba6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libs/hubCloudResolver-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class HubCloudResolverV2 extends BaseUrlResolver {

constructor() {
super({
domains: [/https?:\/\/(hubcloud.link)/],
domains: [/https?:\/\/(hubcloud)/],
speedRank: 90,
useCookies: true
});
Expand Down
11 changes: 10 additions & 1 deletion src/libs/hubCloudResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class HubCloudResolver extends BaseUrlResolver {

constructor() {
super({
domains: [/https?:\/\/(hubcloud.link)/],
domains: [/https?:\/\/(hubcloud)/],
speedRank: 90
});
}
Expand All @@ -18,7 +18,16 @@ export class HubCloudResolver extends BaseUrlResolver {
const regex01Result = regex01.exec(response.body);
link = regex01Result?.[1] || '';
}

const title = this.extractFileNameFromUrl(link);

if (title.endsWith('.php')) {
//it's a redirect
const rsp2 = await this.gotInstance(link);
const result_01 = this.scrapeAllLinks(rsp2.body, '.card-body');
return result_01;
}

const result = {
link,
title,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/workers.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export class WorkersDevResolver extends BaseUrlResolver {

async canResolve(urlToResolve: string): Promise<boolean> {
const u = new URL(urlToResolve);
return u.hostname.endsWith('workers.dev');
return u.hostname.endsWith('workers.dev') || u.hostname.endsWith('r2.dev');
}
}

0 comments on commit d76eba6

Please sign in to comment.