Ability to pass own user agent to the scraper.
This commit is contained in:
parent
5dea2468f8
commit
3d5890d821
|
@ -20,3 +20,5 @@
|
||||||
# PROXY_PORT=8080
|
# PROXY_PORT=8080
|
||||||
# PROXY_USERNAME=username
|
# PROXY_USERNAME=username
|
||||||
# PROXY_PASSWORD=password
|
# PROXY_PASSWORD=password
|
||||||
|
|
||||||
|
# USER_AGENT="Mozilla/5.0 (Android 12; Mobile; rv:109.0) Gecko/109.0 Firefox/109.0"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
use App\Helpers\Cookies;
|
use App\Helpers\Cookies;
|
||||||
|
use App\Helpers\Misc;
|
||||||
|
|
||||||
class ProxyController {
|
class ProxyController {
|
||||||
const VALID_TIKTOK_DOMAINS = [
|
const VALID_TIKTOK_DOMAINS = [
|
||||||
|
@ -11,7 +12,8 @@ class ProxyController {
|
||||||
static public function stream() {
|
static public function stream() {
|
||||||
self::checkUrl();
|
self::checkUrl();
|
||||||
$url = $_GET['url'];
|
$url = $_GET['url'];
|
||||||
$streamer = new \TikScraper\Stream();
|
$config['USER_AGENT'] = Misc::env("user_agent", "Mozilla/5.0 (Android 12; Mobile; rv:109.0) Gecko/109.0 Firefox/109.0");
|
||||||
|
$streamer = new \TikScraper\Stream($config);
|
||||||
$streamer->url($url);
|
$streamer->url($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue