# Youtube Video Cut and Download (`nodexagent/youtube-video-cut-and-download`) Actor

Your all-in-one toolkit to instantly cut, download, and reformat YouTube videos. Trim specific clips, convert to a vertical 9:16 format for Shorts/TikTok, or extract high-quality audio in seconds.

- **URL**: https://apify.com/nodexagent/youtube-video-cut-and-download.md
- **Developed by:** [Nodexagent](https://apify.com/nodexagent) (community)
- **Categories:** AI, Videos, Social media
- **Stats:** 321 total users, 16 monthly users, 3.8% runs succeeded, 0 bookmarks
- **User rating**: 4.75 out of 5 stars

## Pricing

from $3.00 / 1,000 video clips

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## 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

## YouTube Video Cut and Download 🎬

A powerful and versatile [Apify Actor](https://apify.com/nodexagent/youtube-video-cut-and-download) for downloading, trimming, and reformatting YouTube videos Integrate into your automation workflows for hands-free content processing.

This is more than just a downloader. It's a complete toolkit for content creators, marketers, researchers, and archivists. You can download full videos in the highest possible quality, extract audio, or perform advanced processing like trimming specific clips and reformatting videos for social media platforms.

***

### 🎯 Who Is This For?

This tool is designed for anyone who needs to work with YouTube videos efficiently:

- **Content Creators & YouTubers:** Quickly create compilation videos, reaction videos, or Shorts by clipping segments from other videos.
- **Social Media Managers:** Effortlessly convert standard videos into vertical 9:16 format for TikTok, Instagram Reels, and YouTube Shorts.
- **Video Editors & Podcasters:** Extract high-quality audio for podcasts or grab specific video clips to use as B-roll.
- **Researchers & Educators:** Save and archive specific, relevant segments of lectures, documentaries, or news reports for study.
- **YouTube Automation Channels:** Integrate this Actor via API into your workflow to automate the creation of "Top 10" lists, highlight reels, and more.
- **Casual Users:** Easily save your favorite song, a funny clip, or a tutorial snippet without installing complex software.

***

### 🚀 Key Features

- ✅ **Highest Quality Downloads:** Downloads the best available video and audio streams and merges them to provide true HD quality (1080p, 4K, etc.).
- ✂️ **Precise Video Trimming:** Download only the exact section of a video you need by specifying a start and end time.
- 📱 **Instant Vertical Conversion:** Automatically convert standard 16:9 videos into a vertical 9:16 format with a single click.
- 🎧 **High-Quality Audio Extraction:** Rip the audio from any video and save it in your preferred format (`mp3`, `wav`, `m4a`, `flac`).
- 🎚️ **Format and Quality Selection:** Choose your desired output format and video quality from convenient dropdown lists.
- 🍪 **Cookie Authentication Support:** Bypass YouTube's "Sign in" errors for age-restricted or private videos by providing your browser cookies.
- 📦 **Direct Apify Integration:** All output files are saved directly to the Apify Key-Value Store, providing a stable, direct URL for you to download your final file.

***

### 📖 How to Use

1. **Paste the YouTube URL** you want to process.
2. **Select your options:**
   - Check **Trim Video** and provide `Start Time` and `End Time` (in HH:MM:SS format) to download a specific clip.
   - Check **Convert to Vertical** to reformat the output for mobile-first platforms.
   - Choose your desired **Video Quality** and **Format**.
3. **(Optional)** If you need to download an age-restricted or private video, follow the cookie instructions below. For most public videos, this is not needed.
4. Click **Start**. Your final processed file will be available in the "Storage" tab of the Actor run.

***

### 💬 Frequently Asked Questions (FAQ)

**Q: What exactly is this tool?**\
A: This is an online tool (an Apify Actor) that lets you download, cut, and reformat any public YouTube video directly from your browser. It runs on a server, so you don't need to install any complex software on your own computer.

**Q: How do I cut a specific part of a YouTube video?**\
A: Simply check the "Trim Video" box and enter the desired `Start Time` and `End Time` in the `HH:MM:SS` format (e.g., `00:01:30` to start at 1 minute and 30 seconds). The Actor will download only that specific segment.

**Q: Can I cut a YouTube video and download only the audio as MP3?**\
A: Yes! Check the "Audio Only" box and select `mp3` from the "Audio Format" dropdown. If you also use the "Trim Video" feature, you will get an MP3 of only your selected clip.

**Q: Is it possible to convert a cut YouTube clip into a 9:16 vertical video?**\
A: Absolutely. This is one of the tool's most powerful features. Simply check both the "Trim Video" and "Convert to Vertical" boxes. The Actor will first cut your clip and then reformat it into a 9:16 aspect ratio, ready for TikTok, Reels, or Shorts.

**Q: What about downloading a video without sound?**\
A: You can achieve this by running the download with "Audio Only" checked settings.

**Q: Is it safe to use, and are my activities tracked?**\
A: Yes, it is safe. The entire process runs on Apify's secure cloud infrastructure. Your activity is private to your Apify account. The connection to YouTube is made from the server, not your computer, so your personal IP address is not exposed to YouTube during the download.

**Q: Are there any limits on cutting videos?**\
A: There are no practical limits. on the number of YouTube videos you can cut or the length of the clips. We aim to provide flexible online video trimming.

**Q: Is it legal to cut and download YouTube clips?**\
A: Downloading videos may violate YouTube's terms of service. You should only download content that you have permission to use, or content that is in the public domain or available under a Creative Commons license. Please respect copyright laws.

***

### ☎️ Contact & Support

If you encounter any problems, have a feature request, or need help, please don't hesitate to reach out.

- **Report an Issue:** The best way to report a bug or request a feature is by creating an "Issue" on the [Github](https://github.com/nodexagent/yt-dlp-actor/issues).
- **Contact the Developer:** For other inquiries, you can contact me directly at **[X](https://x.com/nodexagent)**.

***

### 📥 Input Parameters (For API Users)

| Key | Type | Description | Default |
|---|---|---|---|
| `url` | string | **(Required)** The full https://www.youtube.com/... URL of the video. | — |
| `trim` | boolean | If `true`, downloads only the section between `startTime` and `endTime`. | `false` |
| `convertToVertical` | boolean | If `true`, crops the final video to a 9:16 aspect ratio. | `false` |
| `startTime` | string | The start time for trimming (format: HH:MM:SS). | — |
| `endTime` | string | The end time for trimming (format: HH:MM:SS). | — |
| `quality` | string | The desired video quality. `best` merges the highest quality video and audio. | `1080p` |
| `format` | string | The final video container format. | `mp4` |
| `audioOnly` | boolean | If `true`, downloads only the audio track. | `false` |
| `audioFormat` | string | The output format if `audioOnly` is true. | `mp3` |
| `cookies` | string | (Optional) Your YouTube browser cookies to bypass sign-in checks. | — |

# Actor input Schema

## `url` (type: `string`):

The full https://www.youtube.com/... URL of the video.

## `trim` (type: `boolean`):

Check this box to download only a specific part of the video.

## `convertToVertical` (type: `boolean`):

Check this to crop the video into a vertical format for Shorts/TikTok.

## `startTime` (type: `string`):

Enter the start time for the clip, e.g., 00:01:30.

## `endTime` (type: `string`):

Enter the end time for the clip, e.g., 00:02:00.

## `quality` (type: `string`):

Select the desired video quality. 'best' will pick the highest available.

## `format` (type: `string`):

Select the desired video container format.

## `audioOnly` (type: `boolean`):

Check this to download only the audio track.

## `audioFormat` (type: `string`):

Select the format for audio-only downloads.

## `cookies` (type: `string`):

1. Install the 'Get cookies.txt LOCALLY' browser extension.
2. Go to youtube.com and log in.
3. Click the extension icon and 'Copy Cookies'.
4. Paste the copied text here.
5. cookies come with an expiration date, meaning they only work for a limited time.

## `proxyHost` (type: `string`):

Optional. The hostname or IP address of your proxy server (e.g. proxy.example.com).

## `proxyPort` (type: `integer`):

Optional. The port number of your proxy server (e.g. 8080).

## `proxyUsername` (type: `string`):

Optional. Username for proxy authentication.

## `proxyPassword` (type: `string`):

Optional. Password for proxy authentication.

## Actor input object example

```json
{
  "url": "https://www.youtube.com/watch?v=aqz-KE-bpKQ",
  "trim": false,
  "convertToVertical": false,
  "quality": "1080p",
  "format": "mp4",
  "audioOnly": false,
  "audioFormat": "mp3"
}
```

# Actor output Schema

## `success` (type: `string`):

True if the download and processing were successful.

## `originalUrl` (type: `string`):

The URL of the video that was processed.

## `fileUrl` (type: `string`):

The direct URL to download the final processed file from the Apify Key-Value Store.

## `fileName` (type: `string`):

The name of the final output file.

## `size` (type: `string`):

The size of the final output file in bytes.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("nodexagent/youtube-video-cut-and-download").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("nodexagent/youtube-video-cut-and-download").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 '{}' |
apify call nodexagent/youtube-video-cut-and-download --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nodexagent/youtube-video-cut-and-download"
        }
    }
}
```

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/HZEmjF3Q3VsSGMLfw/builds/j2MEaVdoQS9IpJWcr/openapi.json
