From e12d26562de561020c8bdea56f7213bc2bdb3511 Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Sat, 4 Jun 2022 21:04:43 +0200 Subject: [PATCH] RIP Legacy Mode --- .env.example | 3 +-- app/Controllers/SettingsController.php | 5 +---- app/Controllers/TrendingController.php | 7 +------ app/Helpers/Wrappers.php | 4 +--- components/settings/api.latte | 9 +-------- composer.json | 4 ++-- composer.lock | 14 +++++++------- views/about.latte | 1 - 8 files changed, 14 insertions(+), 33 deletions(-) diff --git a/.env.example b/.env.example index 2d0fc7b..a7c0656 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,7 @@ -# APP_PATH="/proxitok" # Relative path, PLEASE LEAVE EMPTY IF / +# APP_URL="http://localhost:8000" # Absolute path to proxitok instance # LATTE_CACHE=/tmp/proxitok_api # Path for Latte cache, leave commented for ./cache/latte # API CONFIG -# API_FORCE_LEGACY=true # Force legacy mode for wrapper # API_SIGNER_URL="https://example.com" # External signing service # API_BROWSER_URL="http://localhost:4444" # chromedriver url # API_TEST_ENDPOINTS=true # Discomment for usage of testing TikTok endpoints, may help sometimes diff --git a/app/Controllers/SettingsController.php b/app/Controllers/SettingsController.php index a7dc8d6..0d6294d 100644 --- a/app/Controllers/SettingsController.php +++ b/app/Controllers/SettingsController.php @@ -25,10 +25,7 @@ class SettingsController { self::redirect(); } static public function api() { - if (isset($_POST['api-legacy'])) { - $legacy = $_POST['api-legacy']; - } - Cookies::set('api-legacy', $legacy); + // TODO, ADD COUNT self::redirect(); } } diff --git a/app/Controllers/TrendingController.php b/app/Controllers/TrendingController.php index d514781..587b330 100644 --- a/app/Controllers/TrendingController.php +++ b/app/Controllers/TrendingController.php @@ -10,13 +10,8 @@ use App\Models\RSSTemplate; class TrendingController { static public function get() { $api = Wrappers::api(); + $cursor = Misc::getTtwid(); - // Ttwid if standard, cursor if legacy - if ($api->isLegacy()) { - $cursor = Misc::getCursor(); - } else { - $cursor = Misc::getTtwid(); - } $trending = $api->trending(); $trending->feed($cursor); diff --git a/app/Helpers/Wrappers.php b/app/Helpers/Wrappers.php index 5d4d816..8022c70 100644 --- a/app/Helpers/Wrappers.php +++ b/app/Helpers/Wrappers.php @@ -81,8 +81,6 @@ class Wrappers { } } - // Legacy mode - $legacy = Misc::env('API_FORCE_LEGACY', false) || isset($_COOKIE['api-legacy']) && $_COOKIE['api-legacy'] === 'on'; - return new \TikScraper\Api($options, $legacy, $cacheEngine); + return new \TikScraper\Api($options, $cacheEngine); } } diff --git a/components/settings/api.latte b/components/settings/api.latte index 142a1ec..7d02d2b 100644 --- a/components/settings/api.latte +++ b/components/settings/api.latte @@ -1,14 +1,7 @@ {embed '../form.latte', path: '/settings/api', method: 'POST', submit: true} {block fields}
- -
- -
+

TODO

{/block} {/embed} diff --git a/composer.json b/composer.json index f81c3ea..a1fe995 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "pablouser1/proxitok", "description": "An alternative frontend for TikTok", - "version": "2.3.0.1", + "version": "2.3.1.0", "license": "AGPL-3.0-or-later", "type": "project", "authors": [ @@ -24,7 +24,7 @@ "latte/latte": "^2.11", "bramus/router": "^1.6", "josegonzalez/dotenv": "dev-master", - "pablouser1/tikscraper": "^2.0" + "pablouser1/tikscraper": "^2.1" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 6719d34..0dcba0c 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "cfe4122df9742d32e631921902c8e213", + "content-hash": "387c0d1d767d85d4d08fadad9b583080", "packages": [ { "name": "bramus/router", @@ -263,16 +263,16 @@ }, { "name": "pablouser1/tikscraper", - "version": "v2.0.2.1", + "version": "v2.1.0.1", "source": { "type": "git", "url": "https://github.com/pablouser1/TikScraperPHP.git", - "reference": "979a3fda0c6f0005fd4ee28a2ade2badc6e8286d" + "reference": "443225d18f02073ea154b907f93400acd1fd49a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/979a3fda0c6f0005fd4ee28a2ade2badc6e8286d", - "reference": "979a3fda0c6f0005fd4ee28a2ade2badc6e8286d", + "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/443225d18f02073ea154b907f93400acd1fd49a4", + "reference": "443225d18f02073ea154b907f93400acd1fd49a4", "shasum": "" }, "require": { @@ -298,9 +298,9 @@ "description": "Get data from TikTok API", "support": { "issues": "https://github.com/pablouser1/TikScraperPHP/issues", - "source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.0.2.1" + "source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.1.0.1" }, - "time": "2022-06-02T09:14:57+00:00" + "time": "2022-06-04T18:53:49+00:00" }, { "name": "php-webdriver/webdriver", diff --git a/views/about.latte b/views/about.latte index e4875e8..a411465 100644 --- a/views/about.latte +++ b/views/about.latte @@ -10,7 +10,6 @@ {block content}

About this instance

Version: {version()}

-

Forcing Legacy mode: {isset($_ENV['API_FORCE_LEGACY']) ? 'yes' : 'no'}


Why would I want to use ProxiTok?