From 321ce20007ddfed3652c4a3706f0edf675eb70d5 Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Mon, 3 Jan 2022 23:28:36 +0100 Subject: [PATCH] Small fix --- composer.json | 2 +- composer.lock | 6 +++--- routes/assets.php | 11 +++++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index a44792a..4506392 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "require": { - "php": "^8.0", + "php": "^7.3|^8.0", "ext-curl": "*", "ssovit/tiktok-api": "^2.0", "steampixel/simple-php-router": "^0.7.0", diff --git a/composer.lock b/composer.lock index ac4fea2..83608bd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e3448e649bcb2f2456c630905ae887fd", + "content-hash": "e064040cff1f97fef9172828540a1aac", "packages": [ { "name": "graham-campbell/result-type", @@ -642,9 +642,9 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.0.0", + "php": "^7.3|^8.0", "ext-curl": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.0.0" } diff --git a/routes/assets.php b/routes/assets.php index 8400336..337c146 100644 --- a/routes/assets.php +++ b/routes/assets.php @@ -52,9 +52,12 @@ Route::add('/stream', function () use ($domains) { } 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); });