Using new wrapper

This commit is contained in:
Pablo Ferreiro 2022-02-13 22:21:08 +01:00
parent 19e2c32c77
commit a3ebb08d26
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
22 changed files with 141 additions and 154 deletions

View file

@ -27,8 +27,10 @@ class Misc {
/**
* Setup of TikTok Api wrapper
*/
static public function api(): \Sovit\TikTok\Api {
$options = [];
static public function api(): \TikScraper\Api {
$options = [
'remote_signer' => self::env('SIGNER_URL', 'http://localhost:8080/signature')
];
$cacheEngine = false;
// Proxy config
foreach(Cookies::PROXY as $proxy_element) {
@ -55,13 +57,13 @@ class Misc {
} else {
$host = $_ENV['REDIS_HOST'];
$port = (int) $_ENV['REDIS_PORT'];
$password = isset($_ENV['REDIS_PASSWORD']) ? $_ENV['REDIS_PASSWORD'] : null;
$password = $_ENV['REDIS_PASSWORD'] ?? null;
}
$cacheEngine = new RedisCache($host, $port, $password);
break;
}
}
$api = new \Sovit\TikTok\Api($options, $cacheEngine);
$api = new \TikScraper\Api($options, $cacheEngine);
return $api;
}