Spaces:
Paused
Paused
Download src/scraper/WebScraper/utils/maxDepthUtils.ts from Echo-AI-official/Fire-crawl: direct link, hf CLI and curl.
- Browser
- Download file 430 Bytes
-
https://huggingface.co/spaces/Echo-AI-official/Fire-crawl/resolve/main/src/scraper/WebScraper/utils/maxDepthUtils.ts
- Command line
-
hf download hf://spaces/Echo-AI-official/Fire-crawl/src/scraper/WebScraper/utils/maxDepthUtils.ts
-
curl -L -o maxDepthUtils.ts https://huggingface.co/spaces/Echo-AI-official/Fire-crawl/resolve/main/src/scraper/WebScraper/utils/maxDepthUtils.ts
430 Bytes
| export function getAdjustedMaxDepth( | |
| url: string, | |
| maxCrawlDepth: number, | |
| ): number { | |
| const baseURLDepth = getURLDepth(url); | |
| const adjustedMaxDepth = maxCrawlDepth + baseURLDepth; | |
| return adjustedMaxDepth; | |
| } | |
| export function getURLDepth(url: string): number { | |
| const pathSplits = new URL(url).pathname | |
| .split("/") | |
| .filter((x) => x !== "" && x !== "index.php" && x !== "index.html"); | |
| return pathSplits.length; | |
| } | |