Skip to content

Commit

Permalink
fix(crawler/rust): dedupe
Browse files Browse the repository at this point in the history
  • Loading branch information
mogery committed Jan 30, 2025
1 parent c88176a commit a7eb2f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/scraper/WebScraper/crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ export class WebCrawler {

public async extractLinksFromHTML(html: string, url: string) {
try {
return (await this.extractLinksFromHTMLRust(html, url)).map(x => {
return [...new Set((await this.extractLinksFromHTMLRust(html, url)).map(x => {
try {
return new URL(x, url).href
} catch (e) {
return null;
}
}).filter(x => x !== null) as string[];
}).filter(x => x !== null) as string[])];
} catch (error) {
this.logger.error("Failed to call html-transformer! Falling back to cheerio...", {
error,
Expand Down

0 comments on commit a7eb2f7

Please sign in to comment.