Download the PHP package pira/ytdl without Composer

On this page you can find all versions of the php package pira/ytdl. 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 ytdl

YT-DL PHP

A simple PHP library for downloading videos from YouTube, Instagram, X, and more. Powered by Cobalt

Powered by Cobalt

Powered by Cobalt

This library relies on Cobalt’s free API.

Table of Contents

Installation

To install the pira/ytdl library, you need to use Composer. Run the following command:

Usage

After installing the library, you can start using it in your PHP project. Here's a basic example:

Methods

__construct(string $url)

Initializes the YTDL class with a URL.

setQuality(string $quality): void

Sets the video quality for downloads.

setFilenamePattern(string $pattern): void

Sets the filename pattern for downloaded files.

setVCodec(string $codec): void

Sets the video codec for downloads.

setAFormat(string $format): void

Sets the audio format for downloads.

enableAudioOnly(): void

Enables downloading only audio.

enableTTFullAudio(): void

Enables downloading the original sound from a TikTok video.

enableAudioMuted(): void

Enables muting the audio track in video downloads.

enableDubLang(): void

Enables using the Accept-Language header for YouTube video audio tracks.

enableDisableMetadata(): void

Enables disabling file metadata.

enableTwitterGif(): void

Enables converting Twitter gifs to .gif format.

enableTiktokH265(): void

Enables preferring 1080p h265 videos for TikTok.

setAcceptLanguage(string $language): void

Sets the custom Accept-Language header value for requests.

sendRequest(): array

Sends the configured request to the API and returns the response.

Response Body Variables

key type variables
status string error / redirect / stream / success / rate-limit / picker
text string various text, mostly used for errors
url string direct link to a file or a link to cobalt's live render
pickerType string various / images
picker array array of picker items
audio string direct link to a file or a link to cobalt's live render

Source: Cobalt API Documentation - Response Body Variables

Picker Item Variables

item type: object

key type variables description
type string video / photo / gif used only if pickerType is various
url string direct link to a file or a link to cobalt's live render
thumb string item thumbnail that's displayed in the picker used for video and gif types

Source: Cobalt API Documentation - Picker Item Variables

Supported Services

This list is not final and keeps expanding over time.

service video + audio only audio only video metadata rich file names
bilibili.com & bilibili.tv
dailymotion
instagram posts & reels
facebook videos
loom
ok video
pinterest
reddit
rutube
snapchat stories & spotlights
soundcloud
streamable
tiktok
tumblr
twitch clips
twitter/x
vimeo
vine archive
vk videos & clips
youtube videos, shorts & music
emoji meaning
supported
impossible/unreasonable
not supported

Source: Cobalt - Supported Services

Additional Notes or Features

service notes or features
instagram Supports reels, photos, and videos. Lets you pick what to save from multi-media posts.
facebook Supports public accessible videos content only.
pinterest Supports photos, gifs, videos and stories.
reddit Supports gifs and videos.
snapchat Supports spotlights and stories. Lets you pick what to save from stories.
rutube Supports yappy & private links.
soundcloud Supports private links.
tiktok Supports videos with or without watermark, images from slideshow without watermark, and full (original) audios.
twitter/x Lets you pick what to save from multi-media posts. May not be 100% reliable due to current management.
vimeo Audio downloads are only available for dash.
youtube Supports videos, music, and shorts. 8K, 4K, HDR, VR, and high FPS videos. Rich metadata & dubs. h264/av1/vp9 codecs.

Source: Cobalt - Additional Notes or Features per Service

If support for a service you want is missing, create an issue (or a pull request 👀) on Cobalt's GitHub repository.

License

This library is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any queries or issues, please contact:

References


All versions of ytdl with dependencies

PHP Build Version
Package Version
No informations.
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 pira/ytdl contains the following files

Loading the files please wait ....