Small fix

This commit is contained in:
Pablo Ferreiro 2022-01-03 23:28:36 +01:00
parent fe3ae82100
commit 321ce20007
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
3 changed files with 11 additions and 8 deletions

View file

@ -4,7 +4,7 @@
"version": "1.0.0", "version": "1.0.0",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"require": { "require": {
"php": "^8.0", "php": "^7.3|^8.0",
"ext-curl": "*", "ext-curl": "*",
"ssovit/tiktok-api": "^2.0", "ssovit/tiktok-api": "^2.0",
"steampixel/simple-php-router": "^0.7.0", "steampixel/simple-php-router": "^0.7.0",

6
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "e3448e649bcb2f2456c630905ae887fd", "content-hash": "e064040cff1f97fef9172828540a1aac",
"packages": [ "packages": [
{ {
"name": "graham-campbell/result-type", "name": "graham-campbell/result-type",
@ -642,9 +642,9 @@
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.0.0", "php": "^7.3|^8.0",
"ext-curl": "*" "ext-curl": "*"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.2.0" "plugin-api-version": "2.0.0"
} }

View file

@ -52,9 +52,12 @@ Route::add('/stream', function () use ($domains) {
} }
if (isset($_GET['download'])) { if (isset($_GET['download'])) {
header('Content-Disposition: attachment; filename="tiktok.mp4"'); // Download
$downloader = new \Sovit\TikTok\Download();
$downloader->url($url,"tiktok-video",'mp4');
} else {
// Stream
$streamer = new \Sovit\TikTok\Stream();
$streamer->stream($url);
} }
$streamer = new \Sovit\TikTok\Stream();
$streamer->stream($url);
}); });