Ability to pass own user agent to the scraper.
This commit is contained in:
parent
5dea2468f8
commit
3d5890d821
2 changed files with 5 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\Cookies;
|
||||
use App\Helpers\Misc;
|
||||
|
||||
class ProxyController {
|
||||
const VALID_TIKTOK_DOMAINS = [
|
||||
|
|
@ -11,7 +12,8 @@ class ProxyController {
|
|||
static public function stream() {
|
||||
self::checkUrl();
|
||||
$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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue