diff --git a/.env.example b/.env.example index f3bdf21..2e81b81 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,9 @@ # APP_URL="http://localhost:8000" # Full url path, PLEASE REPLACE TO YOUR OWN ONE -# SIGNER_URL="https://tiktok-sign.herokuapp.com/signature" # External signing service # LATTE_CACHE=/tmp/proxitok_api # Path for Latte cache, leave commented for ./cache/latte + +# API CONFIG +# USE_TEST_ENDPOINTS=1 # Discomment for usage of t.tiktok.com +# SIGNER_URL="https://tiktok-sign.herokuapp.com/signature" # External signing service # API_CACHE=redis # Cache engine for TikTok Api, (more info on README) # Redis cache, used on Helpers\CacheEngines\RedisCache diff --git a/app/Helpers/Misc.php b/app/Helpers/Misc.php index 940484e..7734bfc 100644 --- a/app/Helpers/Misc.php +++ b/app/Helpers/Misc.php @@ -18,7 +18,7 @@ class Misc { } static public function env(string $key, string $default_value): string { - return isset($_ENV[$key]) && !empty($_ENV[$key]) ? $_ENV[$key] : $default_value; + return $_ENV[$key] ?? $default_value; } /** @@ -33,7 +33,8 @@ class Misc { */ static public function api(): \TikScraper\Api { $options = [ - 'remote_signer' => self::env('SIGNER_URL', 'http://localhost:8080/signature') + 'remote_signer' => self::env('SIGNER_URL', 'http://localhost:8080/signature'), + 'use_test_endpoints' => self::env('USE_TEST_ENDPOINTS', false) ]; $cacheEngine = false; // Proxy config diff --git a/composer.lock b/composer.lock index 2d209eb..bdf4e23 100644 --- a/composer.lock +++ b/composer.lock @@ -306,16 +306,16 @@ }, { "name": "pablouser1/tikscraper", - "version": "v1.2.2", + "version": "v1.2.3", "source": { "type": "git", "url": "https://github.com/pablouser1/TikScraperPHP.git", - "reference": "a001bc0dce7fbd15f85b15cbe365de436c515457" + "reference": "2ecba60b580979b6be6b58436bce7a55f8bc0d49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/a001bc0dce7fbd15f85b15cbe365de436c515457", - "reference": "a001bc0dce7fbd15f85b15cbe365de436c515457", + "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/2ecba60b580979b6be6b58436bce7a55f8bc0d49", + "reference": "2ecba60b580979b6be6b58436bce7a55f8bc0d49", "shasum": "" }, "require": { @@ -339,9 +339,9 @@ "description": "Get data from TikTok API", "support": { "issues": "https://github.com/pablouser1/TikScraperPHP/issues", - "source": "https://github.com/pablouser1/TikScraperPHP/tree/v1.2.2" + "source": "https://github.com/pablouser1/TikScraperPHP/tree/v1.2.3" }, - "time": "2022-02-13T21:42:57+00:00" + "time": "2022-02-15T12:46:29+00:00" }, { "name": "phpoption/phpoption",