mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 19a2066fc2 | |||
| e43580f3f9 | |||
| b5d034437f | |||
| 4e191922fe | |||
| d09830cc89 | |||
| 3556fef036 | |||
| 7e65da7fe9 | |||
| 3bd6c553f4 | |||
| aadfeccab1 | |||
| 4188fcf064 | |||
| 9364a2e212 | |||
| e5d416f696 | |||
| 98a9ec2b65 | |||
| 33c723d786 | |||
| faee8d58f2 | |||
| 75e13bc7d2 | |||
| 08145ee90b | |||
| 6194324452 | |||
| 48eccbc5ec | |||
| cac97ff05e | |||
| eeaa8cdf1c | |||
| ecba96eaf4 | |||
| 013feeb679 | |||
| bf86e0d36a | |||
| 72ea5d43fd | |||
| 288f87504c | |||
| 3d5890d821 | |||
| 5dea2468f8 | |||
| e8ec0ab293 | |||
| 78fe44070c | |||
| 7d2f6e8fd6 | |||
| 32d49954f9 | |||
| 5c770def41 | |||
| d273b35e53 | |||
| faf1dcee51 | |||
| 89d9ad2f9c | |||
| 7ddf6f7738 | |||
| 059bf7208a | |||
| d5858c39fd | |||
| 76be343c13 | |||
| a7b0edf8fe | |||
| 73e9d7a1cd | |||
| 0224cd25eb | |||
| 215f984fe4 | |||
| ee6e8b0593 | |||
| fa3f1e0a7c | |||
| ce5c9e016b | |||
| 49fcc79f15 | |||
| b138f4bccc | |||
| 94da0e46ac | |||
| 1176bc35fe | |||
| 4bfc4c9434 | |||
| de85ba3e44 | |||
| 79fd699cee | |||
| 8f83a27885 | |||
| cba59e66c7 | |||
| c925ca2a41 | |||
| 32ea8b6b12 | |||
| 7d0df67ded | |||
| 23583ef7ab | |||
| 6fafcdcd11 | |||
| 5e1b009f75 | |||
| 7aa869f567 | |||
| c076ba65a6 | |||
| 2504ba6e93 | |||
| 38557fafa6 | |||
| 96fb2fd428 | |||
| af4d98b8dd | |||
| 40e5d45956 | |||
| 2f20cf8c02 | |||
| aa2fff2b31 | |||
| fbc9061b21 | |||
| 67c080e5f4 | |||
| 086c95ca71 | |||
| 931191bcaf | |||
| ebe5941fa2 |
@@ -1,5 +1,6 @@
|
||||
node_modules
|
||||
/.env
|
||||
/.git
|
||||
/.vscode
|
||||
/vendor
|
||||
/cache/latte/*
|
||||
|
||||
+10
-2
@@ -2,8 +2,8 @@
|
||||
# LATTE_CACHE=/tmp/proxitok_api # Path for Latte cache, leave commented for ./cache/latte
|
||||
|
||||
# API CONFIG
|
||||
# API_SIGNER_URL="https://example.com" # External signing service
|
||||
# API_BROWSER_URL="http://localhost:4444" # chromedriver url
|
||||
# API_SIGNER="remote"
|
||||
# API_SIGNER_URL="http://localhost:8080"
|
||||
# API_TEST_ENDPOINTS=true # Uncomment for usage of testing TikTok endpoints, may help sometimes
|
||||
# API_CACHE=redis
|
||||
|
||||
@@ -14,3 +14,11 @@
|
||||
|
||||
# JSON cache, used on Helpers\CacheEngines\JSONCache
|
||||
# API_CACHE_JSON=/tmp/proxitok_api # Path for JSON API Cache, leave commented for ./cache/api
|
||||
|
||||
# Proxy Config
|
||||
# PROXY_HOST=http://EXAMPLE_IP # Host to be used as proxy, make sure to type a valid protocol. Available: http:// | https:// | socks4:// | socks5://
|
||||
# PROXY_PORT=8080
|
||||
# PROXY_USERNAME=username
|
||||
# PROXY_PASSWORD=password
|
||||
|
||||
# USER_AGENT="Mozilla/5.0 (Android 12; Mobile; rv:109.0) Gecko/109.0 Firefox/109.0"
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
liberapay: 'pablouser1'
|
||||
custom: 'https://paypal.me/pablouser1'
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
name: Add my instance
|
||||
about: Add public instance to the list
|
||||
title: "[INSTANCES] New public instance"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
- URL: https://proxitok.example.com
|
||||
- Cloudflare: Yes / No
|
||||
- Country: Type the name of the country you are hosting the instance here
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Before submitting an issue, please make sure you are using the latest version of ProxiTok.
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logs**
|
||||
If applicable, add PHP logs to help explain the issue.
|
||||
|
||||
**Enviroment (please complete the following information):**
|
||||
|
||||
- Deployment method (if possible): [e.g docker, heroku, manual...]
|
||||
- Frontend version: [e.g. 2.2.0.0]
|
||||
- Scrapper version: [e.g. 2.4.0.0]
|
||||
- PHP Version: [e.g. 8.0]
|
||||
|
||||
You can find the frontend and scrapper version on /about
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@main
|
||||
with:
|
||||
cosign-release: 'v1.9.0'
|
||||
cosign-release: 'v2.0.0-rc.0'
|
||||
|
||||
|
||||
# Workaround: https://github.com/docker/build-push-action/issues/461
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM php:8-apache
|
||||
FROM php:8.1-apache
|
||||
WORKDIR /var/www/html
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
RUN apt update -y && apt upgrade -y \
|
||||
|
||||
@@ -1 +1 @@
|
||||
web: vendor/bin/heroku-php-nginx -C setup/heroku/nginx.conf
|
||||
web: vendor/bin/heroku-php-nginx -C misc/setup/heroku/nginx.conf
|
||||
|
||||
@@ -21,26 +21,28 @@ If you want to automatically redirect Tiktok links to ProxiTok you can use:
|
||||
* [Libredirect](https://github.com/libredirect/libredirect)
|
||||
* [Redirector](https://github.com/einaregilsson/Redirector)
|
||||
|
||||
You can use the following config if you want to use Redirector (you can change https://proxitok.herokuapp.com with whatever instance you want to use):
|
||||
You can use the following config if you want to use Redirector (you can change https://proxitok.pabloferreiro.es with whatever instance you want to use):
|
||||
```
|
||||
Description: TikTok to ProxiTok
|
||||
Example URL: https://www.tiktok.com/@tiktok
|
||||
Include pattern: (.*//.*)(tiktok.com)(.*)
|
||||
Redirect to: https://proxitok.herokuapp.com$3
|
||||
Example result: https://proxitok.herokuapp.com/@tiktok
|
||||
Redirect to: https://proxitok.pabloferreiro.es$3
|
||||
Example result: https://proxitok.pabloferreiro.es/@tiktok
|
||||
Pattern type: Regular Expression
|
||||
Apply to: Main window (address bar)
|
||||
```
|
||||
|
||||
## TODO / Known issues
|
||||
* Replace placeholder favicon
|
||||
* Make video on /video fit screen and don't overflow
|
||||
* Fix embed styling
|
||||
* Fix crash when invalid vm.tiktok.com/CODE or www.tiktok.com/t/CODE is provided
|
||||
* Add custom amount of videos per page
|
||||
* Discover does not work
|
||||
|
||||
## Credits
|
||||
[@TheFrenchGhosty](https://github.com/TheFrenchGhosty): Initial Dockerfile and fixes to a usable state. You can check his Docker image [here](https://github.com/PussTheCat-org/docker-proxitok-quay) on Github or [here](https://quay.io/repository/pussthecatorg/proxitok) on Quay
|
||||
* [TheFrenchGhosty](https://thefrenchghosty.me) ([Github](https://github.com/TheFrenchGhosty)): Initial Dockerfile and fixes to a usable state.
|
||||
* [Jennifer Wjertzoch](https://wjertzochjennifer.medium.com): Carousel CSS Implementation
|
||||
|
||||
### External libraries
|
||||
* [TikScraperPHP](https://github.com/pablouser1/TikScraperPHP)
|
||||
* [Latte](https://github.com/nette/latte)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -20,6 +20,10 @@
|
||||
"description": "Latte cache path",
|
||||
"value": "/tmp/latte"
|
||||
},
|
||||
"API_SIGNER": {
|
||||
"description": "Signer method",
|
||||
"value": "remote"
|
||||
},
|
||||
"API_SIGNER_URL": {
|
||||
"description": "Remote signer url",
|
||||
"value": "https://signtok.vercel.app/api"
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace App\Cache;
|
||||
|
||||
use TikScraper\Interfaces\CacheInterface;
|
||||
|
||||
class ApcuCache implements CacheInterface {
|
||||
function __construct() {
|
||||
if (!(extension_loaded('apcu') && apcu_enabled())) {
|
||||
throw new \Exception('APCu not enabled');
|
||||
}
|
||||
}
|
||||
|
||||
public function get(string $cache_key): ?object {
|
||||
$data = apcu_fetch($cache_key);
|
||||
return $data !== false ? json_decode($data) : null;
|
||||
}
|
||||
|
||||
public function exists(string $cache_key): bool {
|
||||
return apcu_exists($cache_key);
|
||||
}
|
||||
|
||||
public function set(string $cache_key, string $data, $timeout = 3600): void {
|
||||
apcu_store($cache_key, $data, $timeout);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace App\Cache;
|
||||
|
||||
class JSONCache {
|
||||
use TikScraper\Interfaces\CacheInterface;
|
||||
|
||||
class JSONCache implements CacheInterface {
|
||||
private string $cache_path = __DIR__ . '/../../cache/api';
|
||||
|
||||
function __construct() {
|
||||
@@ -24,7 +26,7 @@ class JSONCache {
|
||||
return is_file($filename);
|
||||
}
|
||||
|
||||
public function set(string $cache_key, mixed $data, $timeout = 3600) {
|
||||
public function set(string $cache_key, string $data, $timeout = 3600) {
|
||||
file_put_contents($this->cache_path . '/' . $cache_key . '.json', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace App\Cache;
|
||||
|
||||
class RedisCache {
|
||||
use TikScraper\Interfaces\CacheInterface;
|
||||
|
||||
class RedisCache implements CacheInterface {
|
||||
private \Redis $client;
|
||||
function __construct(string $host, int $port, ?string $password) {
|
||||
$this->client = new \Redis();
|
||||
@@ -21,10 +23,7 @@ class RedisCache {
|
||||
|
||||
public function get(string $cache_key): ?object {
|
||||
$data = $this->client->get($cache_key);
|
||||
if ($data) {
|
||||
return json_decode($data);
|
||||
}
|
||||
return null;
|
||||
return $data ? json_decode($data) : null;
|
||||
}
|
||||
|
||||
public function exists(string $cache_key): bool {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace App\Constants;
|
||||
|
||||
abstract class CacheMethods {
|
||||
const JSON = 'json';
|
||||
const APCU = 'apcu';
|
||||
const REDIS = 'redis';
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace App\Constants;
|
||||
|
||||
abstract class TextExtras {
|
||||
const USER = 0;
|
||||
const HASHTAG = 1;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace App\Constants;
|
||||
|
||||
abstract class Themes {
|
||||
const DEFAULT = "default";
|
||||
const CARD = "card";
|
||||
}
|
||||
@@ -2,19 +2,17 @@
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\FeedTemplate;
|
||||
use App\Models\DiscoverTemplate;
|
||||
|
||||
class DiscoverController {
|
||||
static public function get() {
|
||||
public static function get() {
|
||||
$api = Wrappers::api();
|
||||
$feed = $api->discover();
|
||||
if ($feed->meta->success) {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('discover'), new FeedTemplate('Discover', $feed));
|
||||
$data = $api->discover();
|
||||
if ($data->meta->success) {
|
||||
Wrappers::latte('discover', new DiscoverTemplate($data));
|
||||
} else {
|
||||
ErrorHandler::show($feed->meta);
|
||||
ErrorHandler::showMeta($data->meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,20 @@
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\VideoTemplate;
|
||||
|
||||
class EmbedController {
|
||||
static public function v2(int $id) {
|
||||
public static function v2(int $id) {
|
||||
$api = Wrappers::api();
|
||||
$feed = $api->getVideoByID($id);
|
||||
if ($feed->meta->success) {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('video'), new VideoTemplate($feed->items[0], $feed->info->detail, true));
|
||||
$video = $api->video($id);
|
||||
$video->feed();
|
||||
if ($video->ok()) {
|
||||
$item = $video->getFeed()->items[0];
|
||||
$info = $video->getInfo();
|
||||
Wrappers::latte('video', new VideoTemplate($item, $info, true));
|
||||
} else {
|
||||
ErrorHandler::show($feed->meta);
|
||||
ErrorHandler::showMeta($video->error());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,18 +7,18 @@ use App\Helpers\Wrappers;
|
||||
use App\Models\FullTemplate;
|
||||
|
||||
class MusicController {
|
||||
static public function get(string $music_id) {
|
||||
public static function get(string $music_id) {
|
||||
$cursor = Misc::getCursor();
|
||||
|
||||
$api = Wrappers::api();
|
||||
$music = $api->music($music_id);
|
||||
$music->feed($cursor);
|
||||
if ($music->ok()) {
|
||||
$data = $music->getFull();
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('music'), new FullTemplate('Music', $data));
|
||||
$info = $music->getInfo();
|
||||
$feed = $music->getFeed();
|
||||
Wrappers::latte('music', new FullTemplate('Music', $info, $feed));
|
||||
} else {
|
||||
ErrorHandler::show($music->error());
|
||||
ErrorHandler::showMeta($music->error());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,54 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\Cookies;
|
||||
use App\Helpers\Misc;
|
||||
use TikScraper\Constants\UserAgents as TikScraperUserAgents;
|
||||
|
||||
class ProxyController {
|
||||
const VALID_TIKTOK_DOMAINS = [
|
||||
"tiktokcdn.com", "tiktokcdn-us.com", "tiktok.com"
|
||||
];
|
||||
|
||||
static private function isValidDomain(string $url) {
|
||||
public static function stream() {
|
||||
self::checkUrl();
|
||||
$url = $_GET['url'];
|
||||
$config['user_agent'] = Misc::env("USER_AGENT", TikScraperUserAgents::DEFAULT);
|
||||
$streamer = new \TikScraper\Stream($config);
|
||||
$streamer->url($url);
|
||||
}
|
||||
|
||||
public static function download() {
|
||||
self::checkUrl();
|
||||
$method = Cookies::downloader();
|
||||
$downloader = new \TikScraper\Download($method);
|
||||
|
||||
// Params
|
||||
$id = $_GET['id'] ?? '';
|
||||
$watermark = isset($_GET['watermark']);
|
||||
$url = $_GET['url'];
|
||||
$user = $_GET['user'] ?? '';
|
||||
// Filename
|
||||
$filename = self::getFilename($id, $user);
|
||||
// Running
|
||||
$downloader->url($url, $filename, $watermark);
|
||||
}
|
||||
|
||||
static private function isValidDomain(string $url): bool {
|
||||
$valid = false;
|
||||
$host = parse_url($url, PHP_URL_HOST);
|
||||
$host_split = explode('.', $host);
|
||||
$host_count = count($host_split);
|
||||
if ($host_count === 2) {
|
||||
// Using no watermark
|
||||
return in_array($host_split[0] . '.' . $host_split[1], self::VALID_TIKTOK_DOMAINS);
|
||||
$valid = in_array($host_split[0] . '.' . $host_split[1], self::VALID_TIKTOK_DOMAINS);
|
||||
} elseif ($host_count === 3) {
|
||||
return in_array($host_split[1] . '.' . $host_split[2], self::VALID_TIKTOK_DOMAINS);
|
||||
$valid = in_array($host_split[1] . '.' . $host_split[2], self::VALID_TIKTOK_DOMAINS);
|
||||
}
|
||||
return false;
|
||||
return $valid;
|
||||
}
|
||||
|
||||
static private function checkUrl() {
|
||||
static private function checkUrl(): void {
|
||||
if (!isset($_GET['url'])) {
|
||||
die('You need to send a URL');
|
||||
}
|
||||
@@ -30,34 +59,8 @@ class ProxyController {
|
||||
|
||||
}
|
||||
|
||||
static private function getFileName(): string {
|
||||
$filename = 'tiktok-video';
|
||||
if (isset($_GET['user'])) {
|
||||
$filename .= '-' . $_GET['user'] . '-' . $_GET['id'];
|
||||
}
|
||||
static private function getFilename(string $id, string $user): string {
|
||||
$filename = 'tiktok-video-' . $id . '-' . $user;
|
||||
return $filename;
|
||||
}
|
||||
|
||||
static public function stream() {
|
||||
self::checkUrl();
|
||||
$url = $_GET['url'];
|
||||
$streamer = new \TikScraper\Stream();
|
||||
$streamer->url($url);
|
||||
}
|
||||
|
||||
static public function download() {
|
||||
$downloader = new \TikScraper\Download();
|
||||
$watermark = isset($_GET['watermark']);
|
||||
if ($watermark) {
|
||||
self::checkUrl();
|
||||
$filename = self::getFileName();
|
||||
$downloader->url($_GET['url'], $filename, true);
|
||||
} else {
|
||||
if (!isset($_GET['id'])) {
|
||||
die('You need to send an ID!');
|
||||
}
|
||||
$filename = self::getFileName();
|
||||
$downloader->url($_GET['id'], $filename, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
namespace App\Controllers;
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\UrlBuilder;
|
||||
|
||||
/**
|
||||
* Used to be compatible with HTML forms
|
||||
*/
|
||||
class RedirectController {
|
||||
static public function redirect() {
|
||||
public static function search() {
|
||||
$endpoint = '/';
|
||||
if (isset($_GET['type'], $_GET['term'])) {
|
||||
$term = trim($_GET['term']);
|
||||
@@ -15,7 +16,7 @@ class RedirectController {
|
||||
case 'url':
|
||||
$endpoint = self::to_endpoint($term);
|
||||
if (!$endpoint) {
|
||||
echo 'Invalid or unknown TikTok URL format';
|
||||
ErrorHandler::showText(400, 'Invalid TikTok URL');
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -24,22 +25,22 @@ class RedirectController {
|
||||
if ($term[0] === '@') {
|
||||
$term = substr($term, 1);
|
||||
}
|
||||
$endpoint = '/@' . $term;
|
||||
$endpoint = '/@' . urlencode($term);
|
||||
break;
|
||||
case 'tag':
|
||||
// Remove # if sent
|
||||
if ($term[0] === '#') {
|
||||
$term = substr($term, 1);
|
||||
}
|
||||
$endpoint = '/tag/' . $term;
|
||||
$endpoint = '/tag/' . urlencode($term);
|
||||
break;
|
||||
case 'music':
|
||||
$endpoint = '/music/' . $term;
|
||||
$endpoint = '/music/' . urlencode($term);
|
||||
break;
|
||||
case 'video':
|
||||
// The @username part is not used, but
|
||||
// it is the schema that TikTok follows
|
||||
$endpoint = '/@placeholder/video/' . $term;
|
||||
$endpoint = '/@placeholder/video/' . urlencode($term);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -48,11 +49,29 @@ class RedirectController {
|
||||
header("Location: {$url}");
|
||||
}
|
||||
|
||||
public static function download() {
|
||||
if (!(isset($_GET['videoId'], $_GET['authorUsername'], $_GET['playAddr']))) {
|
||||
ErrorHandler::showText(400, 'Request incomplete');
|
||||
return;
|
||||
}
|
||||
|
||||
$watermark = isset($_GET['watermark']) && $_GET['watermark'] === 'yes' ? true : false;
|
||||
|
||||
$url = '';
|
||||
if ($watermark) {
|
||||
$url = UrlBuilder::download($_GET['playAddr'], $_GET['authorUsername'], $_GET['videoId'], true);
|
||||
} else {
|
||||
$url = UrlBuilder::download(UrlBuilder::video_external($_GET['authorUsername'], $_GET['videoId']), $_GET['authorUsername'], $_GET['videoId'], false);
|
||||
}
|
||||
|
||||
header("Location: {$url}");
|
||||
}
|
||||
|
||||
/**
|
||||
* to_endpoint maps a TikTok URL into a ProxiTok-compatible endpoint URL.
|
||||
*/
|
||||
static private function to_endpoint(string $url): string {
|
||||
if (preg_match('%^https://vm\.tiktok\.com/([A-Za-z0-9]+)%', $url, $m)) {
|
||||
if (preg_match('%^(?:https?://)?(?:www\.)?(?:vm\.|vt\.)?tiktok\.com/(?:t/)?([A-Za-z0-9]+)%', $url, $m)) {
|
||||
// Short video URL
|
||||
return '/@placeholder/video/' . $m[1];
|
||||
} elseif (preg_match('%^https://www\.tiktok\.com/(.+)%', $url, $m)) {
|
||||
@@ -60,17 +79,17 @@ class RedirectController {
|
||||
if (preg_match('%^(@[A-Za-z0-9_.]+)(?:/|$)(.*)%', $m[1], $u)) {
|
||||
if ($u[2] == '') {
|
||||
// User profile URL
|
||||
return '/' . $u[1];
|
||||
return '/' . urlencode($u[1]);
|
||||
} elseif (preg_match('%^video/(\d+)%', $u[2], $v)) {
|
||||
// Video URL
|
||||
return '/' . $u[1] . '/video/' . $v[1];
|
||||
return '/' . urlencode($u[1]) . '/video/' . urlencode($v[1]);
|
||||
}
|
||||
} elseif (preg_match('%^tag/([^ ]+?)(?:/|$)%', $m[1], $t)) {
|
||||
// Tag URL
|
||||
return '/tag/' . $t[1];
|
||||
return '/tag/' . urlencode($t[1]);
|
||||
} elseif (preg_match('%^music/([^ ]+?)(?:/|$)%', $m[1], $m)) {
|
||||
// Music URL
|
||||
return '/music/' . $m[1];
|
||||
return '/music/' . urlencode($m[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,27 +4,32 @@ namespace App\Controllers;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\Cookies;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\BaseTemplate;
|
||||
use App\Models\SettingsTemplate;
|
||||
|
||||
class SettingsController {
|
||||
static public function index() {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('settings'), new BaseTemplate('Settings'));
|
||||
public static function index() {
|
||||
Wrappers::latte('settings', new SettingsTemplate());
|
||||
}
|
||||
|
||||
static public function general() {
|
||||
public static function general() {
|
||||
if (isset($_POST['theme'])) {
|
||||
$theme = $_POST['theme'];
|
||||
Cookies::set('theme', $theme);
|
||||
}
|
||||
self::redirect();
|
||||
}
|
||||
static public function api() {
|
||||
|
||||
public static function api() {
|
||||
// TODO, ADD COUNT
|
||||
if (isset($_POST['api-test_endpoints'])) {
|
||||
$test_endpoints = $_POST['api-test_endpoints'];
|
||||
Cookies::set('api-test_endpoints', $test_endpoints);
|
||||
}
|
||||
|
||||
if (isset($_POST['api-downloader'])) {
|
||||
$downloader = $_POST['api-downloader'];
|
||||
Cookies::set("api-downloader", $downloader);
|
||||
}
|
||||
self::redirect();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,33 +3,34 @@ namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\UrlBuilder;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\FullTemplate;
|
||||
use App\Models\RSSTemplate;
|
||||
|
||||
class TagController {
|
||||
static public function get(string $name) {
|
||||
public static function get(string $name) {
|
||||
$cursor = Misc::getCursor();
|
||||
$api = Wrappers::api();
|
||||
$hashtag = $api->hashtag($name);
|
||||
$hashtag->feed($cursor);
|
||||
if ($hashtag->ok()) {
|
||||
$data = $hashtag->getFull();
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('tag'), new FullTemplate('Tag', $data));
|
||||
$info = $hashtag->getInfo();
|
||||
$feed = $hashtag->getFeed();
|
||||
Wrappers::latte('tag', new FullTemplate($info->detail->title, $info, $feed));
|
||||
} else {
|
||||
ErrorHandler::show($hashtag->error());
|
||||
ErrorHandler::showMeta($hashtag->error());
|
||||
}
|
||||
}
|
||||
|
||||
static public function rss(string $name) {
|
||||
public static function rss(string $name) {
|
||||
$api = Wrappers::api();
|
||||
$hashtag = $api->hashtag($name);
|
||||
$hashtag->feed();
|
||||
if ($hashtag->ok()) {
|
||||
$data = $hashtag->getFull();
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('rss'), new RSSTemplate($name, $data->info->detail->desc, "/tag/{$name}", $data->feed->items));
|
||||
Misc::rss($name);
|
||||
Wrappers::latte('rss', new RSSTemplate($name, $data->info->detail->desc, UrlBuilder::tag($name), $data->feed->items));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use App\Helpers\Wrappers;
|
||||
use App\Models\RSSTemplate;
|
||||
|
||||
class TrendingController {
|
||||
static public function get() {
|
||||
public static function get() {
|
||||
$api = Wrappers::api();
|
||||
$cursor = Misc::getTtwid();
|
||||
|
||||
@@ -17,22 +17,21 @@ class TrendingController {
|
||||
|
||||
$feed = $trending->getFeed();
|
||||
if ($feed && $feed->meta->success) {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('trending'), new FeedTemplate('Trending', $feed));
|
||||
Wrappers::latte('trending', new FeedTemplate('Trending', $feed));
|
||||
} else {
|
||||
ErrorHandler::show($trending->error());
|
||||
ErrorHandler::showMeta($trending->error());
|
||||
}
|
||||
}
|
||||
|
||||
static public function rss() {
|
||||
public static function rss() {
|
||||
$api = Wrappers::api();
|
||||
$trending = $api->trending();
|
||||
$trending->feed();
|
||||
|
||||
$feed = $trending->getFeed();
|
||||
if ($feed && $feed->meta->success) {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('rss'), new RSSTemplate('Trending', 'Trending on TikTok', '/trending', $feed->items));
|
||||
Misc::rss('Trending');
|
||||
Wrappers::latte('rss', new RSSTemplate('Trending', 'Trending on TikTok', Misc::url('/trending'), $feed->items));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,52 +3,48 @@ namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\UrlBuilder;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\FullTemplate;
|
||||
use App\Models\RSSTemplate;
|
||||
use App\Models\VideoTemplate;
|
||||
|
||||
class UserController {
|
||||
static public function get(string $username) {
|
||||
public static function get(string $username) {
|
||||
$cursor = Misc::getCursor();
|
||||
$api = Wrappers::api();
|
||||
$user = $api->user($username);
|
||||
$user->feed($cursor);
|
||||
if ($user->ok()) {
|
||||
$data = $user->getFull();
|
||||
if ($data->info->detail->privateAccount) {
|
||||
http_response_code(403);
|
||||
echo 'Private account detected! Not supported';
|
||||
exit;
|
||||
}
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('user'), new FullTemplate($data->info->detail->nickname, $data));
|
||||
$info = $user->getInfo();
|
||||
$feed = $user->getFeed();
|
||||
Wrappers::latte('user', new FullTemplate($info->detail->nickname, $info, $feed));
|
||||
} else {
|
||||
ErrorHandler::show($user->error());
|
||||
ErrorHandler::showMeta($user->error());
|
||||
}
|
||||
}
|
||||
|
||||
static public function video(string $username, string $video_id) {
|
||||
public static function video(string $username, string $video_id) {
|
||||
$api = Wrappers::api();
|
||||
$video = $api->video($video_id);
|
||||
$video->feed();
|
||||
if ($video->ok()) {
|
||||
$data = $video->getFull();
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('video'), new VideoTemplate($data->feed->items[0], $data->info->detail));
|
||||
$item = $video->getFeed()->items[0];
|
||||
$info = $video->getInfo();
|
||||
Wrappers::latte('video', new VideoTemplate($item, $info));
|
||||
} else {
|
||||
ErrorHandler::show($video->error());
|
||||
ErrorHandler::showMeta($video->error());
|
||||
}
|
||||
}
|
||||
|
||||
static public function rss(string $username) {
|
||||
public static function rss(string $username) {
|
||||
$api = Wrappers::api();
|
||||
$user = $api->user($username);
|
||||
$user->feed();
|
||||
if ($user->ok()) {
|
||||
$data = $user->getFull();
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('rss'), new RSSTemplate($username, $data->info->detail->signature, '/@' . $username, $data->feed->items));
|
||||
Misc::rss($username);
|
||||
Wrappers::latte('rss', new RSSTemplate($username, $data->info->detail->signature, UrlBuilder::user($username), $data->feed->items));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace App\Controllers;
|
||||
|
||||
class VideoController {
|
||||
static public function get(string $video_id) {
|
||||
public static function get(string $video_id) {
|
||||
UserController::video('placeholder', $video_id);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-8
@@ -1,33 +1,40 @@
|
||||
<?php
|
||||
namespace App\Helpers;
|
||||
|
||||
class Cookies {
|
||||
const ALLOWED_THEMES = ['default', 'card'];
|
||||
use App\Constants\Themes;
|
||||
|
||||
static public function get(string $name, string $default_value = ''): string {
|
||||
class Cookies {
|
||||
public static function get(string $name, string $default_value = ''): string {
|
||||
if (isset($_COOKIE[$name]) && !empty($_COOKIE[$name])) {
|
||||
return $_COOKIE[$name];
|
||||
}
|
||||
return $default_value;
|
||||
}
|
||||
|
||||
static public function theme(): string {
|
||||
public static function theme(): string {
|
||||
$theme = self::get('theme');
|
||||
if ($theme && in_array($theme, self::ALLOWED_THEMES)) {
|
||||
$ref = new \ReflectionClass(Themes::class);
|
||||
$themes = $ref->getConstants();
|
||||
if ($theme && in_array($theme, $themes)) {
|
||||
return $theme;
|
||||
}
|
||||
return 'default';
|
||||
}
|
||||
|
||||
static public function exists(string $name): bool {
|
||||
public static function downloader(): string {
|
||||
$downloader = self::get('api-downloader', 'default');
|
||||
return $downloader;
|
||||
}
|
||||
|
||||
public static function exists(string $name): bool {
|
||||
return isset($_COOKIE[$name]);
|
||||
}
|
||||
|
||||
static public function check(string $name, string $value): bool {
|
||||
public static function check(string $name, string $value): bool {
|
||||
return self::exists($name) && $_COOKIE[$name] === $value;
|
||||
}
|
||||
|
||||
static public function set(string $name, string $value) {
|
||||
public static function set(string $name, string $value) {
|
||||
setcookie($name, $value, time()+60*60*24*30, '/', '', isset($_SERVER['HTTPS']), true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,9 +5,13 @@ use App\Models\ErrorTemplate;
|
||||
use TikScraper\Models\Meta;
|
||||
|
||||
class ErrorHandler {
|
||||
static public function show(Meta $meta) {
|
||||
public static function showMeta(Meta $meta) {
|
||||
http_response_code($meta->http_code);
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('error'), new ErrorTemplate($meta));
|
||||
Wrappers::latte('error', new ErrorTemplate($meta->http_code, $meta->tiktok_msg, $meta->tiktok_code));
|
||||
}
|
||||
|
||||
public static function showText(int $code, string $msg) {
|
||||
http_response_code($code);
|
||||
Wrappers::latte('error', new ErrorTemplate($code, $msg));
|
||||
}
|
||||
}
|
||||
|
||||
+14
-6
@@ -2,26 +2,34 @@
|
||||
namespace App\Helpers;
|
||||
|
||||
class Misc {
|
||||
static public function getCursor(): int {
|
||||
public static function getCursor(): int {
|
||||
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0;
|
||||
}
|
||||
|
||||
static public function getTtwid(): string {
|
||||
public static function getTtwid(): string {
|
||||
return isset($_GET['cursor']) ? $_GET['cursor'] : '';
|
||||
}
|
||||
|
||||
static public function url(string $endpoint = ''): string {
|
||||
public static function url(string $endpoint = ''): string {
|
||||
return self::env('APP_URL', '') . $endpoint;
|
||||
}
|
||||
|
||||
static public function env(string $key, $default_value) {
|
||||
public static function env(string $key, $default_value) {
|
||||
return $_ENV[$key] ?? $default_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns absolute path for view
|
||||
*/
|
||||
static public function getView(string $template): string {
|
||||
return __DIR__ . "/../../views/{$template}.latte";
|
||||
public static function getView(string $template): string {
|
||||
return __DIR__ . "/../../templates/views/{$template}.latte";
|
||||
}
|
||||
|
||||
/**
|
||||
* Common method for rss feeds
|
||||
*/
|
||||
public static function rss(string $title) {
|
||||
header('Content-Type: application/rss+xml');
|
||||
header('Content-Disposition: attachment; filename="' . $title . '.rss' . '"');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace App\Helpers;
|
||||
|
||||
class UrlBuilder {
|
||||
public static function stream(string $url): string {
|
||||
return Misc::url('/stream?url=' . urlencode($url));
|
||||
}
|
||||
|
||||
public static function download(string $url, string $username, string $id, bool $watermark): string {
|
||||
$down_url = Misc::url('/download?url=' . urlencode($url) . '&id=' . $id . '&user=' . $username);
|
||||
if ($watermark) $down_url .= '&watermark=1';
|
||||
return $down_url;
|
||||
}
|
||||
|
||||
public static function user(string $username): string {
|
||||
return Misc::url('/@' . $username);
|
||||
}
|
||||
|
||||
public static function tag(string $tag): string {
|
||||
return Misc::url('/tag/' . $tag);
|
||||
}
|
||||
|
||||
public static function video_internal(string $username, string $id): string {
|
||||
return Misc::url('/@' . $username . "/video/" . $id);
|
||||
}
|
||||
|
||||
public static function video_external(string $username, string $id): string {
|
||||
return "https://www.tiktok.com/@" . $username . "/video/" . $id;
|
||||
}
|
||||
}
|
||||
+130
-11
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Cache\ApcuCache;
|
||||
use App\Cache\JSONCache;
|
||||
use App\Cache\RedisCache;
|
||||
use App\Constants\CacheMethods;
|
||||
use App\Constants\TextExtras;
|
||||
use App\Models\BaseTemplate;
|
||||
|
||||
class Wrappers {
|
||||
/**
|
||||
* Setup of Latte template engine
|
||||
*/
|
||||
static public function latte(): \Latte\Engine {
|
||||
public static function latte(string $template, BaseTemplate $base) {
|
||||
$latte = new \Latte\Engine;
|
||||
$cache_path = Misc::env('LATTE_CACHE', __DIR__ . '/../../cache/latte');
|
||||
$latte->setTempDirectory($cache_path);
|
||||
@@ -18,6 +22,32 @@ class Wrappers {
|
||||
$latte->addFunction('path', function (string $endpoint = ''): string {
|
||||
return Misc::url($endpoint);
|
||||
});
|
||||
|
||||
// Static assets
|
||||
$latte->addFunction('static', function (string $type, string $file, bool $isVendor = false): string {
|
||||
$endpoint = '';
|
||||
switch ($type) {
|
||||
case 'js':
|
||||
$endpoint .= '/scripts';
|
||||
break;
|
||||
case 'css':
|
||||
$endpoint .= '/styles';
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Invalid static asset type');
|
||||
}
|
||||
|
||||
if ($isVendor) $endpoint .= '/vendor';
|
||||
|
||||
$endpoint .= '/' . $file;
|
||||
|
||||
return Misc::url($endpoint);
|
||||
});
|
||||
|
||||
$latte->addFunction('theme', function(): string {
|
||||
return Cookies::theme();
|
||||
});
|
||||
|
||||
// Version being used
|
||||
$latte->addFunction('version_frontend', function (): string {
|
||||
return \Composer\InstalledVersions::getVersion('pablouser1/proxitok');
|
||||
@@ -25,9 +55,7 @@ class Wrappers {
|
||||
$latte->addFunction('version_scraper', function (): string {
|
||||
return \Composer\InstalledVersions::getVersion('pablouser1/tikscraper');
|
||||
});
|
||||
$latte->addFunction('theme', function(): string {
|
||||
return Cookies::theme();
|
||||
});
|
||||
|
||||
// https://stackoverflow.com/a/36365553
|
||||
$latte->addFunction('number', function (float $x) {
|
||||
if($x > 1000) {
|
||||
@@ -42,29 +70,114 @@ class Wrappers {
|
||||
}
|
||||
return $x;
|
||||
});
|
||||
return $latte;
|
||||
|
||||
// UrlBuilder
|
||||
$latte->addFunction('url_stream', function (string $url): string {
|
||||
return UrlBuilder::stream($url);
|
||||
});
|
||||
$latte->addFunction('url_user', function (string $username): string {
|
||||
return UrlBuilder::user($username);
|
||||
});
|
||||
$latte->addFunction('url_tag', function (string $tag): string {
|
||||
return UrlBuilder::tag($tag);
|
||||
});
|
||||
$latte->addFunction('url_video_internal', function (string $username, string $id): string {
|
||||
return UrlBuilder::video_internal($username, $id);
|
||||
});
|
||||
$latte->addFunction('url_video_external', function (string $username, string $id): string {
|
||||
return UrlBuilder::video_external($username, $id);
|
||||
});
|
||||
$latte->addFunction('url_download', function (string $url, string $username, string $id, bool $watermark): string {
|
||||
return UrlBuilder::download($url, $username, $id, $watermark);
|
||||
});
|
||||
|
||||
$latte->addFunction('bool_to_str', function (bool $cond): string {
|
||||
return $cond ? 'yes' : 'no';
|
||||
});
|
||||
|
||||
// Add URLs to video descriptions
|
||||
// TODO: Make it work with unicode characters such as emojis
|
||||
$latte->addFunction('render_desc', function (string $desc, array $textExtras = []): string {
|
||||
$bytesCount = strlen($desc);
|
||||
$charsCount = mb_strlen($desc);
|
||||
// Skip urlify for now if there is a special char like an emoji to avoid issues
|
||||
if ($bytesCount !== $charsCount) {
|
||||
return $desc;
|
||||
}
|
||||
$sanitizedDesc = htmlspecialchars($desc);
|
||||
$out = $sanitizedDesc;
|
||||
foreach ($textExtras as $extra) {
|
||||
$url = '';
|
||||
$text = mb_substr($desc, $extra->start, $extra->end - $extra->start, 'UTF-8');
|
||||
switch ($extra->type) {
|
||||
// User URL
|
||||
case TextExtras::USER:
|
||||
$url = UrlBuilder::user(htmlspecialchars($extra->userUniqueId));
|
||||
break;
|
||||
// Hashtag URL
|
||||
case TextExtras::HASHTAG:
|
||||
$url = UrlBuilder::tag(htmlspecialchars($extra->hashtagName));
|
||||
break;
|
||||
}
|
||||
|
||||
$out = str_replace($text, "<a href=\"$url\">$text</a>", $out);
|
||||
}
|
||||
return $out;
|
||||
});
|
||||
|
||||
$latte->render(Misc::getView($template), $base);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup of TikTok Api wrapper
|
||||
*/
|
||||
static public function api(): \TikScraper\Api {
|
||||
public static function api(): \TikScraper\Api {
|
||||
$method = Misc::env('API_SIGNER', '');
|
||||
$url = Misc::env('API_SIGNER_URL', '');
|
||||
if (!$method) {
|
||||
// Legacy support
|
||||
$browser_url = Misc::env('API_BROWSER_URL', '');
|
||||
if ($url) {
|
||||
$method = 'remote';
|
||||
} elseif ($browser_url) {
|
||||
$url = $browser_url;
|
||||
$method = 'browser';
|
||||
}
|
||||
}
|
||||
|
||||
$options = [
|
||||
'use_test_endpoints' => Misc::env('API_TEST_ENDPOINTS', false) || isset($_COOKIE['api-test_endpoints']) && $_COOKIE['api-test_endpoints'] === 'yes',
|
||||
'signer' => [
|
||||
'remote_url' => Misc::env('API_SIGNER_URL', ''),
|
||||
'browser_url' => Misc::env('API_BROWSER_URL', ''),
|
||||
'method' => $method,
|
||||
'url' => $url,
|
||||
'close_when_done' => false
|
||||
]
|
||||
];
|
||||
|
||||
// -- PROXY CONFIG -- //
|
||||
$proxy_host = Misc::env('PROXY_HOST', '');
|
||||
$proxy_port = Misc::env('PROXY_PORT', '');
|
||||
|
||||
if ($proxy_host && $proxy_port) {
|
||||
$options['proxy'] = [
|
||||
'host' => $proxy_host,
|
||||
'port' => $proxy_port,
|
||||
'username' => Misc::env('PROXY_USERNAME', null),
|
||||
'password' => Misc::env('PROXY_PASSWORD', null)
|
||||
];
|
||||
}
|
||||
|
||||
// Cache config
|
||||
$cacheEngine = false;
|
||||
$cacheEngine = null;
|
||||
if (isset($_ENV['API_CACHE'])) {
|
||||
switch ($_ENV['API_CACHE']) {
|
||||
case 'json':
|
||||
case CacheMethods::JSON:
|
||||
$cacheEngine = new JSONCache();
|
||||
break;
|
||||
case 'redis':
|
||||
case CacheMethods::APCU:
|
||||
$cacheEngine = new ApcuCache();
|
||||
break;
|
||||
case CacheMethods::REDIS:
|
||||
if (!(isset($_ENV['REDIS_URL']) || isset($_ENV['REDIS_HOST'], $_ENV['REDIS_PORT']))) {
|
||||
throw new \Exception('You need to set REDIS_URL or REDIS_HOST and REDIS_PORT to use Redis Cache!');
|
||||
}
|
||||
@@ -84,6 +197,12 @@ class Wrappers {
|
||||
}
|
||||
}
|
||||
|
||||
$customUa = Misc::env("USER_AGENT", '');
|
||||
|
||||
if ($customUa) {
|
||||
$options['user_agent'] = $customUa;
|
||||
}
|
||||
|
||||
return new \TikScraper\Api($options, $cacheEngine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace App\Models;
|
||||
*/
|
||||
class BaseTemplate {
|
||||
public string $title;
|
||||
public string $version;
|
||||
|
||||
function __construct(string $title) {
|
||||
$this->title = $title;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Discover;
|
||||
|
||||
class DiscoverTemplate extends BaseTemplate {
|
||||
public Discover $data;
|
||||
|
||||
function __construct(Discover $data) {
|
||||
parent::__construct("Discover");
|
||||
$this->data = $data;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Meta;
|
||||
|
||||
class ErrorTemplate extends BaseTemplate {
|
||||
public Meta $error;
|
||||
public int $http_code = 502;
|
||||
public ?int $tiktok_code = -1;
|
||||
public string $msg = '';
|
||||
|
||||
function __construct(object $error) {
|
||||
|
||||
function __construct(int $http_code, string $msg, ?int $tiktok_code = null) {
|
||||
parent::__construct('Error');
|
||||
$this->error = $error;
|
||||
$this->http_code = $http_code;
|
||||
$this->msg = $msg;
|
||||
$this->tiktok_code = $tiktok_code;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Feed;
|
||||
|
||||
/**
|
||||
* Base for templates with a feed
|
||||
*/
|
||||
class FeedTemplate extends BaseTemplate {
|
||||
public object $data;
|
||||
public Feed $feed;
|
||||
|
||||
function __construct(string $title, object $feed) {
|
||||
function __construct(string $title, Feed $feed) {
|
||||
parent::__construct($title);
|
||||
$this->data = (object) [
|
||||
'feed' => $feed
|
||||
];
|
||||
$this->feed = $feed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Full;
|
||||
use TikScraper\Models\Feed;
|
||||
use TikScraper\Models\Info;
|
||||
|
||||
/**
|
||||
* Base for templates with both info and feed
|
||||
*/
|
||||
class FullTemplate extends BaseTemplate {
|
||||
public Full $data;
|
||||
public Info $info;
|
||||
public Feed $feed;
|
||||
|
||||
function __construct(string $title, Full $data) {
|
||||
function __construct(string $title, Info $info, Feed $feed) {
|
||||
parent::__construct($title);
|
||||
$this->data = $data;
|
||||
$this->info = $info;
|
||||
$this->feed = $feed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
/**
|
||||
* Base for templates with a feed
|
||||
*/
|
||||
class RSSTemplate {
|
||||
public string $title;
|
||||
class RSSTemplate extends BaseTemplate {
|
||||
public string $desc;
|
||||
public string $link;
|
||||
public array $items;
|
||||
|
||||
function __construct(string $title, string $desc, string $link, array $items) {
|
||||
$this->title = $title;
|
||||
parent::__construct($title);
|
||||
$this->desc = $desc;
|
||||
$this->link = $link;
|
||||
$this->items = $items;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use App\Constants\Themes;
|
||||
use App\Helpers\Cookies;
|
||||
use TikScraper\Constants\DownloadMethods;
|
||||
|
||||
/**
|
||||
* Settings model with all possible config items
|
||||
*/
|
||||
class SettingsTemplate extends BaseTemplate {
|
||||
public array $downloaders = [];
|
||||
public array $themes = [];
|
||||
public bool $isTestEndpoints = false;
|
||||
public string $currentDownloader;
|
||||
public string $currentTheme;
|
||||
public bool $isServiceWorker = false;
|
||||
|
||||
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();
|
||||
$this->isServiceWorker = Cookies::check('misc-sw', 'yes');
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use TikScraper\Models\Info;
|
||||
|
||||
/**
|
||||
* Base for templates with a feed
|
||||
*/
|
||||
class VideoTemplate extends BaseTemplate {
|
||||
public object $item;
|
||||
public object $detail;
|
||||
public Info $info;
|
||||
public string $layout = 'hero';
|
||||
|
||||
function __construct(object $item, object $detail, bool $isEmbed = false) {
|
||||
function __construct(object $item, Info $info, bool $isEmbed = false) {
|
||||
parent::__construct('Video');
|
||||
$this->item = $item;
|
||||
$this->detail = $detail;
|
||||
$this->info = $info;
|
||||
if ($isEmbed) {
|
||||
$this->layout = 'embed';
|
||||
} else {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
@@ -1,14 +0,0 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta property="og:title" content="ProxiTok" />
|
||||
<meta property="og:description" content="Alternative frontend for TikTok" />
|
||||
<meta property="og:type" content="website" />
|
||||
{if isset($has_rss)}
|
||||
<link rel="alternate" type="application/rss+xml" title="{$title}" href="{$_SERVER['REQUEST_URI'] . '/rss'}" />
|
||||
{/if}
|
||||
<link rel="stylesheet" href="{path('/styles/vendor/cssgg.min.css')}">
|
||||
<link rel="stylesheet" href="{path('/styles/vendor/bulma.min.css')}">
|
||||
<title>{$title} - ProxiTok</title>
|
||||
</head>
|
||||
@@ -1,19 +0,0 @@
|
||||
{embed '../form.latte', path: '/settings/api', method: 'POST', submit: true}
|
||||
{block fields}
|
||||
{var $use_endpoints = \App\Helpers\Cookies::check('api-test_endpoints', 'yes')}
|
||||
<div class="field">
|
||||
<label class="label">Use test endpoints</label>
|
||||
<div class="control">
|
||||
<label class="radio">
|
||||
<input type="radio" name="api-test_endpoints" value="yes" n:attr="checked => $use_endpoints" />
|
||||
<span>Yes</span>
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="api-test_endpoints" value="no" n:attr="checked => !$use_endpoints" />
|
||||
<span>No</span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="help">This <i>may</i> help bypass rate limits</p>
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
@@ -1,14 +0,0 @@
|
||||
{embed '../form.latte', path: '/settings/general', method: 'POST', submit: true}
|
||||
{block fields}
|
||||
<div class="field">
|
||||
<label class="label">Theme</label>
|
||||
<div class="select">
|
||||
<select name="theme">
|
||||
<option hidden disabled selected value> -- Select an option -- </option>
|
||||
<option value="default">Default</option>
|
||||
<option value="card">Card</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
@@ -1,13 +0,0 @@
|
||||
<div class="dropdown is-hoverable">
|
||||
<div class="dropdown-trigger">
|
||||
<button class="button" aria-haspopup="true" aria-controls="dropdown-menu">
|
||||
{include '../../icon.latte', icon: 'software-download', text: 'Download'}
|
||||
</button>
|
||||
</div>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<div class="dropdown-content">
|
||||
<a target="_blank" href="{path('/download?url=' . urlencode($playAddr) . '&id=' . $id . '&user=' . $uniqueId) . '&watermark=1'}" class="dropdown-item">Watermark</a>
|
||||
<a target="_blank" href="{path('/download?id=' . $id . '&user=' . $uniqueId)}" class="dropdown-item">No watermark</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,5 +0,0 @@
|
||||
{do $endpoint = '/@' . $uniqueId . '/video/' . $id}
|
||||
<div class="buttons is-centered">
|
||||
<a class="button is-success is-small" href="{path($endpoint)}">Instance Link</a>
|
||||
<a class="button is-danger is-small" href="https://www.tiktok.com{$endpoint}">Original Link</a>
|
||||
</div>
|
||||
@@ -1,5 +0,0 @@
|
||||
<div class="tags">
|
||||
{foreach $challenges as $challenge}
|
||||
<a class="tag is-rounded is-info" href="{path('/tag/' . $challenge->title)}">{$challenge->title}</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
@@ -1,40 +0,0 @@
|
||||
<div class="container">
|
||||
{foreach $data->feed->items as $item}
|
||||
<article class="media">
|
||||
<figure class="media-left">
|
||||
<p class="image is-64x64">
|
||||
<img src="{path('/stream?url=' . urlencode($item->author->avatarThumb))}" />
|
||||
</p>
|
||||
</figure>
|
||||
<div class="media-content">
|
||||
<div class="content">
|
||||
<p>
|
||||
<strong>{$item->author->nickname}</strong>
|
||||
<small>
|
||||
<a href="{path('/@' . $item->author->uniqueId)}">@{$item->author->uniqueId}</a>
|
||||
</small>
|
||||
<small title="{date('M d, Y H:i:s e', $item->createTime)}">{date('M d, Y', $item->createTime)}</small>
|
||||
</p>
|
||||
{if !empty($item->challenges)}
|
||||
<p>{include './common/tags.latte', challenges: $item->challenges}</p>
|
||||
{/if}
|
||||
<p n:ifcontent>{$item->desc}</p>
|
||||
{include './common/stats.latte', playCount: $item->stats->playCount, diggCount: $item->stats->diggCount, commentCount: $item->stats->commentCount, shareCount: $item->stats->shareCount}
|
||||
</div>
|
||||
<div class="has-text-centered">
|
||||
<video width="{$item->video->width}" height="{$item->video->height}" controls preload="none" poster="{path('/stream?url=' . urlencode($item->video->originCover))}">
|
||||
<source src="{path('/stream?url=' . $item->video->playAddr)}" type="video/mp4" />
|
||||
</video>
|
||||
</div>
|
||||
<div class="has-text-centered">
|
||||
{include './common/share.latte', uniqueId: $item->author->uniqueId, id: $item->id}
|
||||
{include './common/download.latte', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $item->author->uniqueId}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{/foreach}
|
||||
{if empty($data->feed->items)}
|
||||
<p class="title">No items sent by TikTok!</p>
|
||||
{/if}
|
||||
</div>
|
||||
{include './common/controls.latte'}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "pablouser1/proxitok",
|
||||
"description": "An alternative frontend for TikTok",
|
||||
"version": "2.3.2.2",
|
||||
"version": "2.4.9.1",
|
||||
"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.1"
|
||||
"pablouser1/tikscraper": "^2.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
Generated
+91
-48
@@ -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": "15ff00ea59afbf0d6d064d4cbefb05fb",
|
||||
"content-hash": "790ea9098323ef66c520cfe44b92b7d3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bramus/router",
|
||||
@@ -57,6 +57,46 @@
|
||||
},
|
||||
"time": "2021-11-18T19:24:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "deemon47/user-agent-generator",
|
||||
"version": "v1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Deemon47/user-agent-generator.git",
|
||||
"reference": "5af13fd2e905c5441eb4d61aad3a71bd1e801709"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Deemon47/user-agent-generator/zipball/5af13fd2e905c5441eb4d61aad3a71bd1e801709",
|
||||
"reference": "5af13fd2e905c5441eb4d61aad3a71bd1e801709",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Deemon47\\": "./"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-3.0-only"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "phpfail",
|
||||
"email": "phpfail@gihub.com"
|
||||
},
|
||||
{
|
||||
"name": "Dee",
|
||||
"email": "deemon47@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Generate random User-Agent http header with parameters",
|
||||
"support": {
|
||||
"source": "https://github.com/Deemon47/user-agent-generator/tree/v1.0.1"
|
||||
},
|
||||
"time": "2020-04-11T12:05:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "josegonzalez/dotenv",
|
||||
"version": "dev-master",
|
||||
@@ -117,22 +157,22 @@
|
||||
},
|
||||
{
|
||||
"name": "latte/latte",
|
||||
"version": "v2.11.5",
|
||||
"version": "v2.11.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nette/latte.git",
|
||||
"reference": "89e647e51213af8a270fe9903b8735a2f6c83ad1"
|
||||
"reference": "af4dbb23a6044b1cf4904830a9b00246318c93d4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nette/latte/zipball/89e647e51213af8a270fe9903b8735a2f6c83ad1",
|
||||
"reference": "89e647e51213af8a270fe9903b8735a2f6c83ad1",
|
||||
"url": "https://api.github.com/repos/nette/latte/zipball/af4dbb23a6044b1cf4904830a9b00246318c93d4",
|
||||
"reference": "af4dbb23a6044b1cf4904830a9b00246318c93d4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"php": ">=7.1 <8.2"
|
||||
"php": ">=7.1 <8.3"
|
||||
},
|
||||
"conflict": {
|
||||
"nette/application": "<2.4.1"
|
||||
@@ -195,9 +235,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nette/latte/issues",
|
||||
"source": "https://github.com/nette/latte/tree/v2.11.5"
|
||||
"source": "https://github.com/nette/latte/tree/v2.11.6"
|
||||
},
|
||||
"time": "2022-06-26T10:12:18+00:00"
|
||||
"time": "2022-11-04T14:53:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "m1/env",
|
||||
@@ -263,19 +303,20 @@
|
||||
},
|
||||
{
|
||||
"name": "pablouser1/tikscraper",
|
||||
"version": "v2.1.2.0",
|
||||
"version": "v2.3.6.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
||||
"reference": "96326226e54de2d1feedcc708200ba023a0553e5"
|
||||
"reference": "b26764777121dbc4408f84140b802869a77b575e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/96326226e54de2d1feedcc708200ba023a0553e5",
|
||||
"reference": "96326226e54de2d1feedcc708200ba023a0553e5",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/b26764777121dbc4408f84140b802869a77b575e",
|
||||
"reference": "b26764777121dbc4408f84140b802869a77b575e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"deemon47/user-agent-generator": "^1.0",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-xml": "*",
|
||||
@@ -284,7 +325,7 @@
|
||||
"sapistudio/seleniumstealth": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5"
|
||||
"pestphp/pest": "^1.22"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -298,49 +339,51 @@
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Pablo Ferreiro"
|
||||
"name": "Pablo Ferreiro",
|
||||
"homepage": "https://pabloferreiro.es"
|
||||
}
|
||||
],
|
||||
"description": "Get data from TikTok API",
|
||||
"support": {
|
||||
"issues": "https://github.com/pablouser1/TikScraperPHP/issues",
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.1.2.0"
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.6.4"
|
||||
},
|
||||
"time": "2022-08-11T21:32:02+00:00"
|
||||
"time": "2023-04-05T15:08:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-webdriver/webdriver",
|
||||
"version": "1.12.1",
|
||||
"version": "1.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-webdriver/php-webdriver.git",
|
||||
"reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a"
|
||||
"reference": "3ea4f924afb43056bf9c630509e657d951608563"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/b27ddf458d273c7d4602106fcaf978aa0b7fe15a",
|
||||
"reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a",
|
||||
"url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/3ea4f924afb43056bf9c630509e657d951608563",
|
||||
"reference": "3ea4f924afb43056bf9c630509e657d951608563",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-zip": "*",
|
||||
"php": "^5.6 || ~7.0 || ^8.0",
|
||||
"php": "^7.3 || ^8.0",
|
||||
"symfony/polyfill-mbstring": "^1.12",
|
||||
"symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0 || ^6.0"
|
||||
"symfony/process": "^5.0 || ^6.0"
|
||||
},
|
||||
"replace": {
|
||||
"facebook/webdriver": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"ondram/ci-detector": "^2.1 || ^3.5 || ^4.0",
|
||||
"ergebnis/composer-normalize": "^2.20.0",
|
||||
"ondram/ci-detector": "^4.0",
|
||||
"php-coveralls/php-coveralls": "^2.4",
|
||||
"php-mock/php-mock-phpunit": "^1.1 || ^2.0",
|
||||
"php-mock/php-mock-phpunit": "^2.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||
"phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9",
|
||||
"phpunit/phpunit": "^9.3",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"symfony/var-dumper": "^3.3 || ^4.0 || ^5.0 || ^6.0"
|
||||
"symfony/var-dumper": "^5.0 || ^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-SimpleXML": "For Firefox profile creation"
|
||||
@@ -369,9 +412,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-webdriver/php-webdriver/issues",
|
||||
"source": "https://github.com/php-webdriver/php-webdriver/tree/1.12.1"
|
||||
"source": "https://github.com/php-webdriver/php-webdriver/tree/1.14.0"
|
||||
},
|
||||
"time": "2022-05-03T12:16:34+00:00"
|
||||
"time": "2023-02-09T12:12:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sapistudio/seleniumstealth",
|
||||
@@ -405,16 +448,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -429,7 +472,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -468,7 +511,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -484,20 +527,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
|
||||
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -506,7 +549,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -551,7 +594,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -567,20 +610,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-10T07:21:04+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v5.4.11",
|
||||
"version": "v5.4.22",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1"
|
||||
"reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1",
|
||||
"reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/4b850da0cc3a2a9181c1ed407adbca4733dc839b",
|
||||
"reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -613,7 +656,7 @@
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v5.4.11"
|
||||
"source": "https://github.com/symfony/process/tree/v5.4.22"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -629,7 +672,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-06-27T16:58:25+00:00"
|
||||
"time": "2023-03-06T21:29:33+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
||||
@@ -11,19 +11,54 @@ services:
|
||||
- API_CACHE=redis
|
||||
- REDIS_HOST=proxitok-redis
|
||||
- REDIS_PORT=6379
|
||||
- API_SIGNER=remote
|
||||
- API_SIGNER_URL=http://proxitok-signer:8080/signature
|
||||
volumes:
|
||||
- proxitok-cache:/cache
|
||||
depends_on:
|
||||
- redis
|
||||
- signer
|
||||
networks:
|
||||
- proxitok
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- CHOWN
|
||||
- SETGID
|
||||
- SETUID
|
||||
|
||||
redis:
|
||||
container_name: proxitok-redis
|
||||
image: redis:7-alpine
|
||||
command: redis-server --save 60 1 --loglevel warning
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxitok
|
||||
user: nobody
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
tmpfs:
|
||||
- /data:size=10M,mode=0770,uid=65534,gid=65534,noexec,nosuid,nodev
|
||||
cap_drop:
|
||||
- ALL
|
||||
|
||||
signer:
|
||||
container_name: proxitok-signer
|
||||
image: ghcr.io/pablouser1/signtok:master
|
||||
networks:
|
||||
- proxitok
|
||||
user: nobody
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
|
||||
volumes:
|
||||
proxitok-cache:
|
||||
|
||||
networks:
|
||||
proxitok:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 626 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
+3
@@ -10,8 +10,10 @@ $bulmaswatch-import-font: false;
|
||||
@import "./node_modules/bulma/sass/base/_all.sass";
|
||||
|
||||
// Elements
|
||||
@import "./node_modules/bulma/sass/elements/box.sass";
|
||||
@import "./node_modules/bulma/sass/elements/button.sass";
|
||||
@import "./node_modules/bulma/sass/elements/container.sass";
|
||||
@import "./node_modules/bulma/sass/elements/content.sass";
|
||||
@import "./node_modules/bulma/sass/elements/icon.sass";
|
||||
@import "./node_modules/bulma/sass/elements/image.sass";
|
||||
@import "./node_modules/bulma/sass/elements/other.sass";
|
||||
@@ -26,6 +28,7 @@ $bulmaswatch-import-font: false;
|
||||
@import "./node_modules/bulma/sass/form/tools.sass";
|
||||
|
||||
// Components
|
||||
@import "./node_modules/bulma/sass/components/breadcrumb.sass";
|
||||
@import "./node_modules/bulma/sass/components/card.sass";
|
||||
@import "./node_modules/bulma/sass/components/dropdown.sass";
|
||||
@import "./node_modules/bulma/sass/components/media.sass";
|
||||
@@ -1,7 +1,9 @@
|
||||
@charset "utf-8";
|
||||
// Common
|
||||
@import "./node_modules/css.gg/icons/scss/home.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/options.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/info.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/code-slash.scss";
|
||||
|
||||
// Home
|
||||
@import "./node_modules/css.gg/icons/scss/search.scss";
|
||||
@@ -13,3 +15,10 @@
|
||||
@import "./node_modules/css.gg/icons/scss/comment.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/share.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/software-download.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/check-o.scss";
|
||||
|
||||
@import "./node_modules/css.gg/icons/scss/lock.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/lock-unlock.scss";
|
||||
|
||||
// Video
|
||||
@import "./node_modules/css.gg/icons/scss/music.scss";
|
||||
@@ -2,8 +2,8 @@
|
||||
"name": "proxitok-scss",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"bulma": "sass --style=compressed bulma.scss ../styles/vendor/bulma.min.css",
|
||||
"cssgg": "sass --style=compressed cssgg.scss ../styles/vendor/cssgg.min.css"
|
||||
"bulma": "sass --style=compressed bulma.scss ../../styles/vendor/bulma.min.css",
|
||||
"cssgg": "sass --style=compressed cssgg.scss ../../styles/vendor/cssgg.min.css"
|
||||
},
|
||||
"dependencies": {
|
||||
"bulma": "^0.9.3",
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
|
||||
anymatch@~3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
|
||||
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
|
||||
integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
|
||||
dependencies:
|
||||
normalize-path "^3.0.0"
|
||||
picomatch "^2.0.4"
|
||||
@@ -118,9 +118,9 @@ readdirp@~3.6.0:
|
||||
picomatch "^2.2.1"
|
||||
|
||||
sass@^1.46.0:
|
||||
version "1.53.0"
|
||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.53.0.tgz#eab73a7baac045cc57ddc1d1ff501ad2659952eb"
|
||||
integrity sha512-zb/oMirbKhUgRQ0/GFz8TSAwRq2IlR29vOUJZOx0l8sV+CkHUfHa4u5nqrG+1VceZp7Jfj59SVW9ogdhTvJDcQ==
|
||||
version "1.56.1"
|
||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.56.1.tgz#94d3910cd468fd075fa87f5bb17437a0b617d8a7"
|
||||
integrity sha512-VpEyKpyBPCxE7qGDtOcdJ6fFbcpOM+Emu7uZLxVrkX8KVU/Dp5UF7WLvzqRuUhB6mqqQt1xffLoG+AndxTZrCQ==
|
||||
dependencies:
|
||||
chokidar ">=3.0.0 <4.0.0"
|
||||
immutable "^4.0.0"
|
||||
+41
-7
@@ -1,27 +1,60 @@
|
||||
<?php
|
||||
/** @var \Bramus\Router\Router $router */
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\BaseTemplate;
|
||||
|
||||
$router->set404(function () {
|
||||
ErrorHandler::showText(404, "That endpoint doesn't exist");
|
||||
});
|
||||
|
||||
$router->get('/', function () {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('home'), new BaseTemplate('Home'));
|
||||
Wrappers::latte('home', new BaseTemplate('Home'));
|
||||
});
|
||||
|
||||
$router->get('/about', function () {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('about'), new BaseTemplate('About'));
|
||||
Wrappers::latte('about', new BaseTemplate('About'));
|
||||
});
|
||||
|
||||
$router->get('/verify', function () {
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('verify'), new BaseTemplate('Verify'));
|
||||
Wrappers::latte('verify', new BaseTemplate('verify'));
|
||||
});
|
||||
|
||||
$router->get('/manifest', function () {
|
||||
header('Content-Type: application/json');
|
||||
$data = [
|
||||
"name" => "ProxiTok",
|
||||
"short_name" => "ProxiTok",
|
||||
"description" => "Use TikTok with a privacy-friendly alternative frontend",
|
||||
"lang" => "en-US",
|
||||
"theme_color" => "#4040ff",
|
||||
"background_color" => "#ffffff",
|
||||
"display" => "standalone",
|
||||
"orientation" => "portrait-primary",
|
||||
"icons" => [
|
||||
[
|
||||
"src" => Misc::url('/android-chrome-192x192.png'),
|
||||
"sizes" => "192x192",
|
||||
"type" => "image/png"
|
||||
],
|
||||
[
|
||||
"src" => Misc::url('/android-chrome-512x512.png'),
|
||||
"sizes" => "512x512",
|
||||
"type" => "image/png"
|
||||
]
|
||||
],
|
||||
"start_url" => Misc::url('/'),
|
||||
"scope" => Misc::url('/')
|
||||
];
|
||||
echo json_encode($data, JSON_PRETTY_PRINT);
|
||||
});
|
||||
|
||||
$router->get('/stream', 'ProxyController@stream');
|
||||
$router->get('/download', 'ProxyController@download');
|
||||
$router->get('/redirect', 'RedirectController@redirect');
|
||||
$router->get('/redirect/search', 'RedirectController@search');
|
||||
$router->get('/redirect/download', 'RedirectController@download');
|
||||
|
||||
$router->mount('/trending', function () use ($router) {
|
||||
$router->get('/', 'TrendingController@get');
|
||||
@@ -51,6 +84,7 @@ $router->mount('/settings', function () use ($router) {
|
||||
$router->get('/', 'SettingsController@index');
|
||||
$router->post('/general', 'SettingsController@general');
|
||||
$router->post('/api', 'SettingsController@api');
|
||||
$router->post('/misc', 'SettingsController@misc');
|
||||
});
|
||||
|
||||
$router->get('/discover', 'DiscoverController@get');
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
CREDITS:
|
||||
CSS Taken from: https://levelup.gitconnected.com/how-to-make-a-fully-accessible-css-only-carousel-40e8bd62032b
|
||||
Author: Jennifer Wjertzoch (https://wjertzochjennifer.medium.com)
|
||||
CodePen: https://codepen.io/jwjertzoch/pen/JjyGeRy
|
||||
*/
|
||||
|
||||
.carousel {
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.slides {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
overflow-x: scroll;
|
||||
scrollbar-width: none;
|
||||
scroll-snap-type: x mandatory;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
.slides::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.slides-item {
|
||||
max-height: 75vh;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
justify-content: center;
|
||||
margin: 0 1rem;
|
||||
position: relative;
|
||||
scroll-snap-align: start;
|
||||
transform: scale(1);
|
||||
transform-origin: center center;
|
||||
transition: transform .5s;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.slides-item img {
|
||||
max-height: 75vh;
|
||||
}
|
||||
|
||||
.carousel__nav {
|
||||
padding: 1.25rem .5rem;
|
||||
}
|
||||
|
||||
.slider-nav {
|
||||
align-items: center;
|
||||
background-color: #ddd;
|
||||
border-radius: 50%;
|
||||
color: #000;
|
||||
display: inline-flex;
|
||||
height: 1.5rem;
|
||||
justify-content: center;
|
||||
padding: .5rem;
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
width: 1.5rem;
|
||||
}
|
||||
|
||||
.slider-nav:hover,
|
||||
.slider-nav:active {
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.new-line {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sourceRoot":"","sources":["../../scss/node_modules/css.gg/icons/scss/home.scss","../../scss/node_modules/css.gg/icons/scss/info.scss","../../scss/node_modules/css.gg/icons/scss/search.scss","../../scss/node_modules/css.gg/icons/scss/feed.scss","../../scss/node_modules/css.gg/icons/scss/eye.scss","../../scss/node_modules/css.gg/icons/scss/heart.scss","../../scss/node_modules/css.gg/icons/scss/comment.scss","../../scss/node_modules/css.gg/icons/scss/share.scss","../../scss/node_modules/css.gg/icons/scss/software-download.scss"],"names":[],"mappings":"AAAA,SACE,yLACA,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,aACA,gBACA,4BACA,2BACA,6BACA,4BACA,mBAEA,gBACE,WACA,cACA,sBACA,kBAGF,iBACE,WACA,cACA,sBACA,kBACA,qBACA,sBACA,2BACA,wBACA,SACA,kBACA,WACA,YACA,OAGF,gBACE,UACA,YACA,iBACA,oBACA,4BACA,6BACA,gBACA,SACA,SCjDJ,SACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,mBAEA,iCACE,WACA,cACA,sBACA,kBACA,kBACA,UACA,wBACA,SAGF,gBACE,WACA,WAGF,iBACE,WACA,QC5BN,WACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,mBACA,iBACA,gBAEA,kBACE,WACA,cACA,sBACA,kBACA,kBACA,UACA,WACA,wBACA,yBACA,SACA,UCvBN,SACI,cACA,sBACA,wBACA,sBASA,iBACA,gBACA,kBACA,+BACA,UACA,WACA,kBAbA,iCACE,cACA,sBACA,wBACA,sBAWF,iCACE,WACA,kBACA,kBACA,WACA,WACA,QACA,SACA,WAGF,gBACE,UACA,QACA,WCnCN,QACI,kBACA,cACA,+BACA,WACA,YACA,iCACA,gCACA,gBACA,sBAEA,+BACE,WACA,cACA,oBACA,kBACA,sBAGF,eACE,QACA,8CACA,WACA,YAGF,gBACE,UACA,WACA,iBACA,WACA,SC/BN,UACI,iBACA,6BACA,8BACA,WACA,WACA,gBAeA,sBACA,kBACA,gHACA,cAhBA,iBACE,iBACA,6BACA,8BACA,WACA,WACA,gBACA,WACA,cACA,sBACA,kBAQF,kBACE,WACA,cACA,sBACA,kBAGF,iBACE,WACA,wBACA,QAGF,kBACE,WACA,YACA,sBACA,wBACA,UACA,QC7CN,YACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,gBACA,0CAEA,mBACE,WACA,cACA,sBACA,kBACA,UAGF,oBACE,WACA,cACA,sBACA,kBACA,UACA,iBACA,+BACA,+BACA,UACA,YACA,WAGF,mBACE,WACA,wBACA,qBACA,SACA,QCtCN,UACI,sBACA,kBACA,cACA,+BACA,UACA,WACA,wBACA,oBACA,kCAEA,iBACE,WACA,cACA,sBACA,kBACA,kBACA,WACA,WACA,wBACA,SAGF,kBACE,WACA,cACA,sBACA,kBACA,kBACA,WACA,WACA,wBACA,SACA,MACA,yBAGF,iBACE,SACA,wBCvCN,sBACI,sBACA,kBACA,cACA,+BACA,WACA,WACA,iBACA,aACA,8BACA,+BACA,eAEA,6BACE,WACA,cACA,sBACA,kBACA,UACA,WACA,sBACA,wBACA,yBACA,SACA,WAGF,8BACE,WACA,cACA,sBACA,kBACA,kBACA,UACA,YACA,wBACA,SACA","file":"cssgg.min.css"}
|
||||
{"version":3,"sourceRoot":"","sources":["../../misc/scss/node_modules/css.gg/icons/scss/home.scss","../../misc/scss/node_modules/css.gg/icons/scss/options.scss","../../misc/scss/node_modules/css.gg/icons/scss/info.scss","../../misc/scss/node_modules/css.gg/icons/scss/code-slash.scss","../../misc/scss/node_modules/css.gg/icons/scss/search.scss","../../misc/scss/node_modules/css.gg/icons/scss/feed.scss","../../misc/scss/node_modules/css.gg/icons/scss/eye.scss","../../misc/scss/node_modules/css.gg/icons/scss/heart.scss","../../misc/scss/node_modules/css.gg/icons/scss/comment.scss","../../misc/scss/node_modules/css.gg/icons/scss/share.scss","../../misc/scss/node_modules/css.gg/icons/scss/software-download.scss","../../misc/scss/node_modules/css.gg/icons/scss/check-o.scss","../../misc/scss/node_modules/css.gg/icons/scss/lock.scss","../../misc/scss/node_modules/css.gg/icons/scss/lock-unlock.scss","../../misc/scss/node_modules/css.gg/icons/scss/music.scss"],"names":[],"mappings":"AAAA,SACE,yLACA,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,aACA,gBACA,4BACA,2BACA,6BACA,4BACA,mBAEA,gBACE,WACA,cACA,sBACA,kBAGF,iBACE,WACA,cACA,sBACA,kBACA,qBACA,sBACA,2BACA,wBACA,SACA,kBACA,WACA,YACA,OAGF,gBACE,UACA,YACA,iBACA,oBACA,4BACA,6BACA,gBACA,SACA,SCjDJ,YACI,sBACA,kBACA,cACA,+BACA,WACA,WACA,qCAEA,mBACE,WACA,cACA,sBACA,kBACA,UACA,WACA,iBACA,mBAGF,oBACE,WACA,cACA,sBACA,kBACA,UACA,WACA,iBACA,mBACA,SACA,UAGF,mBACE,YACA,WCnCN,SACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,mBAEA,iCACE,WACA,cACA,sBACA,kBACA,kBACA,UACA,wBACA,SAGF,gBACE,WACA,WAGF,iBACE,WACA,QC5BN,eACI,cACA,kBACA,sBACA,6CACA,UACA,YACA,wBAEA,sBACE,WACA,cACA,sBACA,kBACA,UACA,WACA,yBAGF,uBACE,WACA,cACA,sBACA,kBACA,UACA,WACA,yBACA,sBACA,qBACA,UACA,QAGF,sBACE,uBACA,wBACA,WACA,QCrCN,WACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,mBACA,iBACA,gBAEA,kBACE,WACA,cACA,sBACA,kBACA,kBACA,UACA,WACA,wBACA,yBACA,SACA,UCvBN,SACI,cACA,sBACA,wBACA,sBASA,iBACA,gBACA,kBACA,+BACA,UACA,WACA,kBAbA,iCACE,cACA,sBACA,wBACA,sBAWF,iCACE,WACA,kBACA,kBACA,WACA,WACA,QACA,SACA,WAGF,gBACE,UACA,QACA,WCnCN,QACI,kBACA,cACA,+BACA,WACA,YACA,iCACA,gCACA,gBACA,sBAEA,+BACE,WACA,cACA,oBACA,kBACA,sBAGF,eACE,QACA,8CACA,WACA,YAGF,gBACE,UACA,WACA,iBACA,WACA,SC/BN,UACI,iBACA,6BACA,8BACA,WACA,WACA,gBAeA,sBACA,kBACA,gHACA,cAhBA,iBACE,iBACA,6BACA,8BACA,WACA,WACA,gBACA,WACA,cACA,sBACA,kBAQF,kBACE,WACA,cACA,sBACA,kBAGF,iBACE,WACA,wBACA,QAGF,kBACE,WACA,YACA,sBACA,wBACA,UACA,QC7CN,YACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,gBACA,0CAEA,mBACE,WACA,cACA,sBACA,kBACA,UAGF,oBACE,WACA,cACA,sBACA,kBACA,UACA,iBACA,+BACA,+BACA,UACA,YACA,WAGF,mBACE,WACA,wBACA,qBACA,SACA,QCtCN,UACI,sBACA,kBACA,cACA,+BACA,UACA,WACA,wBACA,oBACA,kCAEA,iBACE,WACA,cACA,sBACA,kBACA,kBACA,WACA,WACA,wBACA,SAGF,kBACE,WACA,cACA,sBACA,kBACA,kBACA,WACA,WACA,wBACA,SACA,MACA,yBAGF,iBACE,SACA,wBCvCN,sBACI,sBACA,kBACA,cACA,+BACA,WACA,WACA,iBACA,aACA,8BACA,+BACA,eAEA,6BACE,WACA,cACA,sBACA,kBACA,UACA,WACA,sBACA,wBACA,yBACA,SACA,WAGF,8BACE,WACA,cACA,sBACA,kBACA,kBACA,UACA,YACA,wBACA,SACA,WCrCN,YACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,oBAEA,mBACE,WACA,cACA,sBACA,kBACA,SACA,SACA,UACA,YACA,0BACA,yBACA,mBACA,6BACA,wBCvBN,SACI,sBACA,kBACA,cACA,+BACA,WACA,YACA,iBACA,4BACA,2BACA,4BACA,iBAEA,gBACE,WACA,cACA,sBACA,kBACA,WACA,YACA,kBACA,+BACA,qBACA,UACA,QCxBN,gBACI,sBACA,kBACA,cACA,+BACA,WACA,WACA,iBACA,8BACA,6BACA,4BACA,iBACA,iBAEA,+CACE,WACA,cACA,sBACA,kBAGF,uBACE,+BACA,qBACA,WACA,YACA,kBACA,UACA,SAGF,wBACE,UACA,WACA,wBACA,UACA,QCpCN,UACI,cACA,sBACA,iBAQA,2BACA,4BACA,gBACA,gBACA,kBACA,6CACA,WACA,YAbA,mCACE,cACA,sBACA,iBAYF,mCACE,WACA,kBACA,UACA,WACA,QACA,UACA,uBACA,mBAGF,iBACE","file":"cssgg.min.css"}
|
||||
@@ -0,0 +1,4 @@
|
||||
<details>
|
||||
<summary>{$title}</summary>
|
||||
{block content}{/block}
|
||||
</details>
|
||||
@@ -0,0 +1,37 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{path('/apple-touch-icon.png')}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{path('/favicon-32x32.png')}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{path('/favicon-16x16.png')}">
|
||||
<link rel="manifest" href="{path('/manifest')}">
|
||||
{if isset($og, $og_content, $og_url)}
|
||||
<!-- Using TikTok's meta config -->
|
||||
<meta property="og:title" content="{$og->title}" />
|
||||
<meta property="og:description" content="{$og->description}" />
|
||||
<meta property="og:url" content="{$og_url}" />
|
||||
<meta property="og:image" content="{url_stream($og_content)}" />
|
||||
<meta property="twitter:title" content="{$og->title}" />
|
||||
<meta property="twitter:description" content="{$og->description}" />
|
||||
<meta property="twitter:image" content="{url_stream($og_content)}" />
|
||||
{else}
|
||||
<!-- Using predifined ProxiTok config -->
|
||||
<meta property="og:title" content="{$title}" />
|
||||
<meta property="og:description" content="Alternative frontend for TikTok" />
|
||||
<meta property="twitter:title" content="{$title}" />
|
||||
<meta property="twitter:description" content="Alternative frontend for TikTok" />
|
||||
{/if}
|
||||
<meta property="og:site_name" content="ProxiTok" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
<meta property="twitter:site" content="ProxiTok" />
|
||||
{if isset($has_rss)}
|
||||
<link rel="alternate" type="application/rss+xml" title="{$title}" href="{$_SERVER['REQUEST_URI'] . '/rss'}" />
|
||||
{/if}
|
||||
<link rel="stylesheet" href="{static('css', 'cssgg.min.css', true)}">
|
||||
<link rel="stylesheet" href="{static('css', 'bulma.min.css', true)}">
|
||||
<link rel="stylesheet" href="{static('css', 'misc.css')}">
|
||||
<link rel="stylesheet" href="{static('css', 'carousel.css')}">
|
||||
<title>{$title} - ProxiTok</title>
|
||||
</head>
|
||||
@@ -1,5 +1,8 @@
|
||||
<nav class="navbar" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-brand">
|
||||
<a href="{path('/')}" class="navbar-item">
|
||||
{include './icon.latte', icon: 'home', text: 'ProxiTok'}
|
||||
</a>
|
||||
<a role="button" id="navbar-burger" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
@@ -9,14 +12,18 @@
|
||||
|
||||
<div id="navbar-menu" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<a href="{path('/')}" class="navbar-item">
|
||||
{include './icon.latte', icon: 'home', text: 'Home'}
|
||||
<a href="{path('/settings')}" class="navbar-item">
|
||||
{include './icon.latte', icon: 'options', text: 'Settings'}
|
||||
</a>
|
||||
<a href="{path('/settings')}" class="navbar-item">Settings</a>
|
||||
<a href="{path('/about')}" class="navbar-item">
|
||||
{include './icon.latte', icon: 'info', text: 'About'}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<a href="https://github.com/pablouser1/ProxiTok" class="navbar-item" target="_blank">
|
||||
{include './icon.latte', icon: 'code-slash', text: 'Source'}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<script src="{path('/scripts/navbar.js')}"></script>
|
||||
<script src="{static('js', 'navbar.js')}"></script>
|
||||
@@ -0,0 +1,31 @@
|
||||
{embed '../form.latte', path: '/settings/api', method: 'POST', submit: true}
|
||||
{block fields}
|
||||
<div class="field">
|
||||
<label class="label">Use test endpoints</label>
|
||||
<div class="control">
|
||||
<label class="radio">
|
||||
<input type="radio" name="api-test_endpoints" value="yes" n:attr="checked => $isTestEndpoints" />
|
||||
<span>Yes</span>
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="api-test_endpoints" value="no" n:attr="checked => !$isTestEndpoints" />
|
||||
<span>No</span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="help">This <i>may</i> help bypass rate limits</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Downloader</label>
|
||||
<div class="control">
|
||||
<div class="select">
|
||||
<select name="api-downloader">
|
||||
{foreach $downloaders as $downloader}
|
||||
<option value="{$downloader}" n:attr="selected => $currentDownloader === $downloader">{$downloader|firstUpper}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p class="help">Watermark downloads will <i>not</i> use third party methods</p>
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
@@ -0,0 +1,16 @@
|
||||
{embed '../form.latte', path: '/settings/general', method: 'POST', submit: true}
|
||||
{block fields}
|
||||
<div class="field">
|
||||
<label class="label">Theme</label>
|
||||
<div class="control">
|
||||
<div class="select">
|
||||
<select name="theme">
|
||||
{foreach $themes as $theme}
|
||||
<option value="{$theme}" n:attr="selected => $currentTheme === $theme">{$theme|firstUpper}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
@@ -1,23 +1,23 @@
|
||||
<link rel="stylesheet" href="{path('/styles/themes/card.css')}">
|
||||
<noscript>JavaScript is required for this section to work!</noscript>
|
||||
<link rel="stylesheet" href="{static('css', 'themes/card.css')}">
|
||||
<section class="section">
|
||||
<noscript>JavaScript is required for this section to work!</noscript>
|
||||
<div class="columns is-multiline is-vcentered">
|
||||
{foreach $data->feed->items as $item}
|
||||
{do $share_url = 'https://tiktok.com/@' . $item->author->uniqueId . '/video/' . $item->id}
|
||||
{foreach $feed->items as $item}
|
||||
{do $share_url = url_video_external($item->author->uniqueId, $item->id)}
|
||||
<div class="column is-one-quarter clickable-img" id="{$item->id}" onclick="openVideo(this.id)"
|
||||
data-video_url="{path('/stream?url=' . urlencode($item->video->playAddr))}"
|
||||
data-video_download_watermark="{path('/download?url=' . urlencode($item->video->playAddr) . '&id=' . $item->id . '&user=' . $item->author->uniqueId) . '&watermark='}"
|
||||
data-video_download_nowatermark="{path('/download?id=' . $item->id . '&user=' . $item->author->uniqueId)}"
|
||||
data-video_url="{url_stream($item->video->playAddr)}"
|
||||
data-video_download_watermark="{url_download($item->video->playAddr, $item->author->uniqueId, $item->id, true)}"
|
||||
data-video_download_nowatermark="{url_download(url_video_external($item->author->uniqueId, $item->id), $item->author->uniqueId, $item->id, false)}"
|
||||
data-video_share_url="{$share_url}"
|
||||
data-desc="{$item->desc}"
|
||||
data-createtime="{$item->createTime}"
|
||||
data-music_title="{$item->music->title}"
|
||||
data-music_url="{path('/stream?url=' . urlencode($item->music->playUrl))}">
|
||||
<img loading="lazy" src="{path('/stream?url=' . urlencode($item->video->originCover))}" />
|
||||
<img class="hidden" loading="lazy" data-src="{path('/stream?url=' . urlencode($item->video->dynamicCover))}" />
|
||||
data-music_url="{url_stream($item->music->playUrl)}">
|
||||
<img loading="lazy" src="{url_stream($item->video->originCover)}" />
|
||||
<img class="hidden" loading="lazy" data-src="{url_stream($item->video->dynamicCover)}" />
|
||||
</div>
|
||||
{/foreach}
|
||||
{if empty($data->feed->items)}
|
||||
{if empty($feed->items)}
|
||||
<p class="title">No items sent by TikTok!</p>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -67,4 +67,4 @@
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{path('/scripts/themes/card.js')}"></script>
|
||||
<script src="{static('js', 'themes/card.js')}"></script>
|
||||
@@ -0,0 +1,27 @@
|
||||
{if !isset($item->imagePost)}
|
||||
<video controls n:attr="autoplay => $isAutoplay" poster="{url_stream($item->video->originCover)}" preload="none">
|
||||
<source src="{url_stream($item->video->playAddr)}" type="video/mp4" />
|
||||
</video>
|
||||
{else}
|
||||
{if isset($isSimple)}
|
||||
{foreach $item->imagePost->images as $i => $image}
|
||||
<img src="{url_stream($image->imageURL->urlList[0])}" />
|
||||
{/foreach}
|
||||
{else}
|
||||
<section class="carousel" aria-label="carousel" Tabindex="0">
|
||||
<div class="slides">
|
||||
{foreach $item->imagePost->images as $i => $image}
|
||||
<div class="slides-item" id="{$item->id}-image{$i + 1}" tabindex="0">
|
||||
<img src="{url_stream($image->imageURL->urlList[0])}" />
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<div class="carousel__nav">
|
||||
{for $i = 0; $i < count($item->imagePost->images); $i++}
|
||||
<a class="slider-nav" href="#{$item->id}-image{$i + 1}">{$i + 1}</a>
|
||||
{/for}
|
||||
</div>
|
||||
<div class="carousel__skip-message" id="skip-link" tabindex="0"></div>
|
||||
</section>
|
||||
{/if}
|
||||
{/if}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
<div n:ifset="$data->info" class="buttons">
|
||||
<div class="buttons">
|
||||
{* is_numeric is used to avoid having a back button with ttwid cursors *}
|
||||
{if isset($_GET['cursor']) && is_numeric($_GET['cursor']) && $_GET['cursor'] != 0}
|
||||
<a class="button is-danger" href="?cursor=0">First</a>
|
||||
{/if}
|
||||
<a n:attr="disabled => !$data->feed->hasMore" class="button is-success" href="?cursor={$data->feed->maxCursor}">Next</a>
|
||||
<a n:attr="disabled => !$feed->hasMore" class="button is-success" href="?cursor={$feed->maxCursor}">Next</a>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="field is-grouped is-grouped-centered">
|
||||
<p class="control">
|
||||
<a target="_blank" href="{url_download($playAddr, $uniqueId, $id, true)}" class="button is-info">Watermark</a>
|
||||
</p>
|
||||
<p class="control">
|
||||
<a target="_blank" href="{url_download(url_video_external($uniqueId, $id), $uniqueId, $id, false)}" class="button is-success">No watermark</a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
<div class="field is-grouped is-grouped-centered">
|
||||
<p class="control">
|
||||
<a class="button is-success" href="{url_video_internal($uniqueId, $id)}">
|
||||
{include '../../icon.latte', icon: 'lock', text: 'Instance'}
|
||||
</a>
|
||||
</p>
|
||||
<p class="control">
|
||||
<a class="button is-warning" href="{url_video_external($uniqueId, $id)}">
|
||||
{include '../../icon.latte', icon: 'lock-unlock', text: 'Original'}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div class="tags">
|
||||
{foreach $challenges as $challenge}
|
||||
<a class="tag is-primary is-rounded" href="{path('/tag/' . $challenge->title)}">#{$challenge->title}</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
@@ -0,0 +1,51 @@
|
||||
<div class="container">
|
||||
{foreach $feed->items as $item}
|
||||
<article class="media">
|
||||
<figure class="media-left">
|
||||
<p class="image is-64x64">
|
||||
<img class="is-rounded" src="{url_stream($item->author->avatarThumb)}" />
|
||||
</p>
|
||||
</figure>
|
||||
<div class="media-content">
|
||||
<p>
|
||||
<strong>{$item->author->nickname}</strong>
|
||||
<small>
|
||||
<a href="{url_user($item->author->uniqueId)}">@{$item->author->uniqueId}</a>
|
||||
</small>
|
||||
<small title="{date('M d, Y H:i:s e', $item->createTime)}">{date('M d, Y', $item->createTime)}</small>
|
||||
</p>
|
||||
{if !empty($item->challenges)}
|
||||
<p>{include './common/tags.latte', challenges: $item->challenges}</p>
|
||||
{/if}
|
||||
<p n:ifcontent>{render_desc($item->desc, $item->textExtra ?? [])|noescape}</p>
|
||||
<p>Song: {$item->music->title}</p>
|
||||
<audio controls preload="none" src="{url_stream($item->music->playUrl)}"></audio>
|
||||
{include './common/stats.latte', playCount: $item->stats->playCount, diggCount: $item->stats->diggCount, commentCount: $item->stats->commentCount, shareCount: $item->stats->shareCount}
|
||||
<div class="has-text-centered">
|
||||
{include './common/content.latte', item: $item, isAutoplay: false, isBig: false}
|
||||
</div>
|
||||
{if isset($item->video->playAddr) && $item->video->playAddr !== ""}
|
||||
<!-- Download links, not shown if item is a gallery -->
|
||||
<p class="has-text-centered"><b>Download video</b></p>
|
||||
{include './common/download.latte', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $item->author->uniqueId}
|
||||
{/if}
|
||||
<p class="has-text-centered"><b>Share link</b></p>
|
||||
{include './common/share.latte', uniqueId: $item->author->uniqueId, id: $item->id}
|
||||
<div class="has-text-centered">
|
||||
{embed '../details.latte', title: "Details"}
|
||||
{block content}
|
||||
<p>Is Ad: {bool_to_str($item->isAd)}
|
||||
<p>Can duet: {bool_to_str($item->duetEnabled)}</p>
|
||||
<p>Can stitch (add this video to other ones): {bool_to_str($item->stitchEnabled)}</p>
|
||||
<p>Can be shared: {bool_to_str($item->shareEnabled)}
|
||||
{/block}
|
||||
{/embed}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{/foreach}
|
||||
{if empty($feed->items)}
|
||||
<p class="title">No items sent by TikTok!</p>
|
||||
{/if}
|
||||
</div>
|
||||
{include './common/controls.latte'}
|
||||
@@ -9,7 +9,7 @@
|
||||
{include '../components/navbar.latte'}
|
||||
</div>
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<div class="container">
|
||||
{block content}{/block}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,40 @@
|
||||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">Welcome to ProxiTok!</p>
|
||||
<p class="subtitle">
|
||||
Made with <span style="color: #e25555;">♥</span> in <a href="https://github.com/pablouser1/ProxiTok">Github</a>
|
||||
</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
<div class="content">
|
||||
<p class="title">About this instance</p>
|
||||
<p>Frontend version: <b>{version_frontend()}</b></p>
|
||||
<p>Scraper version: <b>{version_scraper()}</b></p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="title">Why would I want to use ProxiTok?</p>
|
||||
<p>
|
||||
There are already
|
||||
<a rel="nofollow" href="https://penetrum.com/tiktok/Penetrum_TikTok_Security_Analysis_whitepaper.pdf">multiple</a>
|
||||
<a rel="nofollow" href="https://rufposten.de/blog/2019/12/05/privacy-analysis-of-tiktoks-app-and-website">articles</a>
|
||||
<a rel="nofollow" href="https://citizenlab.ca/2021/03/tiktok-vs-douyin-security-privacy-analysis">explaining</a>
|
||||
Tiktok's privacy issues.
|
||||
This program allows you to browse TikTok without having to worry about privacy concerns.
|
||||
</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="title">Third party</p>
|
||||
<p>
|
||||
This project wouldn't be possible without the help of the following projects:
|
||||
<ul>
|
||||
<li><a rel="nofollow" href="https://github.com/pablouser1/TikScraperPHP">TikScraperPHP</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/nette/latte">Latte</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/bramus/router">bramus/router</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/josegonzalez/php-dotenv">php-dotenv</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/jgthms/bulma">Bulma</a> and <a href="https://github.com/jenil/bulmaswatch">Bulmaswatch</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -5,7 +5,7 @@
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{foreach $data->feed->items as $type => $items}
|
||||
{foreach $data->items as $type => $items}
|
||||
<p class="title">{$type|firstUpper}</p>
|
||||
<div class="columns is-multiline is-vcentered">
|
||||
{foreach $items as $item}
|
||||
@@ -0,0 +1,18 @@
|
||||
{layout '../layouts/hero.latte'}
|
||||
|
||||
{block content}
|
||||
<p class="title">There was an error processing your request!</p>
|
||||
<div class="content">
|
||||
<p>HTTP Code: {$http_code}</p>
|
||||
{if isset($tiktok_code)}
|
||||
<p>
|
||||
<span>API error code {$tiktok_code} ({$msg})</span>
|
||||
{if $tiktok_code === 10000 || $tiktok_code === -1}
|
||||
<a href="{path('/verify')}">What does this mean?</a>
|
||||
{/if}
|
||||
</p>
|
||||
{else}
|
||||
<p>{$msg}</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/block}
|
||||
@@ -1,9 +1,9 @@
|
||||
{layout '../layouts/hero.latte'}
|
||||
|
||||
{block content}
|
||||
<p class="title">Welcome to ProxiTok!</p>
|
||||
<p class="subtitle">An alternative open source frontend for TikTok</p>
|
||||
{embed '../components/form.latte', path: '/redirect', method: 'GET'}
|
||||
<p class="title has-text-centered">Welcome to ProxiTok!</p>
|
||||
<p class="subtitle has-text-centered">An alternative open source frontend for TikTok</p>
|
||||
{embed '../components/form.latte', path: '/redirect/search', method: 'GET'}
|
||||
{block fields}
|
||||
<div class="field has-addons has-addons-centered">
|
||||
<div class="control">
|
||||
@@ -0,0 +1,11 @@
|
||||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">{$info->detail->title}</p>
|
||||
<p class="subtitle">{$info->detail->desc}</p>
|
||||
<p>Videos: {number($info->stats->videoCount)}</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{include '../components/feed.latte'}
|
||||
{/block}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{$title}</title>
|
||||
<description><![CDATA[{$desc}]]></description>
|
||||
<link>{$link}</link>
|
||||
<atom:link href="{$link . '/rss'}" rel="self" type="application/rss+xml"></atom:link>
|
||||
{foreach $items as $item}
|
||||
<item>
|
||||
<title>{$item->desc}</title>
|
||||
<description><![CDATA[<p n:ifcontent>{render_desc($item->desc, $item->textExtra ?? [])|noescape}</p>{include '../components/themes/common/content.latte', item: $item, isAutoplay: false, isSimple: true}]]></description>
|
||||
<link>{url_video_internal($item->author->uniqueId, $item->id)}</link>
|
||||
<pubDate>{date('r', $item->createTime)}</pubDate>
|
||||
<guid isPermaLink="false">{$item->id}</guid>
|
||||
</item>
|
||||
{/foreach}
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -0,0 +1,17 @@
|
||||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">Settings</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
<div class="content">
|
||||
<p class="title">General</p>
|
||||
{include '../components/settings/general.latte'}
|
||||
</div>
|
||||
<hr />
|
||||
<div class="content">
|
||||
<p class="title">Api</p>
|
||||
{include '../components/settings/api.latte'}
|
||||
</div>
|
||||
{/block}
|
||||
@@ -0,0 +1,27 @@
|
||||
{layout '../layouts/default.latte'}
|
||||
|
||||
{var $has_rss = true}
|
||||
|
||||
{var $og = $info->meta->og}
|
||||
{var $og_content = $info->detail->profileLarger}
|
||||
{var $og_url = url_tag($info->detail->title)}
|
||||
|
||||
{block header}
|
||||
{if $info->detail->profileLarger !== ''}
|
||||
<figure class="image is-inline-block is-128x128">
|
||||
<img class="is-rounded" src="{url_stream($info->detail->profileLarger)}" />
|
||||
</figure>
|
||||
{/if}
|
||||
<p class="title">{$info->detail->title}</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
<p>Views: {number($info->stats->viewCount)}</p>
|
||||
{embed '../components/details.latte', title: 'Details'}
|
||||
{block content}
|
||||
<p>Is commerce: {bool_to_str($info->detail->isCommerce)}</p>
|
||||
{/block}
|
||||
{/embed}
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{include '../components/feed.latte'}
|
||||
{/block}
|
||||
@@ -0,0 +1,44 @@
|
||||
{layout '../layouts/default.latte'}
|
||||
|
||||
{var $has_rss = true}
|
||||
|
||||
{var $og = $info->meta->og}
|
||||
{var $og_content = $info->detail->avatarLarger}
|
||||
{var $og_url = url_user($info->detail->uniqueId)}
|
||||
|
||||
{block header}
|
||||
<figure class="image is-inline-block is-128x128">
|
||||
<img class="is-rounded" src="{url_stream($info->detail->avatarLarger)}" />
|
||||
</figure>
|
||||
<p class="title">
|
||||
{if $info->detail->verified}
|
||||
{include '../components/icon.latte', icon: 'check-o', text: $info->detail->uniqueId}
|
||||
{else}
|
||||
{$info->detail->uniqueId}
|
||||
{/if}
|
||||
</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
{if $info->detail->privateAccount}
|
||||
<p><strong>Private account</strong></p>
|
||||
{/if}
|
||||
<b>Description</b>
|
||||
<p class="new-line">{$info->detail->signature}</p>
|
||||
{if isset($info->detail->bioLink)}
|
||||
<p>Link: <a href="{$info->detail->bioLink->link}">{$info->detail->bioLink->link}</a></p>
|
||||
{/if}
|
||||
<b>Stats</b>
|
||||
<p>Following: {number($info->stats->followingCount)} / Followers: {number($info->stats->followerCount)}</p>
|
||||
<p>Hearts: {number($info->stats->heartCount)} / Videos: {$info->stats->videoCount}</p>
|
||||
{embed '../components/details.latte', title: "Details"}
|
||||
{block content}
|
||||
<p>Region: {$info->detail->region}</p>
|
||||
{if $info->detail->commerceUserInfo->commerceUser}
|
||||
<p>Category: {$info->detail->commerceUserInfo->category}</p>
|
||||
{/if}
|
||||
{/block}
|
||||
{/embed}
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{include '../components/feed.latte'}
|
||||
{/block}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user