No watermark without external service
This commit is contained in:
parent
7203bc1509
commit
fccec753d9
|
@ -19,27 +19,44 @@ class ProxyController {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function stream() {
|
static private function checkUrl() {
|
||||||
if (!isset($_GET['url'])) {
|
if (!isset($_GET['url'])) {
|
||||||
die('You need to send a url!');
|
die('You need to send a URL');
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $_GET['url'];
|
if (!filter_var($_GET['url'], FILTER_VALIDATE_URL) || !self::isValidDomain($_GET['url'])) {
|
||||||
if (!filter_var($url, FILTER_VALIDATE_URL) || !self::isValidDomain($url)) {
|
|
||||||
die('Not a valid URL');
|
die('Not a valid URL');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['download'])) {
|
}
|
||||||
// Download
|
|
||||||
$downloader = new \Sovit\TikTok\Download();
|
static private function getFileName(): string {
|
||||||
$filename = 'tiktok-video';
|
$filename = 'tiktok-video';
|
||||||
if (isset($_GET['id'], $_GET['user'])) {
|
if (isset($_GET['user'])) {
|
||||||
$filename .= '-' . $_GET['user'] . '-' . $_GET['id'];
|
$filename .= '-' . $_GET['user'] . '-' . $_GET['id'];
|
||||||
}
|
}
|
||||||
|
return $filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function stream() {
|
||||||
|
if (isset($_GET['download'])) {
|
||||||
$watermark = isset($_GET['watermark']);
|
$watermark = isset($_GET['watermark']);
|
||||||
$downloader->url($url, $filename, $watermark);
|
if ($watermark) {
|
||||||
|
self::checkUrl();
|
||||||
|
$filename = self::getFileName();
|
||||||
|
$downloader = new \Sovit\TikTok\Download();
|
||||||
|
$downloader->url($_GET['url'], $filename, true);
|
||||||
} else {
|
} else {
|
||||||
// Stream
|
if (!isset($_GET['id'])) {
|
||||||
|
die('You need to send an ID!');
|
||||||
|
}
|
||||||
|
$filename = self::getFileName();
|
||||||
|
$downloader = new \Sovit\TikTok\Download();
|
||||||
|
$downloader->url($_GET['id'], $filename, false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
self::checkUrl();
|
||||||
|
$url = $_GET['url'];
|
||||||
$streamer = new \Sovit\TikTok\Stream();
|
$streamer = new \Sovit\TikTok\Stream();
|
||||||
$streamer->stream($url);
|
$streamer->stream($url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="column is-one-quarter clickable-img" id="{$item->id}" onclick="openVideo(this.id)"
|
<div class="column is-one-quarter clickable-img" id="{$item->id}" onclick="openVideo(this.id)"
|
||||||
data-video_url="{path('/stream?url=' . urlencode($item->video->playAddr))}"
|
data-video_url="{path('/stream?url=' . urlencode($item->video->playAddr))}"
|
||||||
data-video_download_watermark="{path('/stream?url=' . urlencode($item->video->playAddr) . '&download=1&id=' . $item->id . '&user=' . $item->author->uniqueId) . '&watermark='}"
|
data-video_download_watermark="{path('/stream?url=' . urlencode($item->video->playAddr) . '&download=1&id=' . $item->id . '&user=' . $item->author->uniqueId) . '&watermark='}"
|
||||||
data-video_download_nowatermark="{path('/stream?url=' . urlencode($share_url) . '&download=1&id=' . $item->id . '&user=' . $item->author->uniqueId)}"
|
data-video_download_nowatermark="{path('/stream?download=1&id=' . $item->id . '&user=' . $item->author->uniqueId)}"
|
||||||
data-video_share_url="{$share_url}"
|
data-video_share_url="{$share_url}"
|
||||||
data-desc="{$item->desc}"
|
data-desc="{$item->desc}"
|
||||||
data-music_title="{$item->music->title}"
|
data-music_title="{$item->music->title}"
|
||||||
|
@ -48,10 +48,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons is-centered">
|
<div class="buttons is-centered">
|
||||||
<a target="_blank" id="download_watermark" class="button is-info" download>Download with watermark</a>
|
<a target="_blank" id="download_watermark" class="button is-info">Download with watermark</a>
|
||||||
<a target="_blank" id="download_nowatermark" class="button is-info">Download without watermark</a>
|
<a target="_blank" id="download_nowatermark" class="button is-info">Download without watermark</a>
|
||||||
</div>
|
</div>
|
||||||
<p>Please be patient with the No Watermark option. It takes a while to download</p>
|
|
||||||
<p id="audio_title"></p>
|
<p id="audio_title"></p>
|
||||||
<audio id="audio" controls preload="none"></audio>
|
<audio id="audio" controls preload="none"></audio>
|
||||||
<div class="buttons is-centered">
|
<div class="buttons is-centered">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "pablouser1/proxitok",
|
"name": "pablouser1/proxitok",
|
||||||
"description": "An alternative frontend for TikTok",
|
"description": "An alternative frontend for TikTok",
|
||||||
"version": "1.4.1.3",
|
"version": "1.4.1.4",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"homepage": "https://github.com/pablouser1/ProxiTok",
|
"homepage": "https://github.com/pablouser1/ProxiTok",
|
||||||
|
|
8
composer.lock
generated
8
composer.lock
generated
|
@ -381,12 +381,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pablouser1/TikTok-API-PHP.git",
|
"url": "https://github.com/pablouser1/TikTok-API-PHP.git",
|
||||||
"reference": "390d12b967e0e072227171d8bdc6cfb4544a11f2"
|
"reference": "60c00cfd321888b80eba93b6214c8c4003e98e57"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/pablouser1/TikTok-API-PHP/zipball/390d12b967e0e072227171d8bdc6cfb4544a11f2",
|
"url": "https://api.github.com/repos/pablouser1/TikTok-API-PHP/zipball/60c00cfd321888b80eba93b6214c8c4003e98e57",
|
||||||
"reference": "390d12b967e0e072227171d8bdc6cfb4544a11f2",
|
"reference": "60c00cfd321888b80eba93b6214c8c4003e98e57",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
|
@ -425,7 +425,7 @@
|
||||||
"issues": "https://github.com/ssovit/TikTok-API-PHP/issues",
|
"issues": "https://github.com/ssovit/TikTok-API-PHP/issues",
|
||||||
"email": "sovit.tamrakar@gmail.com"
|
"email": "sovit.tamrakar@gmail.com"
|
||||||
},
|
},
|
||||||
"time": "2022-02-07T20:13:16+00:00"
|
"time": "2022-02-07T22:43:53+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
|
|
Loading…
Reference in a new issue