Skip to content

Commit

Permalink
fix link splitting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
supercrafter100 committed Aug 27, 2024
1 parent 88539d2 commit 90f25d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/lib/RequestsManager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cheerio from "cheerio";
import * as cheerio from "cheerio";
import CubedFileManager from "../CubedFileManager.js";
import getSkriptErrors from '../util/getSkriptErrors.js';
import normalQuestion from "../questions/normalQuestion.js";
Expand All @@ -7,6 +7,7 @@ import Spinner from "../util/Spinner.js";
export default class RequestManager {

private instance: CubedFileManager;
private IGNORED_SERVER_NAMES = ["Visit Patreon"];

constructor(instance: CubedFileManager) {
this.instance = instance;
Expand Down Expand Up @@ -615,7 +616,7 @@ export default class RequestManager {
const hrefs: string[] = [];

const $ = cheerio.load(html);
$('tr > td:nth-child(1)').each((index, element) => {
$('div.table-responsive > table > tbody > tr > td:nth-child(1)').each((index, element) => {
const name = $(element).text();
names.push(name);
})
Expand All @@ -629,8 +630,9 @@ export default class RequestManager {

for (let i = 0; i < names.length; i++) {
const name = names[i].trim();
const id = hrefs[i].split('?s=')[1];
if (this.IGNORED_SERVER_NAMES.includes(name)) continue;

const id = hrefs[i].split('?s=')[1];
links.push({ name: name, id: id })
}

Expand Down

0 comments on commit 90f25d0

Please sign in to comment.