Download the PHP package b7s/ytpilot without Composer

On this page you can find all versions of the php package b7s/ytpilot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ytpilot

# YtPilot ### 🚀 Powerful PHP backend wrapper for yt-dlp with automatic binary management [![PHP Version](https://img.shields.io/badge/PHP-8.3%2B-777BB4?logo=php&logoColor=white)](https://www.php.net/) [![PHPStan Level 6](https://img.shields.io/badge/PHPStan-Level%206-brightgreen)](https://phpstan.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [Installation](#-installation) • [Quick Start](#-quick-start) • [CLI Commands](#-cli-commands) • [Examples](#-examples) • [Other Platforms](#-other-platforms) • [API Reference](#-complete-api)

✨ Features


📦 Installation

Install Binaries

After installing the package, install the required binaries:

This command will:


🚀 Quick Start

Simple Download

Extract Audio Only

Complete Download


🛠️ CLI Commands

install - Install Binaries

Automatically installs yt-dlp and ffmpeg:

Options:

Examples:


update - Update Binaries

Updates binaries to the latest versions:

Options:

Examples:


version - Check Versions

Displays YtPilot and installed binary versions:

Output:


doctor - Complete Diagnostics

Checks YtPilot installation and configuration:

What it checks:

Example output:


📖 Examples

1. Query Available Formats


2. Use Quality Presets

🎬 Cinema (High Quality)

Perfect for large screens, prioritizes quality:

📱 Mobile (Reduced Size)

Perfect for mobile devices, prioritizes size:

🗄️ Archive (Maximum Quality)

Perfect for long-term archiving:


3. Download with Subtitles


4. Custom Format


5. Custom Output Directory


6. Handle Download Result


7. Use Custom Binaries


8. Custom Timeout


9. Using Cookies for Authenticated Content

Load cookies from file (Netscape format)

Extract cookies directly from browser

How to export cookies to Netscape format:

You can use browser extensions like:

Supported browsers: brave, chrome, chromium, edge, firefox, opera, safari, vivaldi, whale


10. Using Proxy for Downloads

Simple proxy configuration

Proxy with authentication

Using Tor for anonymous downloads

Geo-verification proxy

Use a different proxy only for geo-verification while downloading through your main connection:

Force IPv4 or IPv6

Bind to specific source address

Supported proxy protocols: http, https, socks4, socks4a, socks5, socks5h

Note: socks5h resolves DNS through the proxy server, useful for accessing .onion sites through Tor.


🌐 Other Platforms

While YouTube is the primary focus, YtPilot supports downloading from many other platforms through yt-dlp. Just pass the URL and it works automatically for most platforms.

Supported Platforms

YtPilot supports 1000+ websites including:

Important: Only video/audio content is downloaded. Text posts, images, captions, and comments are not included.

Platform Example URL Subtitles Notes
Instagram instagram.com/reel/... ❌ 🔒 Cookies recommended
Twitter/X twitter.com/user/status/... ❌ 🔓 Works without auth
TikTok tiktok.com/@user/video/... ❌ 🔓 Works without auth
Facebook facebook.com/watch?v=... ⚠️ 🔒 Cookies recommended
Vimeo vimeo.com/123456 ✅ 🔐 Password for private
Twitch twitch.tv/videos/... ✅ VODs and clips
Reddit reddit.com/r/.../comments/... ❌ 🔓 Works without auth
SoundCloud soundcloud.com/artist/track N/A Audio only
Dailymotion dailymotion.com/video/... ✅ 🔓 Works without auth
Bilibili bilibili.com/video/... ✅ 🔐 Session for premium

Basic Usage

For most platforms, just pass the URL:

Platform-Specific Configuration

Some platforms have optional configuration methods for advanced use cases:

Twitter/X API Selection

TikTok API Selection

Vimeo Password-Protected Videos

Bilibili Premium Content

Generic Authentication

For platforms requiring username/password:

Custom Extractor Arguments

For advanced use cases with any extractor:

Notes


Target Methods (Accumulative)

Define what will be downloaded. Can be combined:

Method Description
video() Download video
audio() Download audio
subtitles() Download manual subtitles
autoSubtitles() Download automatic subtitles
metadata() Download JSON metadata
thumbnail() Download thumbnail

Format Methods (Chainable)

Control how the download will be performed:

Format Selection

Method Description Example
format(string) Custom selector ->format('bestvideo+bestaudio')
best() Best quality ->best()
worst() Worst quality ->worst()
resolution(string) Specific resolution ->resolution('1080p')
fps(int) Maximum FPS ->fps(60)
videoCodec(string) Video codec ->videoCodec('av01')
audioCodec(string) Audio codec ->audioCodec('opus')
container(string) Container format ->container('mp4')
hdr() HDR content ->hdr()
sdr() SDR content ->sdr()

Smart Presets

Method Description Format
cinema() High quality for large screens 1080p+, AV1/VP9/AVC
mobile() Reduced size for mobile 720p max, AVC, 128k
archive() Maximum quality for archiving AV1/VP9 preferred

Audio Options

Method Description Example
audioOnly() Extract audio only ->audioOnly()
audioFormat(string) Audio format ->audioFormat('mp3')
audioQuality(string) Audio quality ->audioQuality('320K')

Subtitle Options

Method Description Example
subtitleLanguages(array) Subtitle languages ->subtitleLanguages(['en', 'es'])
subtitleFormat(string) Subtitle format (custom) ->subtitleFormat('srt')
subtitleAsSrt() Subtitle as SRT format ->subtitleAsSrt()
subtitleAsVtt() Subtitle as WebVTT format ->subtitleAsVtt()
subtitleAsAss() Subtitle as ASS format ->subtitleAsAss()
subtitleAsSsa() Subtitle as SSA format ->subtitleAsSsa()
subtitleAsLrc() Subtitle as LRC format ->subtitleAsLrc()
subtitleAsTtml() Subtitle as TTML format ->subtitleAsTtml()
subtitleAsJson3() Subtitle as JSON3 format ->subtitleAsJson3()

Output Options

Method Description Example
output(string) Filename template ->output('%(title)s.%(ext)s')
outputPath(string) Output directory ->outputPath('./downloads')
overwrite() Overwrite existing files ->overwrite()
skipDownload() Skip actual download ->skipDownload()
simulate() Simulate download ->simulate()

Note: If no outputPath() is specified, files are downloaded to the current working directory or the path defined in config/ytpilot.php under download_path.

Cookie Options

Method Description Example
cookies(string) Load cookies from Netscape file ->cookies('/path/to/cookies.txt')
cookiesFromBrowser(string, ?string, ?string) Extract cookies from browser ->cookiesFromBrowser('chrome')
noCookies() Explicitly disable cookies ->noCookies()

Supported browsers: brave, chrome, chromium, edge, firefox, opera, safari, vivaldi, whale

Cookie use cases:

Proxy & Network Options

Method Description Example
proxy(string) Set proxy URL (any protocol) ->proxy('http://proxy:8080')
proxyWithAuth(string, int, string, string, ProxyProtocol) Proxy with authentication ->proxyWithAuth('host', 8080, 'user', 'pass')
httpProxy(string, int) HTTP proxy ->httpProxy('proxy.example.com', 8080)
httpsProxy(string, int) HTTPS proxy ->httpsProxy('proxy.example.com', 443)
socks4Proxy(string, int) SOCKS4 proxy ->socks4Proxy('proxy.example.com', 1080)
socks5Proxy(string, int) SOCKS5 proxy ->socks5Proxy('proxy.example.com', 1080)
socks5hProxy(string, int) SOCKS5 with remote DNS resolution ->socks5hProxy('proxy.example.com', 1080)
torProxy(int) Tor proxy (default port 9050) ->torProxy() or ->torProxy(9150)
noProxy() Explicitly disable proxy ->noProxy()
geoVerificationProxy(string) Proxy for geo-verification only ->geoVerificationProxy('http://geo-proxy:8080')
sourceAddress(string) Bind to specific IP address ->sourceAddress('192.168.1.100')
forceIpv4() Force IPv4 connections ->forceIpv4()
forceIpv6() Force IPv6 connections ->forceIpv6()

Supported proxy protocols: http, https, socks4, socks4a, socks5, socks5h

Proxy use cases:

Platform Configuration

Method Description Example
configTwitter(TwitterApi) Configure Twitter API ->configTwitter(TwitterApi::Syndication)
configTikTok(TikTokApi) Configure TikTok API ->configTikTok(TikTokApi::Web)
configVimeo(string) Vimeo password-protected ->configVimeo('password')
configBilibili(string) Bilibili session data ->configBilibili('sess_data')
withCredentials(string, string) Set username/password ->withCredentials('user', 'pass')
extractorArgs(string, array) Custom extractor arguments ->extractorArgs('youtube', [...])

Binary Management

Method Description Example
ensureInstalled() Ensure binaries installed (auto-called) ->ensureInstalled()
withYtDlpPath(string) Custom yt-dlp path ->withYtDlpPath('/usr/bin/yt-dlp')
withFfmpegPath(string) Custom ffmpeg path ->withFfmpegPath('/usr/bin/ffmpeg')
withFfprobePath(string) Custom ffprobe path ->withFfprobePath('/usr/bin/ffprobe')
timeout(int) Timeout in seconds ->timeout(300)

Note: ensureInstalled() is automatically called when using YtPilot::make(), so you don't need to call it manually unless you want to force a re-check.


Query Methods (Non-Chainable)

Execute immediately and return data:

Method Return Description
getAvailableFormats() FormatItem[] All available formats
getAvailableResolutions() string[] Available resolutions
getAvailableFrameRates() int[] Available FPS
getAvailableVideoCodecs() string[] Video codecs
getAvailableAudioCodecs() string[] Audio codecs
getAvailableContainers() string[] Container formats
getAvailableDynamicRanges() string[] Dynamic ranges (HDR/SDR)
getAvailableSubtitles() SubtitleList Available subtitles

Execution Method

Method Return Description
download() DownloadResult Execute the download


📊 Progress Callbacks

Track download and conversion progress in real-time:

Download Progress

Conversion Progress

Callback Parameters:


🔄 Video & Audio Conversion

Convert media files between formats using the project's ffmpeg binary. All conversion methods now support smart defaults for seamless workflow integration.

Video Conversion Methods

Method Description
convertVideoTo(?string $input, ?string $output, string $format, bool $deleteOriginal) Convert to custom format
convertVideoToMp4(?string $input, ?string $output, bool $deleteOriginal) Convert to MP4 (H.264/AAC)
convertVideoToMkv(?string $input, ?string $output, bool $deleteOriginal) Convert to MKV (copy)
convertVideoToWebm(?string $input, ?string $output, bool $deleteOriginal) Convert to WebM (VP9/Opus)
convertVideoToAvi(?string $input, ?string $output, bool $deleteOriginal) Convert to AVI (H.264/MP3)

Audio Conversion Methods

Method Description
convertAudioTo(?string $input, ?string $output, string $format, bool $deleteOriginal) Convert to custom format
convertAudioToMp3(?string $input, ?string $output, bool $deleteOriginal) Convert to MP3 (320kbps)
convertAudioToM4a(?string $input, ?string $output, bool $deleteOriginal) Convert to M4A (AAC 192k)
convertAudioToOpus(?string $input, ?string $output, bool $deleteOriginal) Convert to Opus (128kbps)
convertAudioToOgg(?string $input, ?string $output, bool $deleteOriginal) Convert to Ogg Vorbis
convertAudioToWav(?string $input, ?string $output, bool $deleteOriginal) Convert to WAV (PCM)
convertAudioToFlac(?string $input, ?string $output, bool $deleteOriginal) Convert to FLAC (lossless)

Smart Conversion Features

All parameters are optional with intelligent defaults:

Conversion Examples

1. Download and convert (simplest way):

2. Download and convert (keep original):

3. Download with custom output path:

4. Convert existing files (explicit input):

5. Custom format with progress tracking:

6. Batch conversion workflow:


⚙️ Configuration

Create a config/ytpilot.php file:

Download Location

By default, files are downloaded to the current working directory (where your PHP script is executed).

You can change this in three ways:

  1. Set in configuration file:

  2. Set per download:

  3. Set custom filename template:

🔍 Binary Resolution Priority

For all binaries (yt-dlp, ffmpeg, ffprobe), the resolution order is:

  1. ✅ Runtime override via fluent API (withYtDlpPath(), etc.)
  2. ✅ Path defined in configuration file
  3. ✅ System PATH (if prefer_global = true)
  4. ✅ Automatic download to local directory
  5. ❌ Exception if all options fail

📋 Requirements


🤝 Contributing

Contributions are welcome! Feel free to:


📄 License

This project is licensed under the MIT License.


🙏 Credits


**Made by [me](https://github.com/b7s) with ❤️ for the PHP community** [⬆ Back to top](#ytpilot)

All versions of ytpilot with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
symfony/process Version ^7.0|^8.0
symfony/console Version ^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package b7s/ytpilot contains the following files

Loading the files please wait ...