Download services, scraper bump

This commit is contained in:
Pablo Ferreiro 2022-09-25 19:53:00 +02:00
parent c076ba65a6
commit 7aa869f567
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
27 changed files with 191 additions and 73 deletions

View file

@ -0,0 +1,31 @@
<?php
namespace App\Models;
use App\Constants\Themes;
use App\Helpers\Cookies;
use TikScraper\Constants\DownloadMethods;
/**
* Base for templates with a feed
*/
class SettingsTemplate extends BaseTemplate {
public array $downloaders = [];
public array $themes = [];
public bool $isTestEndpoints = false;
public string $currentDownloader;
public string $currentTheme;
function __construct() {
parent::__construct("Settings");
// Downloaders list
$ref = new \ReflectionClass(DownloadMethods::class);
$this->downloaders = $ref->getConstants();
// Themes list
$ref = new \ReflectionClass(Themes::class);
$this->themes = $ref->getConstants();
// Cookies data
$this->isTestEndpoints = Cookies::check('api-test_endpoints', 'yes');
$this->currentDownloader = Cookies::downloader();
$this->currentTheme = Cookies::theme();
}
}