bump scraper
This commit is contained in:
parent
32d49954f9
commit
7d2f6e8fd6
|
@ -8,35 +8,6 @@ class ProxyController {
|
|||
"tiktokcdn.com", "tiktokcdn-us.com", "tiktok.com"
|
||||
];
|
||||
|
||||
static private function isValidDomain(string $url) {
|
||||
$host = parse_url($url, PHP_URL_HOST);
|
||||
$host_split = explode('.', $host);
|
||||
$host_count = count($host_split);
|
||||
if ($host_count === 2) {
|
||||
// Using no watermark
|
||||
return in_array($host_split[0] . '.' . $host_split[1], self::VALID_TIKTOK_DOMAINS);
|
||||
} elseif ($host_count === 3) {
|
||||
return in_array($host_split[1] . '.' . $host_split[2], self::VALID_TIKTOK_DOMAINS);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static private function checkUrl() {
|
||||
if (!isset($_GET['url'])) {
|
||||
die('You need to send a URL');
|
||||
}
|
||||
|
||||
if (!filter_var($_GET['url'], FILTER_VALIDATE_URL) || !self::isValidDomain($_GET['url'])) {
|
||||
die('Not a valid URL');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static private function getFilename(string $id, string $user): string {
|
||||
$filename = 'tiktok-video-' . $id . '-' . $user;
|
||||
return $filename;
|
||||
}
|
||||
|
||||
static public function stream() {
|
||||
self::checkUrl();
|
||||
$url = $_GET['url'];
|
||||
|
@ -59,4 +30,34 @@ class ProxyController {
|
|||
// Running
|
||||
$downloader->url($url, $filename, $watermark);
|
||||
}
|
||||
|
||||
static private function isValidDomain(string $url): bool {
|
||||
$valid = false;
|
||||
$host = parse_url($url, PHP_URL_HOST);
|
||||
$host_split = explode('.', $host);
|
||||
$host_count = count($host_split);
|
||||
if ($host_count === 2) {
|
||||
// Using no watermark
|
||||
$valid = in_array($host_split[0] . '.' . $host_split[1], self::VALID_TIKTOK_DOMAINS);
|
||||
} elseif ($host_count === 3) {
|
||||
$valid = in_array($host_split[1] . '.' . $host_split[2], self::VALID_TIKTOK_DOMAINS);
|
||||
}
|
||||
return $valid;
|
||||
}
|
||||
|
||||
static private function checkUrl(): void {
|
||||
if (!isset($_GET['url'])) {
|
||||
die('You need to send a URL');
|
||||
}
|
||||
|
||||
if (!filter_var($_GET['url'], FILTER_VALIDATE_URL) || !self::isValidDomain($_GET['url'])) {
|
||||
die('Not a valid URL');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static private function getFilename(string $id, string $user): string {
|
||||
$filename = 'tiktok-video-' . $id . '-' . $user;
|
||||
return $filename;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "pablouser1/proxitok",
|
||||
"description": "An alternative frontend for TikTok",
|
||||
"version": "2.4.4.2",
|
||||
"version": "2.4.4.3",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "project",
|
||||
"authors": [
|
||||
|
|
14
composer.lock
generated
14
composer.lock
generated
|
@ -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": "c6c6c5ecb586c3f4701ffb57ccf385e4",
|
||||
"content-hash": "acb47eb00001b55dbf6825b0ce79cd0b",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bramus/router",
|
||||
|
@ -263,16 +263,16 @@
|
|||
},
|
||||
{
|
||||
"name": "pablouser1/tikscraper",
|
||||
"version": "v2.3.3.4",
|
||||
"version": "v2.3.3.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
||||
"reference": "065cd740373f6f423d366d73ea94437041ec85cd"
|
||||
"reference": "d3b51e6e0fab4cacce27dbbdf76bcb6fa8bf41ef"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/065cd740373f6f423d366d73ea94437041ec85cd",
|
||||
"reference": "065cd740373f6f423d366d73ea94437041ec85cd",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/d3b51e6e0fab4cacce27dbbdf76bcb6fa8bf41ef",
|
||||
"reference": "d3b51e6e0fab4cacce27dbbdf76bcb6fa8bf41ef",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -305,9 +305,9 @@
|
|||
"description": "Get data from TikTok API",
|
||||
"support": {
|
||||
"issues": "https://github.com/pablouser1/TikScraperPHP/issues",
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.3.4"
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.3.5"
|
||||
},
|
||||
"time": "2023-01-25T14:17:57+00:00"
|
||||
"time": "2023-01-26T16:19:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-webdriver/webdriver",
|
||||
|
|
Loading…
Reference in a new issue