├── .dockerignore ├── .env ├── .github ├── FUNDING.yml └── workflows │ ├── docker-image.yml │ ├── php.yml │ └── stale.yml ├── .gitignore ├── Dockerfile ├── README.md ├── composer.json ├── composer.lock ├── convert.php ├── docker-compose.yml ├── docker-entrypoint.sh ├── download └── README.md ├── includes ├── nav.php └── styles.php ├── index.php ├── info.php ├── logs ├── README.md └── index.php ├── script.js ├── search.php └── src └── Config.php /.dockerignore: -------------------------------------------------------------------------------- 1 | docker-compose.* 2 | Dockerfile 3 | .github 4 | *cache* 5 | download/ 6 | .env 7 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | API_KEY=YOUR_API_KEY 2 | HOST_PORT=80 -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: MichaelBelgium 4 | custom: https://www.paypal.com/donate/?hosted_button_id=ZJSKX2ASR3ARL -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Build the Docker image 18 | run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) 19 | -------------------------------------------------------------------------------- /.github/workflows/php.yml: -------------------------------------------------------------------------------- 1 | name: PHP Composer 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Validate composer.json and composer.lock 18 | run: composer validate --strict 19 | 20 | - name: Cache Composer packages 21 | id: composer-cache 22 | uses: actions/cache@v2 23 | with: 24 | path: vendor 25 | key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} 26 | restore-keys: | 27 | ${{ runner.os }}-php- 28 | 29 | - name: Install dependencies 30 | run: composer install --prefer-dist --no-progress 31 | 32 | - name: Run PHPstan 33 | run: vendor/bin/phpstan analyse --error-format=github src/ logs/index.php index.php convert.php search.php 34 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. 2 | # 3 | # You can adjust the behavior by modifying this file. 4 | # For more information, see: 5 | # https://github.com/actions/stale 6 | name: Mark stale issues 7 | 8 | on: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | 12 | jobs: 13 | stale: 14 | 15 | runs-on: ubuntu-latest 16 | permissions: 17 | issues: write 18 | pull-requests: none 19 | 20 | steps: 21 | - uses: actions/stale@v5 22 | with: 23 | days-before-issue-stale: 30 24 | days-before-issue-close: 7 25 | repo-token: ${{ secrets.GITHUB_TOKEN }} 26 | stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." 27 | close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." 28 | exempt-all-assignees: true 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .idea/ 3 | vendor/ 4 | download/*.mp3 5 | download/*.mp4 6 | .env -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-apache 2 | 3 | #Get latest updates and install software needed 4 | RUN apt-get update -qq \ 5 | && apt-get upgrade -qq \ 6 | && apt-get install -qq ffmpeg python3 wget curl net-tools unzip python3-dev python3-pip \ 7 | && rm -rf /var/lib/apt/lists/* 8 | 9 | # Upgrade pip, and install yt-dlp. 10 | RUN curl -L -o yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp && chmod +x yt-dlp && mv yt-dlp /usr/bin/ 11 | 12 | #Get latest version of composer 13 | RUN curl -sS https://getcomposer.org/installer | php \ 14 | && mv composer.phar /usr/local/bin/composer 15 | 16 | #install the project and remove unnecessary files 17 | RUN cd /var/www/html && rm -rf * 18 | RUN /usr/local/bin/composer create-project michaelbelgium/youtube-to-mp3 . &&\ 19 | rm -rf docker-compose.yml Docker* .gitignore .dockerignore .github/ README.md 20 | 21 | # Ensure permissions won't be a problem 22 | RUN mkdir /var/www/.cache/ && chmod 777 /var/www/ -R 23 | 24 | # set new entrypoint and restore default command (apache). Entrypoint ensures 25 | # the API key is written to src/Config.php on start, if not already set. 26 | COPY docker-entrypoint.sh . 27 | RUN chmod +x docker-entrypoint.sh 28 | ENTRYPOINT ["./docker-entrypoint.sh"] 29 | CMD ["apache2-foreground"] 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Youtube-API 2 | 3 | With these files you are able to create your own Youtube API with ability to search also. 4 | 5 | [Laravel version of this package](https://github.com/MichaelBelgium/Laravel-Youtube-API) 6 | 7 | # Software requirements 8 | 9 | * [youtube-dl](https://rg3.github.io/youtube-dl/) 10 | * [ffmpeg](https://www.ffmpeg.org/) (+ [libmp3lame](http://lame.sourceforge.net/)) 11 | 12 | # General installation 13 | 14 | First we install the dependencies on the server, then website. 15 | 16 | ## VPS 17 | 18 | * Install ffmpeg (+ libmp3lame - see wiki for tutorial) 19 | * [install youtube-dl](http://ytdl-org.github.io/youtube-dl/download.html) or [yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/latest) 20 | 21 | ## Website 22 | 23 | * Get a google developer api key 24 | * Go to your webserver files to run composer into 25 | * Run `composer create-project michaelbelgium/youtube-to-mp3 [directoryname]` - where `directoryname` is .. a directory where people can access the API from. 26 | 27 | ## Configuration 28 | 29 | Setting options are available in [`src/Config.php`](https://github.com/MichaelBelgium/Youtube-API/blob/master/src/Config.php) 30 | 31 | ## Documentation 32 | 33 | Check out the [wiki](https://github.com/MichaelBelgium/Youtube-API/wiki) for more docs. 34 | 35 | ## Docker 36 | You can deploy this API using `docker-compose.yml` and the `Dockerfile` to build from. Please add your google API Key to the `.env` file. 37 | It will expose port 80 from the container, out to port 80 on the host. This can also be changed in `.env` under HOST_PORT. The docker image uses yt-dlp. 38 | 39 | ### How to run with docker-compose 40 | Put docker-compose.yml and Dockerfile together in a new, empty folder. Create `.env`, and set the values listed in the example `.env` in this repo. 41 | To run, use the following command: 42 | ```sh 43 | docker-compose up -d 44 | ``` 45 | 46 | To stop: 47 | ```sh 48 | docker-compose down 49 | # Or use this to remove the attached volume, to clear up space- 50 | docker-compose down -v 51 | ``` 52 | 53 | ### Changing API Key? 54 | If you are changing your API key, the change will not reflect until you have removed the attached docker volume and restarted the container. Another option is to enter the container and go to `src/Config.php` and manually change it, or mount the config in as a separate volume. -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "michaelbelgium/youtube-to-mp3", 3 | "description": "Convert and search youtube video's via your own API", 4 | "type": "project", 5 | "require": { 6 | "php": ">=8.2", 7 | "norkunas/youtube-dl-php": "^2.0", 8 | "google/apiclient": "^2.0", 9 | "ext-json": "*" 10 | }, 11 | "license": "MIT", 12 | "authors": [ 13 | { 14 | "name": "Michael V.", 15 | "email": "michael@michaelbelgium.me" 16 | } 17 | ], 18 | "autoload": { 19 | "psr-4": { 20 | "MichaelBelgium\\YoutubeConverter\\": "src/" 21 | } 22 | }, 23 | "require-dev": { 24 | "phpstan/phpstan": "^1.3" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "891368e739d41e05a88ed4c221b5e1c7", 8 | "packages": [ 9 | { 10 | "name": "firebase/php-jwt", 11 | "version": "v6.11.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/firebase/php-jwt.git", 15 | "reference": "8f718f4dfc9c5d5f0c994cdfd103921b43592712" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/firebase/php-jwt/zipball/8f718f4dfc9c5d5f0c994cdfd103921b43592712", 20 | "reference": "8f718f4dfc9c5d5f0c994cdfd103921b43592712", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": "^8.0" 25 | }, 26 | "require-dev": { 27 | "guzzlehttp/guzzle": "^7.4", 28 | "phpspec/prophecy-phpunit": "^2.0", 29 | "phpunit/phpunit": "^9.5", 30 | "psr/cache": "^2.0||^3.0", 31 | "psr/http-client": "^1.0", 32 | "psr/http-factory": "^1.0" 33 | }, 34 | "suggest": { 35 | "ext-sodium": "Support EdDSA (Ed25519) signatures", 36 | "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" 37 | }, 38 | "type": "library", 39 | "autoload": { 40 | "psr-4": { 41 | "Firebase\\JWT\\": "src" 42 | } 43 | }, 44 | "notification-url": "https://packagist.org/downloads/", 45 | "license": [ 46 | "BSD-3-Clause" 47 | ], 48 | "authors": [ 49 | { 50 | "name": "Neuman Vong", 51 | "email": "neuman+pear@twilio.com", 52 | "role": "Developer" 53 | }, 54 | { 55 | "name": "Anant Narayanan", 56 | "email": "anant@php.net", 57 | "role": "Developer" 58 | } 59 | ], 60 | "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", 61 | "homepage": "https://github.com/firebase/php-jwt", 62 | "keywords": [ 63 | "jwt", 64 | "php" 65 | ], 66 | "support": { 67 | "issues": "https://github.com/firebase/php-jwt/issues", 68 | "source": "https://github.com/firebase/php-jwt/tree/v6.11.0" 69 | }, 70 | "time": "2025-01-23T05:11:06+00:00" 71 | }, 72 | { 73 | "name": "google/apiclient", 74 | "version": "v2.18.2", 75 | "source": { 76 | "type": "git", 77 | "url": "https://github.com/googleapis/google-api-php-client.git", 78 | "reference": "d8d201ba8a189a3cd7fb34e4da569f2ed440eee7" 79 | }, 80 | "dist": { 81 | "type": "zip", 82 | "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/d8d201ba8a189a3cd7fb34e4da569f2ed440eee7", 83 | "reference": "d8d201ba8a189a3cd7fb34e4da569f2ed440eee7", 84 | "shasum": "" 85 | }, 86 | "require": { 87 | "firebase/php-jwt": "^6.0", 88 | "google/apiclient-services": "~0.350", 89 | "google/auth": "^1.37", 90 | "guzzlehttp/guzzle": "^7.4.5", 91 | "guzzlehttp/psr7": "^2.6", 92 | "monolog/monolog": "^2.9||^3.0", 93 | "php": "^8.0", 94 | "phpseclib/phpseclib": "^3.0.36" 95 | }, 96 | "require-dev": { 97 | "cache/filesystem-adapter": "^1.1", 98 | "composer/composer": "^1.10.23", 99 | "phpcompatibility/php-compatibility": "^9.2", 100 | "phpspec/prophecy-phpunit": "^2.1", 101 | "phpunit/phpunit": "^9.6", 102 | "squizlabs/php_codesniffer": "^3.8", 103 | "symfony/css-selector": "~2.1", 104 | "symfony/dom-crawler": "~2.1" 105 | }, 106 | "suggest": { 107 | "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" 108 | }, 109 | "type": "library", 110 | "extra": { 111 | "branch-alias": { 112 | "dev-main": "2.x-dev" 113 | } 114 | }, 115 | "autoload": { 116 | "files": [ 117 | "src/aliases.php" 118 | ], 119 | "psr-4": { 120 | "Google\\": "src/" 121 | }, 122 | "classmap": [ 123 | "src/aliases.php" 124 | ] 125 | }, 126 | "notification-url": "https://packagist.org/downloads/", 127 | "license": [ 128 | "Apache-2.0" 129 | ], 130 | "description": "Client library for Google APIs", 131 | "homepage": "http://developers.google.com/api-client-library/php", 132 | "keywords": [ 133 | "google" 134 | ], 135 | "support": { 136 | "issues": "https://github.com/googleapis/google-api-php-client/issues", 137 | "source": "https://github.com/googleapis/google-api-php-client/tree/v2.18.2" 138 | }, 139 | "time": "2024-12-16T22:52:40+00:00" 140 | }, 141 | { 142 | "name": "google/apiclient-services", 143 | "version": "v0.392.0", 144 | "source": { 145 | "type": "git", 146 | "url": "https://github.com/googleapis/google-api-php-client-services.git", 147 | "reference": "a74c2790865bd1f06c0a49460ef1c0edb0be0e7e" 148 | }, 149 | "dist": { 150 | "type": "zip", 151 | "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/a74c2790865bd1f06c0a49460ef1c0edb0be0e7e", 152 | "reference": "a74c2790865bd1f06c0a49460ef1c0edb0be0e7e", 153 | "shasum": "" 154 | }, 155 | "require": { 156 | "php": "^8.0" 157 | }, 158 | "require-dev": { 159 | "phpunit/phpunit": "^9.6" 160 | }, 161 | "type": "library", 162 | "autoload": { 163 | "files": [ 164 | "autoload.php" 165 | ], 166 | "psr-4": { 167 | "Google\\Service\\": "src" 168 | } 169 | }, 170 | "notification-url": "https://packagist.org/downloads/", 171 | "license": [ 172 | "Apache-2.0" 173 | ], 174 | "description": "Client library for Google APIs", 175 | "homepage": "http://developers.google.com/api-client-library/php", 176 | "keywords": [ 177 | "google" 178 | ], 179 | "support": { 180 | "issues": "https://github.com/googleapis/google-api-php-client-services/issues", 181 | "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.392.0" 182 | }, 183 | "time": "2025-01-27T01:10:20+00:00" 184 | }, 185 | { 186 | "name": "google/auth", 187 | "version": "v1.45.3", 188 | "source": { 189 | "type": "git", 190 | "url": "https://github.com/googleapis/google-auth-library-php.git", 191 | "reference": "000d9439f430c6e56cba105c5ab750f5f7d69ea8" 192 | }, 193 | "dist": { 194 | "type": "zip", 195 | "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/000d9439f430c6e56cba105c5ab750f5f7d69ea8", 196 | "reference": "000d9439f430c6e56cba105c5ab750f5f7d69ea8", 197 | "shasum": "" 198 | }, 199 | "require": { 200 | "firebase/php-jwt": "^6.0", 201 | "guzzlehttp/guzzle": "^7.4.5", 202 | "guzzlehttp/psr7": "^2.4.5", 203 | "php": "^8.0", 204 | "psr/cache": "^2.0||^3.0", 205 | "psr/http-message": "^1.1||^2.0", 206 | "psr/log": "^3.0" 207 | }, 208 | "require-dev": { 209 | "guzzlehttp/promises": "^2.0", 210 | "kelvinmo/simplejwt": "0.7.1", 211 | "phpseclib/phpseclib": "^3.0.35", 212 | "phpspec/prophecy-phpunit": "^2.1", 213 | "phpunit/phpunit": "^9.6", 214 | "sebastian/comparator": ">=1.2.3", 215 | "squizlabs/php_codesniffer": "^3.5", 216 | "symfony/process": "^6.0||^7.0", 217 | "webmozart/assert": "^1.11" 218 | }, 219 | "suggest": { 220 | "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." 221 | }, 222 | "type": "library", 223 | "autoload": { 224 | "psr-4": { 225 | "Google\\Auth\\": "src" 226 | } 227 | }, 228 | "notification-url": "https://packagist.org/downloads/", 229 | "license": [ 230 | "Apache-2.0" 231 | ], 232 | "description": "Google Auth Library for PHP", 233 | "homepage": "https://github.com/google/google-auth-library-php", 234 | "keywords": [ 235 | "Authentication", 236 | "google", 237 | "oauth2" 238 | ], 239 | "support": { 240 | "docs": "https://googleapis.github.io/google-auth-library-php/main/", 241 | "issues": "https://github.com/googleapis/google-auth-library-php/issues", 242 | "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.45.3" 243 | }, 244 | "time": "2025-01-29T18:17:08+00:00" 245 | }, 246 | { 247 | "name": "guzzlehttp/guzzle", 248 | "version": "7.9.2", 249 | "source": { 250 | "type": "git", 251 | "url": "https://github.com/guzzle/guzzle.git", 252 | "reference": "d281ed313b989f213357e3be1a179f02196ac99b" 253 | }, 254 | "dist": { 255 | "type": "zip", 256 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", 257 | "reference": "d281ed313b989f213357e3be1a179f02196ac99b", 258 | "shasum": "" 259 | }, 260 | "require": { 261 | "ext-json": "*", 262 | "guzzlehttp/promises": "^1.5.3 || ^2.0.3", 263 | "guzzlehttp/psr7": "^2.7.0", 264 | "php": "^7.2.5 || ^8.0", 265 | "psr/http-client": "^1.0", 266 | "symfony/deprecation-contracts": "^2.2 || ^3.0" 267 | }, 268 | "provide": { 269 | "psr/http-client-implementation": "1.0" 270 | }, 271 | "require-dev": { 272 | "bamarni/composer-bin-plugin": "^1.8.2", 273 | "ext-curl": "*", 274 | "guzzle/client-integration-tests": "3.0.2", 275 | "php-http/message-factory": "^1.1", 276 | "phpunit/phpunit": "^8.5.39 || ^9.6.20", 277 | "psr/log": "^1.1 || ^2.0 || ^3.0" 278 | }, 279 | "suggest": { 280 | "ext-curl": "Required for CURL handler support", 281 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 282 | "psr/log": "Required for using the Log middleware" 283 | }, 284 | "type": "library", 285 | "extra": { 286 | "bamarni-bin": { 287 | "bin-links": true, 288 | "forward-command": false 289 | } 290 | }, 291 | "autoload": { 292 | "files": [ 293 | "src/functions_include.php" 294 | ], 295 | "psr-4": { 296 | "GuzzleHttp\\": "src/" 297 | } 298 | }, 299 | "notification-url": "https://packagist.org/downloads/", 300 | "license": [ 301 | "MIT" 302 | ], 303 | "authors": [ 304 | { 305 | "name": "Graham Campbell", 306 | "email": "hello@gjcampbell.co.uk", 307 | "homepage": "https://github.com/GrahamCampbell" 308 | }, 309 | { 310 | "name": "Michael Dowling", 311 | "email": "mtdowling@gmail.com", 312 | "homepage": "https://github.com/mtdowling" 313 | }, 314 | { 315 | "name": "Jeremy Lindblom", 316 | "email": "jeremeamia@gmail.com", 317 | "homepage": "https://github.com/jeremeamia" 318 | }, 319 | { 320 | "name": "George Mponos", 321 | "email": "gmponos@gmail.com", 322 | "homepage": "https://github.com/gmponos" 323 | }, 324 | { 325 | "name": "Tobias Nyholm", 326 | "email": "tobias.nyholm@gmail.com", 327 | "homepage": "https://github.com/Nyholm" 328 | }, 329 | { 330 | "name": "Márk Sági-Kazár", 331 | "email": "mark.sagikazar@gmail.com", 332 | "homepage": "https://github.com/sagikazarmark" 333 | }, 334 | { 335 | "name": "Tobias Schultze", 336 | "email": "webmaster@tubo-world.de", 337 | "homepage": "https://github.com/Tobion" 338 | } 339 | ], 340 | "description": "Guzzle is a PHP HTTP client library", 341 | "keywords": [ 342 | "client", 343 | "curl", 344 | "framework", 345 | "http", 346 | "http client", 347 | "psr-18", 348 | "psr-7", 349 | "rest", 350 | "web service" 351 | ], 352 | "support": { 353 | "issues": "https://github.com/guzzle/guzzle/issues", 354 | "source": "https://github.com/guzzle/guzzle/tree/7.9.2" 355 | }, 356 | "funding": [ 357 | { 358 | "url": "https://github.com/GrahamCampbell", 359 | "type": "github" 360 | }, 361 | { 362 | "url": "https://github.com/Nyholm", 363 | "type": "github" 364 | }, 365 | { 366 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", 367 | "type": "tidelift" 368 | } 369 | ], 370 | "time": "2024-07-24T11:22:20+00:00" 371 | }, 372 | { 373 | "name": "guzzlehttp/promises", 374 | "version": "2.0.4", 375 | "source": { 376 | "type": "git", 377 | "url": "https://github.com/guzzle/promises.git", 378 | "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" 379 | }, 380 | "dist": { 381 | "type": "zip", 382 | "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", 383 | "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", 384 | "shasum": "" 385 | }, 386 | "require": { 387 | "php": "^7.2.5 || ^8.0" 388 | }, 389 | "require-dev": { 390 | "bamarni/composer-bin-plugin": "^1.8.2", 391 | "phpunit/phpunit": "^8.5.39 || ^9.6.20" 392 | }, 393 | "type": "library", 394 | "extra": { 395 | "bamarni-bin": { 396 | "bin-links": true, 397 | "forward-command": false 398 | } 399 | }, 400 | "autoload": { 401 | "psr-4": { 402 | "GuzzleHttp\\Promise\\": "src/" 403 | } 404 | }, 405 | "notification-url": "https://packagist.org/downloads/", 406 | "license": [ 407 | "MIT" 408 | ], 409 | "authors": [ 410 | { 411 | "name": "Graham Campbell", 412 | "email": "hello@gjcampbell.co.uk", 413 | "homepage": "https://github.com/GrahamCampbell" 414 | }, 415 | { 416 | "name": "Michael Dowling", 417 | "email": "mtdowling@gmail.com", 418 | "homepage": "https://github.com/mtdowling" 419 | }, 420 | { 421 | "name": "Tobias Nyholm", 422 | "email": "tobias.nyholm@gmail.com", 423 | "homepage": "https://github.com/Nyholm" 424 | }, 425 | { 426 | "name": "Tobias Schultze", 427 | "email": "webmaster@tubo-world.de", 428 | "homepage": "https://github.com/Tobion" 429 | } 430 | ], 431 | "description": "Guzzle promises library", 432 | "keywords": [ 433 | "promise" 434 | ], 435 | "support": { 436 | "issues": "https://github.com/guzzle/promises/issues", 437 | "source": "https://github.com/guzzle/promises/tree/2.0.4" 438 | }, 439 | "funding": [ 440 | { 441 | "url": "https://github.com/GrahamCampbell", 442 | "type": "github" 443 | }, 444 | { 445 | "url": "https://github.com/Nyholm", 446 | "type": "github" 447 | }, 448 | { 449 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", 450 | "type": "tidelift" 451 | } 452 | ], 453 | "time": "2024-10-17T10:06:22+00:00" 454 | }, 455 | { 456 | "name": "guzzlehttp/psr7", 457 | "version": "2.7.0", 458 | "source": { 459 | "type": "git", 460 | "url": "https://github.com/guzzle/psr7.git", 461 | "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" 462 | }, 463 | "dist": { 464 | "type": "zip", 465 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", 466 | "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", 467 | "shasum": "" 468 | }, 469 | "require": { 470 | "php": "^7.2.5 || ^8.0", 471 | "psr/http-factory": "^1.0", 472 | "psr/http-message": "^1.1 || ^2.0", 473 | "ralouphie/getallheaders": "^3.0" 474 | }, 475 | "provide": { 476 | "psr/http-factory-implementation": "1.0", 477 | "psr/http-message-implementation": "1.0" 478 | }, 479 | "require-dev": { 480 | "bamarni/composer-bin-plugin": "^1.8.2", 481 | "http-interop/http-factory-tests": "0.9.0", 482 | "phpunit/phpunit": "^8.5.39 || ^9.6.20" 483 | }, 484 | "suggest": { 485 | "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 486 | }, 487 | "type": "library", 488 | "extra": { 489 | "bamarni-bin": { 490 | "bin-links": true, 491 | "forward-command": false 492 | } 493 | }, 494 | "autoload": { 495 | "psr-4": { 496 | "GuzzleHttp\\Psr7\\": "src/" 497 | } 498 | }, 499 | "notification-url": "https://packagist.org/downloads/", 500 | "license": [ 501 | "MIT" 502 | ], 503 | "authors": [ 504 | { 505 | "name": "Graham Campbell", 506 | "email": "hello@gjcampbell.co.uk", 507 | "homepage": "https://github.com/GrahamCampbell" 508 | }, 509 | { 510 | "name": "Michael Dowling", 511 | "email": "mtdowling@gmail.com", 512 | "homepage": "https://github.com/mtdowling" 513 | }, 514 | { 515 | "name": "George Mponos", 516 | "email": "gmponos@gmail.com", 517 | "homepage": "https://github.com/gmponos" 518 | }, 519 | { 520 | "name": "Tobias Nyholm", 521 | "email": "tobias.nyholm@gmail.com", 522 | "homepage": "https://github.com/Nyholm" 523 | }, 524 | { 525 | "name": "Márk Sági-Kazár", 526 | "email": "mark.sagikazar@gmail.com", 527 | "homepage": "https://github.com/sagikazarmark" 528 | }, 529 | { 530 | "name": "Tobias Schultze", 531 | "email": "webmaster@tubo-world.de", 532 | "homepage": "https://github.com/Tobion" 533 | }, 534 | { 535 | "name": "Márk Sági-Kazár", 536 | "email": "mark.sagikazar@gmail.com", 537 | "homepage": "https://sagikazarmark.hu" 538 | } 539 | ], 540 | "description": "PSR-7 message implementation that also provides common utility methods", 541 | "keywords": [ 542 | "http", 543 | "message", 544 | "psr-7", 545 | "request", 546 | "response", 547 | "stream", 548 | "uri", 549 | "url" 550 | ], 551 | "support": { 552 | "issues": "https://github.com/guzzle/psr7/issues", 553 | "source": "https://github.com/guzzle/psr7/tree/2.7.0" 554 | }, 555 | "funding": [ 556 | { 557 | "url": "https://github.com/GrahamCampbell", 558 | "type": "github" 559 | }, 560 | { 561 | "url": "https://github.com/Nyholm", 562 | "type": "github" 563 | }, 564 | { 565 | "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", 566 | "type": "tidelift" 567 | } 568 | ], 569 | "time": "2024-07-18T11:15:46+00:00" 570 | }, 571 | { 572 | "name": "monolog/monolog", 573 | "version": "3.8.1", 574 | "source": { 575 | "type": "git", 576 | "url": "https://github.com/Seldaek/monolog.git", 577 | "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4" 578 | }, 579 | "dist": { 580 | "type": "zip", 581 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/aef6ee73a77a66e404dd6540934a9ef1b3c855b4", 582 | "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4", 583 | "shasum": "" 584 | }, 585 | "require": { 586 | "php": ">=8.1", 587 | "psr/log": "^2.0 || ^3.0" 588 | }, 589 | "provide": { 590 | "psr/log-implementation": "3.0.0" 591 | }, 592 | "require-dev": { 593 | "aws/aws-sdk-php": "^3.0", 594 | "doctrine/couchdb": "~1.0@dev", 595 | "elasticsearch/elasticsearch": "^7 || ^8", 596 | "ext-json": "*", 597 | "graylog2/gelf-php": "^1.4.2 || ^2.0", 598 | "guzzlehttp/guzzle": "^7.4.5", 599 | "guzzlehttp/psr7": "^2.2", 600 | "mongodb/mongodb": "^1.8", 601 | "php-amqplib/php-amqplib": "~2.4 || ^3", 602 | "php-console/php-console": "^3.1.8", 603 | "phpstan/phpstan": "^2", 604 | "phpstan/phpstan-deprecation-rules": "^2", 605 | "phpstan/phpstan-strict-rules": "^2", 606 | "phpunit/phpunit": "^10.5.17 || ^11.0.7", 607 | "predis/predis": "^1.1 || ^2", 608 | "rollbar/rollbar": "^4.0", 609 | "ruflin/elastica": "^7 || ^8", 610 | "symfony/mailer": "^5.4 || ^6", 611 | "symfony/mime": "^5.4 || ^6" 612 | }, 613 | "suggest": { 614 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 615 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 616 | "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", 617 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 618 | "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", 619 | "ext-mbstring": "Allow to work properly with unicode symbols", 620 | "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", 621 | "ext-openssl": "Required to send log messages using SSL", 622 | "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", 623 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 624 | "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", 625 | "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", 626 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 627 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server" 628 | }, 629 | "type": "library", 630 | "extra": { 631 | "branch-alias": { 632 | "dev-main": "3.x-dev" 633 | } 634 | }, 635 | "autoload": { 636 | "psr-4": { 637 | "Monolog\\": "src/Monolog" 638 | } 639 | }, 640 | "notification-url": "https://packagist.org/downloads/", 641 | "license": [ 642 | "MIT" 643 | ], 644 | "authors": [ 645 | { 646 | "name": "Jordi Boggiano", 647 | "email": "j.boggiano@seld.be", 648 | "homepage": "https://seld.be" 649 | } 650 | ], 651 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 652 | "homepage": "https://github.com/Seldaek/monolog", 653 | "keywords": [ 654 | "log", 655 | "logging", 656 | "psr-3" 657 | ], 658 | "support": { 659 | "issues": "https://github.com/Seldaek/monolog/issues", 660 | "source": "https://github.com/Seldaek/monolog/tree/3.8.1" 661 | }, 662 | "funding": [ 663 | { 664 | "url": "https://github.com/Seldaek", 665 | "type": "github" 666 | }, 667 | { 668 | "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", 669 | "type": "tidelift" 670 | } 671 | ], 672 | "time": "2024-12-05T17:15:07+00:00" 673 | }, 674 | { 675 | "name": "norkunas/youtube-dl-php", 676 | "version": "v2.9.0", 677 | "source": { 678 | "type": "git", 679 | "url": "https://github.com/norkunas/youtube-dl-php.git", 680 | "reference": "3484eb38c4ef9c97b3b1ea00f6952179702ed2d1" 681 | }, 682 | "dist": { 683 | "type": "zip", 684 | "url": "https://api.github.com/repos/norkunas/youtube-dl-php/zipball/3484eb38c4ef9c97b3b1ea00f6952179702ed2d1", 685 | "reference": "3484eb38c4ef9c97b3b1ea00f6952179702ed2d1", 686 | "shasum": "" 687 | }, 688 | "require": { 689 | "ext-json": "*", 690 | "php": ">=7.4.0", 691 | "symfony/filesystem": "^5.1|^6.0|^7.0", 692 | "symfony/polyfill-php80": "^1.28", 693 | "symfony/process": "^5.1|^6.0|^7.0" 694 | }, 695 | "require-dev": { 696 | "mikey179/vfsstream": "^1.6.11", 697 | "php-cs-fixer/shim": "^3.60", 698 | "phpstan/phpstan": "^1.11.8", 699 | "phpstan/phpstan-phpunit": "^1.4.0", 700 | "phpstan/phpstan-strict-rules": "^1.6.0", 701 | "symfony/phpunit-bridge": "^6.4.10" 702 | }, 703 | "type": "library", 704 | "extra": { 705 | "branch-alias": { 706 | "dev-master": "2.0-dev" 707 | } 708 | }, 709 | "autoload": { 710 | "psr-4": { 711 | "YoutubeDl\\": "src/" 712 | } 713 | }, 714 | "notification-url": "https://packagist.org/downloads/", 715 | "license": [ 716 | "MIT" 717 | ], 718 | "authors": [ 719 | { 720 | "name": "Tomas Norkūnas", 721 | "email": "norkunas.tom@gmail.com" 722 | } 723 | ], 724 | "description": "youtube-dl / yt-dlp wrapper for php", 725 | "keywords": [ 726 | "youtube", 727 | "youtube-dl", 728 | "yt-dlp" 729 | ], 730 | "support": { 731 | "issues": "https://github.com/norkunas/youtube-dl-php/issues", 732 | "source": "https://github.com/norkunas/youtube-dl-php/tree/v2.9.0" 733 | }, 734 | "time": "2024-12-09T04:50:15+00:00" 735 | }, 736 | { 737 | "name": "paragonie/constant_time_encoding", 738 | "version": "v3.0.0", 739 | "source": { 740 | "type": "git", 741 | "url": "https://github.com/paragonie/constant_time_encoding.git", 742 | "reference": "df1e7fde177501eee2037dd159cf04f5f301a512" 743 | }, 744 | "dist": { 745 | "type": "zip", 746 | "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/df1e7fde177501eee2037dd159cf04f5f301a512", 747 | "reference": "df1e7fde177501eee2037dd159cf04f5f301a512", 748 | "shasum": "" 749 | }, 750 | "require": { 751 | "php": "^8" 752 | }, 753 | "require-dev": { 754 | "phpunit/phpunit": "^9", 755 | "vimeo/psalm": "^4|^5" 756 | }, 757 | "type": "library", 758 | "autoload": { 759 | "psr-4": { 760 | "ParagonIE\\ConstantTime\\": "src/" 761 | } 762 | }, 763 | "notification-url": "https://packagist.org/downloads/", 764 | "license": [ 765 | "MIT" 766 | ], 767 | "authors": [ 768 | { 769 | "name": "Paragon Initiative Enterprises", 770 | "email": "security@paragonie.com", 771 | "homepage": "https://paragonie.com", 772 | "role": "Maintainer" 773 | }, 774 | { 775 | "name": "Steve 'Sc00bz' Thomas", 776 | "email": "steve@tobtu.com", 777 | "homepage": "https://www.tobtu.com", 778 | "role": "Original Developer" 779 | } 780 | ], 781 | "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", 782 | "keywords": [ 783 | "base16", 784 | "base32", 785 | "base32_decode", 786 | "base32_encode", 787 | "base64", 788 | "base64_decode", 789 | "base64_encode", 790 | "bin2hex", 791 | "encoding", 792 | "hex", 793 | "hex2bin", 794 | "rfc4648" 795 | ], 796 | "support": { 797 | "email": "info@paragonie.com", 798 | "issues": "https://github.com/paragonie/constant_time_encoding/issues", 799 | "source": "https://github.com/paragonie/constant_time_encoding" 800 | }, 801 | "time": "2024-05-08T12:36:18+00:00" 802 | }, 803 | { 804 | "name": "paragonie/random_compat", 805 | "version": "v9.99.100", 806 | "source": { 807 | "type": "git", 808 | "url": "https://github.com/paragonie/random_compat.git", 809 | "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" 810 | }, 811 | "dist": { 812 | "type": "zip", 813 | "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", 814 | "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", 815 | "shasum": "" 816 | }, 817 | "require": { 818 | "php": ">= 7" 819 | }, 820 | "require-dev": { 821 | "phpunit/phpunit": "4.*|5.*", 822 | "vimeo/psalm": "^1" 823 | }, 824 | "suggest": { 825 | "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." 826 | }, 827 | "type": "library", 828 | "notification-url": "https://packagist.org/downloads/", 829 | "license": [ 830 | "MIT" 831 | ], 832 | "authors": [ 833 | { 834 | "name": "Paragon Initiative Enterprises", 835 | "email": "security@paragonie.com", 836 | "homepage": "https://paragonie.com" 837 | } 838 | ], 839 | "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", 840 | "keywords": [ 841 | "csprng", 842 | "polyfill", 843 | "pseudorandom", 844 | "random" 845 | ], 846 | "support": { 847 | "email": "info@paragonie.com", 848 | "issues": "https://github.com/paragonie/random_compat/issues", 849 | "source": "https://github.com/paragonie/random_compat" 850 | }, 851 | "time": "2020-10-15T08:29:30+00:00" 852 | }, 853 | { 854 | "name": "phpseclib/phpseclib", 855 | "version": "3.0.43", 856 | "source": { 857 | "type": "git", 858 | "url": "https://github.com/phpseclib/phpseclib.git", 859 | "reference": "709ec107af3cb2f385b9617be72af8cf62441d02" 860 | }, 861 | "dist": { 862 | "type": "zip", 863 | "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02", 864 | "reference": "709ec107af3cb2f385b9617be72af8cf62441d02", 865 | "shasum": "" 866 | }, 867 | "require": { 868 | "paragonie/constant_time_encoding": "^1|^2|^3", 869 | "paragonie/random_compat": "^1.4|^2.0|^9.99.99", 870 | "php": ">=5.6.1" 871 | }, 872 | "require-dev": { 873 | "phpunit/phpunit": "*" 874 | }, 875 | "suggest": { 876 | "ext-dom": "Install the DOM extension to load XML formatted public keys.", 877 | "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", 878 | "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", 879 | "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", 880 | "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." 881 | }, 882 | "type": "library", 883 | "autoload": { 884 | "files": [ 885 | "phpseclib/bootstrap.php" 886 | ], 887 | "psr-4": { 888 | "phpseclib3\\": "phpseclib/" 889 | } 890 | }, 891 | "notification-url": "https://packagist.org/downloads/", 892 | "license": [ 893 | "MIT" 894 | ], 895 | "authors": [ 896 | { 897 | "name": "Jim Wigginton", 898 | "email": "terrafrost@php.net", 899 | "role": "Lead Developer" 900 | }, 901 | { 902 | "name": "Patrick Monnerat", 903 | "email": "pm@datasphere.ch", 904 | "role": "Developer" 905 | }, 906 | { 907 | "name": "Andreas Fischer", 908 | "email": "bantu@phpbb.com", 909 | "role": "Developer" 910 | }, 911 | { 912 | "name": "Hans-Jürgen Petrich", 913 | "email": "petrich@tronic-media.com", 914 | "role": "Developer" 915 | }, 916 | { 917 | "name": "Graham Campbell", 918 | "email": "graham@alt-three.com", 919 | "role": "Developer" 920 | } 921 | ], 922 | "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", 923 | "homepage": "http://phpseclib.sourceforge.net", 924 | "keywords": [ 925 | "BigInteger", 926 | "aes", 927 | "asn.1", 928 | "asn1", 929 | "blowfish", 930 | "crypto", 931 | "cryptography", 932 | "encryption", 933 | "rsa", 934 | "security", 935 | "sftp", 936 | "signature", 937 | "signing", 938 | "ssh", 939 | "twofish", 940 | "x.509", 941 | "x509" 942 | ], 943 | "support": { 944 | "issues": "https://github.com/phpseclib/phpseclib/issues", 945 | "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43" 946 | }, 947 | "funding": [ 948 | { 949 | "url": "https://github.com/terrafrost", 950 | "type": "github" 951 | }, 952 | { 953 | "url": "https://www.patreon.com/phpseclib", 954 | "type": "patreon" 955 | }, 956 | { 957 | "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", 958 | "type": "tidelift" 959 | } 960 | ], 961 | "time": "2024-12-14T21:12:59+00:00" 962 | }, 963 | { 964 | "name": "psr/cache", 965 | "version": "3.0.0", 966 | "source": { 967 | "type": "git", 968 | "url": "https://github.com/php-fig/cache.git", 969 | "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" 970 | }, 971 | "dist": { 972 | "type": "zip", 973 | "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", 974 | "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", 975 | "shasum": "" 976 | }, 977 | "require": { 978 | "php": ">=8.0.0" 979 | }, 980 | "type": "library", 981 | "extra": { 982 | "branch-alias": { 983 | "dev-master": "1.0.x-dev" 984 | } 985 | }, 986 | "autoload": { 987 | "psr-4": { 988 | "Psr\\Cache\\": "src/" 989 | } 990 | }, 991 | "notification-url": "https://packagist.org/downloads/", 992 | "license": [ 993 | "MIT" 994 | ], 995 | "authors": [ 996 | { 997 | "name": "PHP-FIG", 998 | "homepage": "https://www.php-fig.org/" 999 | } 1000 | ], 1001 | "description": "Common interface for caching libraries", 1002 | "keywords": [ 1003 | "cache", 1004 | "psr", 1005 | "psr-6" 1006 | ], 1007 | "support": { 1008 | "source": "https://github.com/php-fig/cache/tree/3.0.0" 1009 | }, 1010 | "time": "2021-02-03T23:26:27+00:00" 1011 | }, 1012 | { 1013 | "name": "psr/http-client", 1014 | "version": "1.0.3", 1015 | "source": { 1016 | "type": "git", 1017 | "url": "https://github.com/php-fig/http-client.git", 1018 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" 1019 | }, 1020 | "dist": { 1021 | "type": "zip", 1022 | "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", 1023 | "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", 1024 | "shasum": "" 1025 | }, 1026 | "require": { 1027 | "php": "^7.0 || ^8.0", 1028 | "psr/http-message": "^1.0 || ^2.0" 1029 | }, 1030 | "type": "library", 1031 | "extra": { 1032 | "branch-alias": { 1033 | "dev-master": "1.0.x-dev" 1034 | } 1035 | }, 1036 | "autoload": { 1037 | "psr-4": { 1038 | "Psr\\Http\\Client\\": "src/" 1039 | } 1040 | }, 1041 | "notification-url": "https://packagist.org/downloads/", 1042 | "license": [ 1043 | "MIT" 1044 | ], 1045 | "authors": [ 1046 | { 1047 | "name": "PHP-FIG", 1048 | "homepage": "https://www.php-fig.org/" 1049 | } 1050 | ], 1051 | "description": "Common interface for HTTP clients", 1052 | "homepage": "https://github.com/php-fig/http-client", 1053 | "keywords": [ 1054 | "http", 1055 | "http-client", 1056 | "psr", 1057 | "psr-18" 1058 | ], 1059 | "support": { 1060 | "source": "https://github.com/php-fig/http-client" 1061 | }, 1062 | "time": "2023-09-23T14:17:50+00:00" 1063 | }, 1064 | { 1065 | "name": "psr/http-factory", 1066 | "version": "1.1.0", 1067 | "source": { 1068 | "type": "git", 1069 | "url": "https://github.com/php-fig/http-factory.git", 1070 | "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" 1071 | }, 1072 | "dist": { 1073 | "type": "zip", 1074 | "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", 1075 | "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", 1076 | "shasum": "" 1077 | }, 1078 | "require": { 1079 | "php": ">=7.1", 1080 | "psr/http-message": "^1.0 || ^2.0" 1081 | }, 1082 | "type": "library", 1083 | "extra": { 1084 | "branch-alias": { 1085 | "dev-master": "1.0.x-dev" 1086 | } 1087 | }, 1088 | "autoload": { 1089 | "psr-4": { 1090 | "Psr\\Http\\Message\\": "src/" 1091 | } 1092 | }, 1093 | "notification-url": "https://packagist.org/downloads/", 1094 | "license": [ 1095 | "MIT" 1096 | ], 1097 | "authors": [ 1098 | { 1099 | "name": "PHP-FIG", 1100 | "homepage": "https://www.php-fig.org/" 1101 | } 1102 | ], 1103 | "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", 1104 | "keywords": [ 1105 | "factory", 1106 | "http", 1107 | "message", 1108 | "psr", 1109 | "psr-17", 1110 | "psr-7", 1111 | "request", 1112 | "response" 1113 | ], 1114 | "support": { 1115 | "source": "https://github.com/php-fig/http-factory" 1116 | }, 1117 | "time": "2024-04-15T12:06:14+00:00" 1118 | }, 1119 | { 1120 | "name": "psr/http-message", 1121 | "version": "2.0", 1122 | "source": { 1123 | "type": "git", 1124 | "url": "https://github.com/php-fig/http-message.git", 1125 | "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" 1126 | }, 1127 | "dist": { 1128 | "type": "zip", 1129 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", 1130 | "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", 1131 | "shasum": "" 1132 | }, 1133 | "require": { 1134 | "php": "^7.2 || ^8.0" 1135 | }, 1136 | "type": "library", 1137 | "extra": { 1138 | "branch-alias": { 1139 | "dev-master": "2.0.x-dev" 1140 | } 1141 | }, 1142 | "autoload": { 1143 | "psr-4": { 1144 | "Psr\\Http\\Message\\": "src/" 1145 | } 1146 | }, 1147 | "notification-url": "https://packagist.org/downloads/", 1148 | "license": [ 1149 | "MIT" 1150 | ], 1151 | "authors": [ 1152 | { 1153 | "name": "PHP-FIG", 1154 | "homepage": "https://www.php-fig.org/" 1155 | } 1156 | ], 1157 | "description": "Common interface for HTTP messages", 1158 | "homepage": "https://github.com/php-fig/http-message", 1159 | "keywords": [ 1160 | "http", 1161 | "http-message", 1162 | "psr", 1163 | "psr-7", 1164 | "request", 1165 | "response" 1166 | ], 1167 | "support": { 1168 | "source": "https://github.com/php-fig/http-message/tree/2.0" 1169 | }, 1170 | "time": "2023-04-04T09:54:51+00:00" 1171 | }, 1172 | { 1173 | "name": "psr/log", 1174 | "version": "3.0.2", 1175 | "source": { 1176 | "type": "git", 1177 | "url": "https://github.com/php-fig/log.git", 1178 | "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" 1179 | }, 1180 | "dist": { 1181 | "type": "zip", 1182 | "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", 1183 | "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", 1184 | "shasum": "" 1185 | }, 1186 | "require": { 1187 | "php": ">=8.0.0" 1188 | }, 1189 | "type": "library", 1190 | "extra": { 1191 | "branch-alias": { 1192 | "dev-master": "3.x-dev" 1193 | } 1194 | }, 1195 | "autoload": { 1196 | "psr-4": { 1197 | "Psr\\Log\\": "src" 1198 | } 1199 | }, 1200 | "notification-url": "https://packagist.org/downloads/", 1201 | "license": [ 1202 | "MIT" 1203 | ], 1204 | "authors": [ 1205 | { 1206 | "name": "PHP-FIG", 1207 | "homepage": "https://www.php-fig.org/" 1208 | } 1209 | ], 1210 | "description": "Common interface for logging libraries", 1211 | "homepage": "https://github.com/php-fig/log", 1212 | "keywords": [ 1213 | "log", 1214 | "psr", 1215 | "psr-3" 1216 | ], 1217 | "support": { 1218 | "source": "https://github.com/php-fig/log/tree/3.0.2" 1219 | }, 1220 | "time": "2024-09-11T13:17:53+00:00" 1221 | }, 1222 | { 1223 | "name": "ralouphie/getallheaders", 1224 | "version": "3.0.3", 1225 | "source": { 1226 | "type": "git", 1227 | "url": "https://github.com/ralouphie/getallheaders.git", 1228 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 1229 | }, 1230 | "dist": { 1231 | "type": "zip", 1232 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 1233 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 1234 | "shasum": "" 1235 | }, 1236 | "require": { 1237 | "php": ">=5.6" 1238 | }, 1239 | "require-dev": { 1240 | "php-coveralls/php-coveralls": "^2.1", 1241 | "phpunit/phpunit": "^5 || ^6.5" 1242 | }, 1243 | "type": "library", 1244 | "autoload": { 1245 | "files": [ 1246 | "src/getallheaders.php" 1247 | ] 1248 | }, 1249 | "notification-url": "https://packagist.org/downloads/", 1250 | "license": [ 1251 | "MIT" 1252 | ], 1253 | "authors": [ 1254 | { 1255 | "name": "Ralph Khattar", 1256 | "email": "ralph.khattar@gmail.com" 1257 | } 1258 | ], 1259 | "description": "A polyfill for getallheaders.", 1260 | "support": { 1261 | "issues": "https://github.com/ralouphie/getallheaders/issues", 1262 | "source": "https://github.com/ralouphie/getallheaders/tree/develop" 1263 | }, 1264 | "time": "2019-03-08T08:55:37+00:00" 1265 | }, 1266 | { 1267 | "name": "symfony/deprecation-contracts", 1268 | "version": "v3.5.1", 1269 | "source": { 1270 | "type": "git", 1271 | "url": "https://github.com/symfony/deprecation-contracts.git", 1272 | "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" 1273 | }, 1274 | "dist": { 1275 | "type": "zip", 1276 | "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", 1277 | "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", 1278 | "shasum": "" 1279 | }, 1280 | "require": { 1281 | "php": ">=8.1" 1282 | }, 1283 | "type": "library", 1284 | "extra": { 1285 | "thanks": { 1286 | "url": "https://github.com/symfony/contracts", 1287 | "name": "symfony/contracts" 1288 | }, 1289 | "branch-alias": { 1290 | "dev-main": "3.5-dev" 1291 | } 1292 | }, 1293 | "autoload": { 1294 | "files": [ 1295 | "function.php" 1296 | ] 1297 | }, 1298 | "notification-url": "https://packagist.org/downloads/", 1299 | "license": [ 1300 | "MIT" 1301 | ], 1302 | "authors": [ 1303 | { 1304 | "name": "Nicolas Grekas", 1305 | "email": "p@tchwork.com" 1306 | }, 1307 | { 1308 | "name": "Symfony Community", 1309 | "homepage": "https://symfony.com/contributors" 1310 | } 1311 | ], 1312 | "description": "A generic function and convention to trigger deprecation notices", 1313 | "homepage": "https://symfony.com", 1314 | "support": { 1315 | "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" 1316 | }, 1317 | "funding": [ 1318 | { 1319 | "url": "https://symfony.com/sponsor", 1320 | "type": "custom" 1321 | }, 1322 | { 1323 | "url": "https://github.com/fabpot", 1324 | "type": "github" 1325 | }, 1326 | { 1327 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1328 | "type": "tidelift" 1329 | } 1330 | ], 1331 | "time": "2024-09-25T14:20:29+00:00" 1332 | }, 1333 | { 1334 | "name": "symfony/filesystem", 1335 | "version": "v7.2.0", 1336 | "source": { 1337 | "type": "git", 1338 | "url": "https://github.com/symfony/filesystem.git", 1339 | "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" 1340 | }, 1341 | "dist": { 1342 | "type": "zip", 1343 | "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", 1344 | "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", 1345 | "shasum": "" 1346 | }, 1347 | "require": { 1348 | "php": ">=8.2", 1349 | "symfony/polyfill-ctype": "~1.8", 1350 | "symfony/polyfill-mbstring": "~1.8" 1351 | }, 1352 | "require-dev": { 1353 | "symfony/process": "^6.4|^7.0" 1354 | }, 1355 | "type": "library", 1356 | "autoload": { 1357 | "psr-4": { 1358 | "Symfony\\Component\\Filesystem\\": "" 1359 | }, 1360 | "exclude-from-classmap": [ 1361 | "/Tests/" 1362 | ] 1363 | }, 1364 | "notification-url": "https://packagist.org/downloads/", 1365 | "license": [ 1366 | "MIT" 1367 | ], 1368 | "authors": [ 1369 | { 1370 | "name": "Fabien Potencier", 1371 | "email": "fabien@symfony.com" 1372 | }, 1373 | { 1374 | "name": "Symfony Community", 1375 | "homepage": "https://symfony.com/contributors" 1376 | } 1377 | ], 1378 | "description": "Provides basic utilities for the filesystem", 1379 | "homepage": "https://symfony.com", 1380 | "support": { 1381 | "source": "https://github.com/symfony/filesystem/tree/v7.2.0" 1382 | }, 1383 | "funding": [ 1384 | { 1385 | "url": "https://symfony.com/sponsor", 1386 | "type": "custom" 1387 | }, 1388 | { 1389 | "url": "https://github.com/fabpot", 1390 | "type": "github" 1391 | }, 1392 | { 1393 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1394 | "type": "tidelift" 1395 | } 1396 | ], 1397 | "time": "2024-10-25T15:15:23+00:00" 1398 | }, 1399 | { 1400 | "name": "symfony/polyfill-ctype", 1401 | "version": "v1.31.0", 1402 | "source": { 1403 | "type": "git", 1404 | "url": "https://github.com/symfony/polyfill-ctype.git", 1405 | "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" 1406 | }, 1407 | "dist": { 1408 | "type": "zip", 1409 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", 1410 | "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", 1411 | "shasum": "" 1412 | }, 1413 | "require": { 1414 | "php": ">=7.2" 1415 | }, 1416 | "provide": { 1417 | "ext-ctype": "*" 1418 | }, 1419 | "suggest": { 1420 | "ext-ctype": "For best performance" 1421 | }, 1422 | "type": "library", 1423 | "extra": { 1424 | "thanks": { 1425 | "url": "https://github.com/symfony/polyfill", 1426 | "name": "symfony/polyfill" 1427 | } 1428 | }, 1429 | "autoload": { 1430 | "files": [ 1431 | "bootstrap.php" 1432 | ], 1433 | "psr-4": { 1434 | "Symfony\\Polyfill\\Ctype\\": "" 1435 | } 1436 | }, 1437 | "notification-url": "https://packagist.org/downloads/", 1438 | "license": [ 1439 | "MIT" 1440 | ], 1441 | "authors": [ 1442 | { 1443 | "name": "Gert de Pagter", 1444 | "email": "BackEndTea@gmail.com" 1445 | }, 1446 | { 1447 | "name": "Symfony Community", 1448 | "homepage": "https://symfony.com/contributors" 1449 | } 1450 | ], 1451 | "description": "Symfony polyfill for ctype functions", 1452 | "homepage": "https://symfony.com", 1453 | "keywords": [ 1454 | "compatibility", 1455 | "ctype", 1456 | "polyfill", 1457 | "portable" 1458 | ], 1459 | "support": { 1460 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" 1461 | }, 1462 | "funding": [ 1463 | { 1464 | "url": "https://symfony.com/sponsor", 1465 | "type": "custom" 1466 | }, 1467 | { 1468 | "url": "https://github.com/fabpot", 1469 | "type": "github" 1470 | }, 1471 | { 1472 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1473 | "type": "tidelift" 1474 | } 1475 | ], 1476 | "time": "2024-09-09T11:45:10+00:00" 1477 | }, 1478 | { 1479 | "name": "symfony/polyfill-mbstring", 1480 | "version": "v1.31.0", 1481 | "source": { 1482 | "type": "git", 1483 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1484 | "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" 1485 | }, 1486 | "dist": { 1487 | "type": "zip", 1488 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", 1489 | "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", 1490 | "shasum": "" 1491 | }, 1492 | "require": { 1493 | "php": ">=7.2" 1494 | }, 1495 | "provide": { 1496 | "ext-mbstring": "*" 1497 | }, 1498 | "suggest": { 1499 | "ext-mbstring": "For best performance" 1500 | }, 1501 | "type": "library", 1502 | "extra": { 1503 | "thanks": { 1504 | "url": "https://github.com/symfony/polyfill", 1505 | "name": "symfony/polyfill" 1506 | } 1507 | }, 1508 | "autoload": { 1509 | "files": [ 1510 | "bootstrap.php" 1511 | ], 1512 | "psr-4": { 1513 | "Symfony\\Polyfill\\Mbstring\\": "" 1514 | } 1515 | }, 1516 | "notification-url": "https://packagist.org/downloads/", 1517 | "license": [ 1518 | "MIT" 1519 | ], 1520 | "authors": [ 1521 | { 1522 | "name": "Nicolas Grekas", 1523 | "email": "p@tchwork.com" 1524 | }, 1525 | { 1526 | "name": "Symfony Community", 1527 | "homepage": "https://symfony.com/contributors" 1528 | } 1529 | ], 1530 | "description": "Symfony polyfill for the Mbstring extension", 1531 | "homepage": "https://symfony.com", 1532 | "keywords": [ 1533 | "compatibility", 1534 | "mbstring", 1535 | "polyfill", 1536 | "portable", 1537 | "shim" 1538 | ], 1539 | "support": { 1540 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" 1541 | }, 1542 | "funding": [ 1543 | { 1544 | "url": "https://symfony.com/sponsor", 1545 | "type": "custom" 1546 | }, 1547 | { 1548 | "url": "https://github.com/fabpot", 1549 | "type": "github" 1550 | }, 1551 | { 1552 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1553 | "type": "tidelift" 1554 | } 1555 | ], 1556 | "time": "2024-09-09T11:45:10+00:00" 1557 | }, 1558 | { 1559 | "name": "symfony/polyfill-php80", 1560 | "version": "v1.31.0", 1561 | "source": { 1562 | "type": "git", 1563 | "url": "https://github.com/symfony/polyfill-php80.git", 1564 | "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" 1565 | }, 1566 | "dist": { 1567 | "type": "zip", 1568 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", 1569 | "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", 1570 | "shasum": "" 1571 | }, 1572 | "require": { 1573 | "php": ">=7.2" 1574 | }, 1575 | "type": "library", 1576 | "extra": { 1577 | "thanks": { 1578 | "url": "https://github.com/symfony/polyfill", 1579 | "name": "symfony/polyfill" 1580 | } 1581 | }, 1582 | "autoload": { 1583 | "files": [ 1584 | "bootstrap.php" 1585 | ], 1586 | "psr-4": { 1587 | "Symfony\\Polyfill\\Php80\\": "" 1588 | }, 1589 | "classmap": [ 1590 | "Resources/stubs" 1591 | ] 1592 | }, 1593 | "notification-url": "https://packagist.org/downloads/", 1594 | "license": [ 1595 | "MIT" 1596 | ], 1597 | "authors": [ 1598 | { 1599 | "name": "Ion Bazan", 1600 | "email": "ion.bazan@gmail.com" 1601 | }, 1602 | { 1603 | "name": "Nicolas Grekas", 1604 | "email": "p@tchwork.com" 1605 | }, 1606 | { 1607 | "name": "Symfony Community", 1608 | "homepage": "https://symfony.com/contributors" 1609 | } 1610 | ], 1611 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 1612 | "homepage": "https://symfony.com", 1613 | "keywords": [ 1614 | "compatibility", 1615 | "polyfill", 1616 | "portable", 1617 | "shim" 1618 | ], 1619 | "support": { 1620 | "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" 1621 | }, 1622 | "funding": [ 1623 | { 1624 | "url": "https://symfony.com/sponsor", 1625 | "type": "custom" 1626 | }, 1627 | { 1628 | "url": "https://github.com/fabpot", 1629 | "type": "github" 1630 | }, 1631 | { 1632 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1633 | "type": "tidelift" 1634 | } 1635 | ], 1636 | "time": "2024-09-09T11:45:10+00:00" 1637 | }, 1638 | { 1639 | "name": "symfony/process", 1640 | "version": "v7.2.0", 1641 | "source": { 1642 | "type": "git", 1643 | "url": "https://github.com/symfony/process.git", 1644 | "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" 1645 | }, 1646 | "dist": { 1647 | "type": "zip", 1648 | "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", 1649 | "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", 1650 | "shasum": "" 1651 | }, 1652 | "require": { 1653 | "php": ">=8.2" 1654 | }, 1655 | "type": "library", 1656 | "autoload": { 1657 | "psr-4": { 1658 | "Symfony\\Component\\Process\\": "" 1659 | }, 1660 | "exclude-from-classmap": [ 1661 | "/Tests/" 1662 | ] 1663 | }, 1664 | "notification-url": "https://packagist.org/downloads/", 1665 | "license": [ 1666 | "MIT" 1667 | ], 1668 | "authors": [ 1669 | { 1670 | "name": "Fabien Potencier", 1671 | "email": "fabien@symfony.com" 1672 | }, 1673 | { 1674 | "name": "Symfony Community", 1675 | "homepage": "https://symfony.com/contributors" 1676 | } 1677 | ], 1678 | "description": "Executes commands in sub-processes", 1679 | "homepage": "https://symfony.com", 1680 | "support": { 1681 | "source": "https://github.com/symfony/process/tree/v7.2.0" 1682 | }, 1683 | "funding": [ 1684 | { 1685 | "url": "https://symfony.com/sponsor", 1686 | "type": "custom" 1687 | }, 1688 | { 1689 | "url": "https://github.com/fabpot", 1690 | "type": "github" 1691 | }, 1692 | { 1693 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1694 | "type": "tidelift" 1695 | } 1696 | ], 1697 | "time": "2024-11-06T14:24:19+00:00" 1698 | } 1699 | ], 1700 | "packages-dev": [ 1701 | { 1702 | "name": "phpstan/phpstan", 1703 | "version": "1.12.16", 1704 | "source": { 1705 | "type": "git", 1706 | "url": "https://github.com/phpstan/phpstan.git", 1707 | "reference": "e0bb5cb78545aae631220735aa706eac633a6be9" 1708 | }, 1709 | "dist": { 1710 | "type": "zip", 1711 | "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e0bb5cb78545aae631220735aa706eac633a6be9", 1712 | "reference": "e0bb5cb78545aae631220735aa706eac633a6be9", 1713 | "shasum": "" 1714 | }, 1715 | "require": { 1716 | "php": "^7.2|^8.0" 1717 | }, 1718 | "conflict": { 1719 | "phpstan/phpstan-shim": "*" 1720 | }, 1721 | "bin": [ 1722 | "phpstan", 1723 | "phpstan.phar" 1724 | ], 1725 | "type": "library", 1726 | "autoload": { 1727 | "files": [ 1728 | "bootstrap.php" 1729 | ] 1730 | }, 1731 | "notification-url": "https://packagist.org/downloads/", 1732 | "license": [ 1733 | "MIT" 1734 | ], 1735 | "description": "PHPStan - PHP Static Analysis Tool", 1736 | "keywords": [ 1737 | "dev", 1738 | "static analysis" 1739 | ], 1740 | "support": { 1741 | "docs": "https://phpstan.org/user-guide/getting-started", 1742 | "forum": "https://github.com/phpstan/phpstan/discussions", 1743 | "issues": "https://github.com/phpstan/phpstan/issues", 1744 | "security": "https://github.com/phpstan/phpstan/security/policy", 1745 | "source": "https://github.com/phpstan/phpstan-src" 1746 | }, 1747 | "funding": [ 1748 | { 1749 | "url": "https://github.com/ondrejmirtes", 1750 | "type": "github" 1751 | }, 1752 | { 1753 | "url": "https://github.com/phpstan", 1754 | "type": "github" 1755 | } 1756 | ], 1757 | "time": "2025-01-21T14:50:05+00:00" 1758 | } 1759 | ], 1760 | "aliases": [], 1761 | "minimum-stability": "stable", 1762 | "stability-flags": [], 1763 | "prefer-stable": false, 1764 | "prefer-lowest": false, 1765 | "platform": { 1766 | "php": ">=8.2", 1767 | "ext-json": "*" 1768 | }, 1769 | "platform-dev": [], 1770 | "plugin-api-version": "2.6.0" 1771 | } 1772 | -------------------------------------------------------------------------------- /convert.php: -------------------------------------------------------------------------------- 1 | true, "message" => "Invalid format: only mp3 or mp4 are possible"))); 21 | } 22 | 23 | $success = preg_match('#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#', $youtubelink, $matches); 24 | 25 | if(!$success) 26 | { 27 | http_response_code(400); 28 | die(json_encode(array("error" => true, "message" => "No video specified"))); 29 | } 30 | 31 | $id = $matches[0]; 32 | 33 | $exists = file_exists(Config::DOWNLOAD_FOLDER.$id.".".$format); 34 | 35 | if(Config::DOWNLOAD_MAX_LENGTH > 0 || $exists) 36 | { 37 | try { 38 | $dl = new YoutubeDl(); 39 | 40 | $video = $dl->download( 41 | Options::create() 42 | ->noPlaylist() 43 | ->proxy(Config::PROXY) 44 | ->skipDownload(true) 45 | ->downloadPath(Config::DOWNLOAD_FOLDER) 46 | ->url($youtubelink) 47 | )->getVideos()[0]; 48 | 49 | if ($video->getError() !== null) 50 | throw new Exception($video->getError()); 51 | 52 | if($video->getDuration() > Config::DOWNLOAD_MAX_LENGTH && Config::DOWNLOAD_MAX_LENGTH > 0) 53 | throw new Exception("The duration of the video is {$video->getDuration()} seconds while max video length is ".Config::DOWNLOAD_MAX_LENGTH." seconds."); 54 | } 55 | catch (Exception $ex) 56 | { 57 | http_response_code(400); 58 | die(json_encode(array("error" => true, "message" => $ex->getMessage()))); 59 | } 60 | } 61 | 62 | if(!$exists) 63 | { 64 | $options = Options::create() 65 | // ->ffmpegLocation('/usr/local/bin/ffmpeg') 66 | ->output('%(id)s.%(ext)s') 67 | ->downloadPath(Config::DOWNLOAD_FOLDER) 68 | ->proxy(Config::PROXY) 69 | ->noPlaylist() 70 | ->url($youtubelink); 71 | 72 | if($format == 'mp3') 73 | { 74 | $options = $options->extractAudio(true) 75 | ->audioFormat('mp3') 76 | ->audioQuality('0'); 77 | } 78 | else 79 | $options = $options->format('bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'); 80 | } 81 | 82 | try 83 | { 84 | $dirname = dirname($_SERVER['PHP_SELF']); 85 | $url = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . 86 | ($dirname == '/' ? '' : $dirname) . "/"; 87 | 88 | if($exists) 89 | $file = $url.Config::DOWNLOAD_FOLDER.$video->getId().'.'.$format; 90 | else 91 | { 92 | $dl = new YoutubeDl(); 93 | 94 | $video = $dl->download($options)->getVideos()[0]; 95 | 96 | if($video->getError() !== null) 97 | die(json_encode(array("error" => true, "message" => $video->getError()))); 98 | 99 | $file = $url.$video->getFilename(); 100 | } 101 | 102 | $json = json_encode(array( 103 | "error" => false, 104 | "youtube_id" => $video->getId(), 105 | "title" => $video->getTitle(), 106 | "alt_title" => $video->getAltTitle(), 107 | "duration" => $video->getDuration(), 108 | "file" => $file, 109 | "uploaded_at" => $video->getUploadDate() 110 | )); 111 | 112 | if(Config::LOG) 113 | { 114 | $now = new DateTime(); 115 | $file = fopen('logs/'.$now->format('Ymd').'.log', 'a'); 116 | fwrite($file, '[' . $now->format('H:i:s') . '] ' . $json . PHP_EOL); 117 | fclose($file); 118 | } 119 | 120 | echo $json; 121 | } 122 | catch (Exception $e) 123 | { 124 | http_response_code(400); 125 | echo json_encode(array("error" => true, "message" => $e->getMessage())); 126 | } 127 | } 128 | else if(isset($_GET["delete"]) && !empty($_GET["delete"])) 129 | { 130 | $id = $_GET["delete"]; 131 | $format = $_GET["format"] ?? POSSIBLE_FORMATS; 132 | 133 | if(empty($format)) 134 | $format = POSSIBLE_FORMATS; 135 | 136 | if(!is_array($format)) 137 | $format = [$format]; 138 | 139 | $removedFiles = []; 140 | 141 | foreach($format as $f) { 142 | $localFile = Config::DOWNLOAD_FOLDER.$id.".".$f; 143 | if(file_exists($localFile)) { 144 | unlink($localFile); 145 | $removedFiles[] = $f; 146 | } 147 | } 148 | 149 | $resultNotRemoved = array_diff(POSSIBLE_FORMATS, $removedFiles); 150 | 151 | if(empty($removedFiles)) 152 | $message = 'No files removed.'; 153 | else 154 | $message = 'Removed files: ' . implode(', ', $removedFiles) . '.'; 155 | 156 | if(!empty($resultNotRemoved)) 157 | $message .= ' Not removed: ' . implode(', ', $resultNotRemoved); 158 | 159 | echo json_encode(array( 160 | "error" => false, 161 | "message" => $message 162 | )); 163 | } 164 | else 165 | { 166 | http_response_code(400); 167 | echo json_encode(array("error" => true, "message" => "Invalid request: missing 'youtubelink' parameter")); 168 | } 169 | ?> -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | services: 3 | convert-api: 4 | env_file: 5 | - .env 6 | environment: 7 | # The environment variable is now set inside the .env file. 8 | # If you don't have the file ".env", please make it and put 9 | # API_KEY={api key here} 10 | # in it. 11 | - API_KEY=${API_KEY:?API_KEY variable is not set in .env!} 12 | build: . 13 | restart: unless-stopped 14 | volumes: 15 | - yt-api-files:/var/www/html 16 | ports: 17 | - ${HOST_PORT:-80}:80 18 | 19 | volumes: 20 | yt-api-files: 21 | -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Find the API_KEY entry and add the environment variable value set in .env 3 | sed -i "s/API_KEY = \"\"/API_KEY = \"$API_KEY\"/" src/Config.php 4 | 5 | exec "$@" -------------------------------------------------------------------------------- /download/README.md: -------------------------------------------------------------------------------- 1 | In this folder the downloadable files will be placed. Make sure that this folder is writable for the webserver. -------------------------------------------------------------------------------- /includes/nav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /includes/styles.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |{}53 |
{}127 |
{}175 |
Datetime | 57 |ID | 58 |Title | 59 |Duration | 60 |Location | 61 |
= $value[0]->format('H:i:s'); ?> | 68 |= $value[1]->youtube_id; ?> | 69 |= $value[1]->title; ?> | 70 |= $value[1]->duration; ?> seconds | 71 |72 | file))): ?> 73 | Converted file 74 | 75 | Removed 76 | 77 | | 78 |