# Video Download Link Crawler (JS) (`romy/video-download-link-crawler-js`) Actor

Crawl JavaScript-heavy websites to discover direct video download links using Playwright. Finds MP4, WebM, M3U8, MOV, and AVI files by following links up to a configurable depth.

- **URL**: https://apify.com/romy/video-download-link-crawler-js.md
- **Developed by:** [Romy](https://apify.com/romy) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Video Download Link Crawler (JS)

**Video Download Link Crawler (JS)** crawls JavaScript-heavy websites and discovers direct video download links using Playwright. Starting from a URL you provide, it renders pages in a real browser, follows links up to a configurable depth, and extracts direct file URLs for MP4, WebM, M3U8, MOV, and AVI files.

### What does Video Download Link Crawler (JS) do?

This Actor uses Playwright to render JavaScript-driven pages and discover video download links that would otherwise be invisible to simple HTTP crawlers. It is the browser-based companion to the lighter-weight `video-download-link-crawler` Actor, designed for sites that use dynamic video players or lazy-loaded content.

### Why use Video Download Link Crawler (JS)?

- **JS-rendered sites** — Finds videos on pages that load content dynamically.
- **SPA support** — Works with React, Vue, and Angular-based video galleries.
- **Configurable load strategy** — Choose when to start extracting (networkidle, load, etc.).
- **Same filtering as HTTP version** — Custom regex, extension filtering, depth, and page limits.

### How to use Video Download Link Crawler (JS)

1. Go to the Actor page on Apify and click **Try for free**.
2. Enter the **Start URL** — the page to begin crawling from.
3. Select a **Wait Until** strategy to control when the page is considered loaded.
4. Optionally set a **Link Regex**, **Video Extensions**, **Max Depth**, and **Max Pages**.
5. Click **Start** and wait for the Actor to finish.
6. Download results from the **Dataset** tab as JSON, CSV, or Excel.

### Input

| Field | Type | Description | Default |
|---|---|---|---|
| `start_url` | string | URL to start crawling (must include scheme, e.g., https://) | required |
| `link_regex` | string | Regex to filter which links to follow | same domain as start_url |
| `video_extensions` | array | Video file extensions to detect | `["mp4", "webm", "m3u8", "mov", "avi"]` |
| `max_depth` | integer | Maximum link-following depth | `2` |
| `max_pages` | integer | Maximum number of pages to visit | `100` |
| `wait_until` | string | Playwright page load event: `load`, `domcontentloaded`, `networkidle`, `commit` | `networkidle` |

**Example input:**

```json
{
    "start_url": "https://example.com/videos",
    "video_extensions": ["mp4", "m3u8"],
    "max_depth": 2,
    "wait_until": "networkidle"
}
```

### Output

Each dataset item represents one discovered video link:

```json
{
    "url": "https://cdn.example.com/video/sample.mp4",
    "source_url": "https://example.com/videos/page1",
    "extension": "mp4",
    "depth": 1
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Data table

| Field | Description |
|---|---|
| `url` | Direct URL to the video file |
| `source_url` | The page where the video link was found |
| `extension` | File extension (e.g., mp4, m3u8) |
| `depth` | How many links deep from start_url the video was found |

### Tips

- Use `wait_until: "networkidle"` for pages with heavy JavaScript — this ensures all async requests complete before extraction.
- Use `wait_until: "domcontentloaded"` for faster crawls when videos are in the initial HTML.
- For static HTML pages, use `video-download-link-crawler` (HTTP-based) — it is 10x faster and cheaper.
- Playwright runs a real browser so this Actor uses more compute units per page than the HTTP version.

### FAQ

**When should I use this instead of `video-download-link-crawler`?**
Use this Actor when the target website loads video URLs via JavaScript after initial page load.

**Is scraping videos legal?**
Always check the target website's Terms of Service and robots.txt before scraping. This Actor only collects URLs — downloading copyrighted content without permission may be illegal.

**I need help or found a bug.**
Open an issue in the Issues tab. Custom scraping solutions are also available on request.

# Actor input Schema

## `start_url` (type: `string`):

The URL to start crawling from. Must include a scheme (e.g., https://).

## `link_regex` (type: `string`):

Regular expression to filter which links to follow. Defaults to matching the same domain as start_url.

## `video_extensions` (type: `array`):

List of video file extensions to look for.

## `max_depth` (type: `integer`):

Maximum link-following depth.

## `max_pages` (type: `integer`):

Maximum number of pages to visit.

## `wait_until` (type: `string`):

Playwright page load event to wait for before extracting links.

## Actor input object example

```json
{
  "start_url": "https://example.com/videos",
  "video_extensions": [
    "mp4",
    "webm",
    "m3u8",
    "mov",
    "avi"
  ],
  "max_depth": 2,
  "max_pages": 100,
  "wait_until": "networkidle"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "start_url": "https://example.com/videos"
};

// Run the Actor and wait for it to finish
const run = await client.actor("romy/video-download-link-crawler-js").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "start_url": "https://example.com/videos" }

# Run the Actor and wait for it to finish
run = client.actor("romy/video-download-link-crawler-js").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "start_url": "https://example.com/videos"
}' |
apify call romy/video-download-link-crawler-js --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,romy/video-download-link-crawler-js"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cgNOXZKx2v2kgg6f1/builds/IXCDpsETpm6da6OT6/openapi.json
