mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec611478e3 | |||
| 96aa2803b2 | |||
| 9f63fecc18 | |||
| a27d6ca767 | |||
| 2aab1bfe24 | |||
| bc9ff0100e | |||
| c4f3a80c3e | |||
| 3b441c2683 | |||
| 03002ba835 | |||
| 76d4a581f3 | |||
| 36d9902c73 | |||
| 98405545e7 | |||
| 9ac169d480 | |||
| b63a0b2755 | |||
| 1427a94810 | |||
| 547f8460b3 | |||
| 4610a89810 | |||
| 70161ec0d6 | |||
| 2592f2087c | |||
| a033682dfb | |||
| 01c39fbc0e | |||
| 086c206920 | |||
| 672e752841 | |||
| 591bb2c726 | |||
| 4e49badfc4 | |||
| 5001bf0e91 | |||
| 71931971f7 | |||
| f2e3475cb9 | |||
| 9536d9e78a | |||
| 86fdeff56e | |||
| bbbe6c2dba | |||
| f1f69533a8 | |||
| 3eebeb0369 | |||
| 107ca2f9e2 | |||
| f203dca5a2 | |||
| db1de45ee1 | |||
| fe80102212 | |||
| a99b8ebd54 | |||
| d33e9d119a | |||
| 358c6ad08f | |||
| 7c51b63660 | |||
| 13e686bb5a | |||
| 250bbedc1d | |||
| dd377a27be | |||
| 79454aa9e0 | |||
| 9f1e2c44e4 | |||
| 846ab1ccae | |||
| dfe22f6a18 | |||
| b85b1f4148 | |||
| a573ac1990 | |||
| a3b4143ab1 | |||
| 3ba64be202 | |||
| 80f3ca4ebb | |||
| 200a6fc1f8 | |||
| c546ed406c | |||
| 7c333b1658 | |||
| 9d9207b05e | |||
| 923d42c6c1 | |||
| 5ba084dae1 | |||
| 4f906ef801 | |||
| 15fdd41cad | |||
| 34623c8e43 | |||
| 629da5f357 | |||
| 4a59dab75c | |||
| 8c769d89d4 | |||
| 19a2066fc2 | |||
| e43580f3f9 | |||
| b5d034437f | |||
| 4e191922fe | |||
| d09830cc89 | |||
| 3556fef036 | |||
| 7e65da7fe9 |
+5
-8
@@ -1,9 +1,6 @@
|
||||
node_modules
|
||||
/.env
|
||||
/.git
|
||||
/.vscode
|
||||
/vendor
|
||||
/cache/latte/*
|
||||
!/cache/latte/.gitkeep
|
||||
/cache/api/*
|
||||
!/cache/api/.gitkeep
|
||||
.env
|
||||
.git
|
||||
.vscode
|
||||
vendor
|
||||
cache
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[**.latte]
|
||||
indent_style = tab
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[**.html]
|
||||
|
||||
+6
-10
@@ -2,23 +2,19 @@
|
||||
# LATTE_CACHE=/tmp/proxitok_api # Path for Latte cache, leave commented for ./cache/latte
|
||||
|
||||
# API CONFIG
|
||||
# API_SIGNER="remote"
|
||||
# API_SIGNER_URL="http://localhost:8080"
|
||||
# API_TEST_ENDPOINTS=true # Uncomment for usage of testing TikTok endpoints, may help sometimes
|
||||
# API_CHROMEDRIVER=http://localhost:4444
|
||||
# API_VERIFYFP=verify_...
|
||||
# API_DEVICE_ID=586094...
|
||||
# API_CACHE=redis
|
||||
|
||||
# Redis cache, used on Helpers\CacheEngines\RedisCache (CHOOSE ONE)
|
||||
# Redis cache, used on App\Cache\RedisCache (CHOOSE ONE)
|
||||
# REDIS_HOST=localhost # Host or path to unix socket
|
||||
# REDIS_PORT=6379 # Set to -1 to use unix socket
|
||||
# REDIS_PASSWORD=example # Leave commented for no password
|
||||
|
||||
# JSON cache, used on Helpers\CacheEngines\JSONCache
|
||||
# JSON cache, used on App\Cache\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
|
||||
# PROXY="https://user:password@host:port" # Host to be used as proxy, make sure to type a valid protocol. Available: http:// | https:// | socks4:// | socks5://
|
||||
|
||||
# USER_AGENT="Mozilla/5.0 (Android 12; Mobile; rv:109.0) Gecko/109.0 Firefox/109.0"
|
||||
|
||||
@@ -25,7 +25,7 @@ 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):**
|
||||
**Environment (please complete the following information):**
|
||||
|
||||
- Deployment method (if possible): [e.g docker, heroku, manual...]
|
||||
- Frontend version: [e.g. 2.2.0.0]
|
||||
|
||||
@@ -42,9 +42,9 @@ jobs:
|
||||
# https://github.com/sigstore/cosign-installer
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@main
|
||||
uses: sigstore/cosign-installer@v3.6.0
|
||||
with:
|
||||
cosign-release: 'v2.0.0-rc.0'
|
||||
cosign-release: 'v2.4.0'
|
||||
|
||||
|
||||
# Workaround: https://github.com/docker/build-push-action/issues/461
|
||||
@@ -96,7 +96,6 @@ jobs:
|
||||
- name: Sign the published Docker image
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
COSIGN_EXPERIMENTAL: "true"
|
||||
# This step uses the identity token to provision an ephemeral certificate
|
||||
# against the sigstore community Fulcio instance.
|
||||
run: cosign sign ${{ steps.meta.outputs.tags }}@${{ steps.build-and-push.outputs.digest }}
|
||||
DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
||||
TAGS: ${{ steps.meta.outputs.tags }}
|
||||
run: cosign sign --yes "${TAGS}@${DIGEST}"
|
||||
|
||||
+18
-21
@@ -1,25 +1,22 @@
|
||||
FROM php:8.1-apache
|
||||
WORKDIR /var/www/html
|
||||
FROM trafex/php-nginx:3.6.0
|
||||
|
||||
# Add composer
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
RUN apt update -y && apt upgrade -y \
|
||||
&& apt install -y --no-install-recommends libzip-dev \
|
||||
&& pecl install redis zip \
|
||||
&& docker-php-ext-enable redis zip \
|
||||
&& a2enmod rewrite headers \
|
||||
&& mkdir /cache \
|
||||
&& chown -R www-data:www-data /cache \
|
||||
&& rm -rf /var/www/html/*
|
||||
|
||||
# Copy project to /var/www/html
|
||||
COPY . .
|
||||
# Copy config
|
||||
COPY ./misc/setup/docker/php.ini /etc/php83/conf.d/settings.ini
|
||||
|
||||
# Run composer and clean
|
||||
RUN composer update --no-cache \
|
||||
&& composer install --no-interaction --optimize-autoloader --no-dev --no-cache \
|
||||
&& apt autoclean -y \
|
||||
&& apt autoremove -y \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /usr/bin/composer
|
||||
USER root
|
||||
# Create cache folder
|
||||
RUN mkdir /cache && chown -R nobody:nogroup /cache
|
||||
# Install deps
|
||||
RUN apk add --no-cache php83-redis php83-zip php83-tokenizer
|
||||
|
||||
EXPOSE 80
|
||||
CMD apachectl -D FOREGROUND
|
||||
USER nobody
|
||||
# Copy source
|
||||
COPY --chown=nobody . /var/www/html
|
||||
|
||||
# Dependencies
|
||||
RUN composer install --no-interaction --optimize-autoloader --no-dev --no-cache
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
# ProxiTok
|
||||
Use Tiktok with an alternative frontend, inspired by Nitter.
|
||||
|
||||
## WARNING
|
||||
THE LATEST VERSION **v2.5.0.0** INCLUDES BREAKING CHANGES, CHECK THE [PULL REQUEST](https://github.com/pablouser1/ProxiTok/pull/224) FOR MORE INFO
|
||||
|
||||
## Features
|
||||
* Privacy: All requests made to TikTok are server-side, so you will never connect to their servers
|
||||
* See user's feed
|
||||
* See trending and discovery tab
|
||||
* See tags
|
||||
* See video by id
|
||||
* Themes
|
||||
* RSS Feed for user, trending and tag (just add /rss to the url)
|
||||
* RSS Feed for user and tag (just add /rss to the url)
|
||||
|
||||
## Self-hosting
|
||||
Please check [this](https://github.com/pablouser1/ProxiTok/wiki/Self-hosting) wiki article for info on how to self-host your own instance
|
||||
@@ -16,6 +18,8 @@ Please check [this](https://github.com/pablouser1/ProxiTok/wiki/Self-hosting) wi
|
||||
## Public instances
|
||||
[This](https://github.com/pablouser1/ProxiTok/wiki/Public-instances) wiki article contains a list with all the known public instances.
|
||||
|
||||
Instances list in JSON format can be found in [instances.json](instances.json) file.
|
||||
|
||||
## Extensions
|
||||
If you want to automatically redirect Tiktok links to ProxiTok you can use:
|
||||
* [Libredirect](https://github.com/libredirect/libredirect)
|
||||
@@ -33,6 +37,7 @@ Apply to: Main window (address bar)
|
||||
```
|
||||
|
||||
## TODO / Known issues
|
||||
* Fix Heroku, still using old signer method
|
||||
* Replace placeholder favicon
|
||||
* Make video on /video fit screen and don't overflow
|
||||
* Fix embed styling
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace App\Cache;
|
||||
|
||||
use TikScraper\Interfaces\CacheInterface;
|
||||
use TikScraper\Interfaces\ICache;
|
||||
|
||||
class ApcuCache implements CacheInterface {
|
||||
class ApcuCache implements ICache {
|
||||
function __construct() {
|
||||
if (!(extension_loaded('apcu') && apcu_enabled())) {
|
||||
throw new \Exception('APCu not enabled');
|
||||
@@ -19,7 +19,7 @@ class ApcuCache implements CacheInterface {
|
||||
return apcu_exists($cache_key);
|
||||
}
|
||||
|
||||
public function set(string $cache_key, string $data, $timeout = 3600): void {
|
||||
public function set(string $cache_key, string $data, int $timeout = 3600): void {
|
||||
apcu_store($cache_key, $data, $timeout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace App\Cache;
|
||||
|
||||
use TikScraper\Interfaces\CacheInterface;
|
||||
use TikScraper\Interfaces\ICache;
|
||||
|
||||
class JSONCache implements CacheInterface {
|
||||
class JSONCache implements ICache {
|
||||
private string $cache_path = __DIR__ . '/../../cache/api';
|
||||
|
||||
function __construct() {
|
||||
@@ -26,7 +26,7 @@ class JSONCache implements CacheInterface {
|
||||
return is_file($filename);
|
||||
}
|
||||
|
||||
public function set(string $cache_key, string $data, $timeout = 3600) {
|
||||
public function set(string $cache_key, string $data, int $timeout = 3600) {
|
||||
file_put_contents($this->cache_path . '/' . $cache_key . '.json', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace App\Cache;
|
||||
|
||||
use TikScraper\Interfaces\CacheInterface;
|
||||
use TikScraper\Interfaces\ICache;
|
||||
|
||||
class RedisCache implements CacheInterface {
|
||||
class RedisCache implements ICache {
|
||||
private \Redis $client;
|
||||
function __construct(string $host, int $port, ?string $password) {
|
||||
$this->client = new \Redis();
|
||||
@@ -30,7 +30,7 @@ class RedisCache implements CacheInterface {
|
||||
return $this->client->exists($cache_key);
|
||||
}
|
||||
|
||||
public function set(string $cache_key, string $data, $timeout = 3600) {
|
||||
public function set(string $cache_key, string $data, int $timeout = 3600) {
|
||||
$this->client->set($cache_key, $data, $timeout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\DiscoverTemplate;
|
||||
|
||||
class DiscoverController {
|
||||
static public function get() {
|
||||
$api = Wrappers::api();
|
||||
$data = $api->discover();
|
||||
if ($data->meta->success) {
|
||||
Wrappers::latte('discover', new DiscoverTemplate($data));
|
||||
} else {
|
||||
ErrorHandler::showMeta($data->meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ 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();
|
||||
$video = $api->video($id);
|
||||
$video->feed();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\FeedTemplate;
|
||||
|
||||
class FollowingController {
|
||||
public static function get() {
|
||||
$cursor = Misc::getCursor();
|
||||
|
||||
$api = Wrappers::api();
|
||||
$following = $api->following();
|
||||
$following->feed($cursor);
|
||||
if ($following->ok()) {
|
||||
$feed = $following->getFeed();
|
||||
Wrappers::latte('following', new FeedTemplate('Following / Discover', $feed));
|
||||
} else {
|
||||
ErrorHandler::showMeta($following->error());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Misc;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\FeedTemplate;
|
||||
use App\Models\RSSTemplate;
|
||||
|
||||
class ForYouController {
|
||||
public static function get() {
|
||||
$api = Wrappers::api();
|
||||
$fyp = $api->foryou();
|
||||
$fyp->feed();
|
||||
if ($fyp->ok()) {
|
||||
$feed = $fyp->getFeed();
|
||||
Wrappers::latte('foryou', new FeedTemplate('For you', $feed));
|
||||
} else {
|
||||
ErrorHandler::showMeta($fyp->error());
|
||||
}
|
||||
}
|
||||
|
||||
public static function rss() {
|
||||
$api = Wrappers::api();
|
||||
$fyp = $api->foryou();
|
||||
$fyp->feed();
|
||||
if ($fyp->ok()) {
|
||||
$feed = $fyp->getFeed();
|
||||
Misc::rss('For you');
|
||||
Wrappers::latte('rss', new RSSTemplate('For you', 'For you Page', '', Misc::url('/foryou'), $feed->items));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ 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();
|
||||
|
||||
@@ -3,25 +3,25 @@ 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 public function stream() {
|
||||
public static function stream() {
|
||||
self::checkUrl();
|
||||
$url = $_GET['url'];
|
||||
$config['user_agent'] = Misc::env("USER_AGENT", TikScraperUserAgents::DEFAULT);
|
||||
$streamer = new \TikScraper\Stream($config);
|
||||
|
||||
$options = Misc::getScraperOptions();
|
||||
$streamer = new \TikScraper\Stream($options);
|
||||
$streamer->url($url);
|
||||
}
|
||||
|
||||
static public function download() {
|
||||
public static function download() {
|
||||
self::checkUrl();
|
||||
$method = Cookies::downloader();
|
||||
$downloader = new \TikScraper\Download($method);
|
||||
$downloader = new \TikScraper\Download($method, Misc::getScraperOptions());
|
||||
|
||||
// Params
|
||||
$id = $_GET['id'] ?? '';
|
||||
|
||||
@@ -8,7 +8,7 @@ use App\Helpers\UrlBuilder;
|
||||
* Used to be compatible with HTML forms
|
||||
*/
|
||||
class RedirectController {
|
||||
static public function search() {
|
||||
public static function search() {
|
||||
$endpoint = '/';
|
||||
if (isset($_GET['type'], $_GET['term'])) {
|
||||
$term = trim($_GET['term']);
|
||||
@@ -49,7 +49,7 @@ class RedirectController {
|
||||
header("Location: {$url}");
|
||||
}
|
||||
|
||||
static public function download() {
|
||||
public static function download() {
|
||||
if (!(isset($_GET['videoId'], $_GET['authorUsername'], $_GET['playAddr']))) {
|
||||
ErrorHandler::showText(400, 'Request incomplete');
|
||||
return;
|
||||
@@ -71,7 +71,7 @@ class RedirectController {
|
||||
* to_endpoint maps a TikTok URL into a ProxiTok-compatible endpoint URL.
|
||||
*/
|
||||
static private function to_endpoint(string $url): string {
|
||||
if (preg_match('%^(?:https?://)?(?:www\.)?(?:vm\.|vt\.)?tiktok\.com/(?:t/)?([A-Za-z0-9]+)%', $url, $m)) {
|
||||
if (preg_match('%^(?:https?://)?(?:www\.)?(?:vm\.|vt\.|lite\.)?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)) {
|
||||
|
||||
@@ -7,11 +7,11 @@ use App\Helpers\Wrappers;
|
||||
use App\Models\SettingsTemplate;
|
||||
|
||||
class SettingsController {
|
||||
static public function index() {
|
||||
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);
|
||||
@@ -19,13 +19,8 @@ class SettingsController {
|
||||
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);
|
||||
|
||||
@@ -9,7 +9,7 @@ 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);
|
||||
@@ -23,14 +23,14 @@ class TagController {
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
Misc::rss($name);
|
||||
Wrappers::latte('rss', new RSSTemplate($name, $data->info->detail->desc, UrlBuilder::tag($name), $data->feed->items));
|
||||
Wrappers::latte('rss', new RSSTemplate($name, $data->info->detail->desc, '', UrlBuilder::tag($name), $data->feed->items));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Helpers\Misc;
|
||||
use App\Models\FeedTemplate;
|
||||
use App\Helpers\ErrorHandler;
|
||||
use App\Helpers\Wrappers;
|
||||
use App\Models\RSSTemplate;
|
||||
|
||||
class TrendingController {
|
||||
static public function get() {
|
||||
$api = Wrappers::api();
|
||||
$cursor = Misc::getTtwid();
|
||||
|
||||
$trending = $api->trending();
|
||||
$trending->feed($cursor);
|
||||
|
||||
$feed = $trending->getFeed();
|
||||
if ($feed && $feed->meta->success) {
|
||||
Wrappers::latte('trending', new FeedTemplate('Trending', $feed));
|
||||
} else {
|
||||
ErrorHandler::showMeta($trending->error());
|
||||
}
|
||||
}
|
||||
|
||||
static public function rss() {
|
||||
$api = Wrappers::api();
|
||||
$trending = $api->trending();
|
||||
$trending->feed();
|
||||
|
||||
$feed = $trending->getFeed();
|
||||
if ($feed && $feed->meta->success) {
|
||||
Misc::rss('Trending');
|
||||
Wrappers::latte('rss', new RSSTemplate('Trending', 'Trending on TikTok', Misc::url('/trending'), $feed->items));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ 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);
|
||||
@@ -24,7 +24,7 @@ class UserController {
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -37,14 +37,14 @@ class UserController {
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
Misc::rss($username);
|
||||
Wrappers::latte('rss', new RSSTemplate($username, $data->info->detail->signature, UrlBuilder::user($username), $data->feed->items));
|
||||
Wrappers::latte('rss', new RSSTemplate($data->info->detail->nickname, $data->info->detail->signature, UrlBuilder::stream($data->info->detail->avatarLarger), 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@ namespace App\Helpers;
|
||||
use App\Constants\Themes;
|
||||
|
||||
class Cookies {
|
||||
static public function get(string $name, string $default_value = ''): string {
|
||||
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');
|
||||
$ref = new \ReflectionClass(Themes::class);
|
||||
$themes = $ref->getConstants();
|
||||
@@ -21,20 +21,20 @@ class Cookies {
|
||||
return 'default';
|
||||
}
|
||||
|
||||
static public function downloader(): string {
|
||||
public static function downloader(): string {
|
||||
$downloader = self::get('api-downloader', 'default');
|
||||
return $downloader;
|
||||
}
|
||||
|
||||
static public function exists(string $name): bool {
|
||||
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,13 +5,13 @@ use App\Models\ErrorTemplate;
|
||||
use TikScraper\Models\Meta;
|
||||
|
||||
class ErrorHandler {
|
||||
static public function showMeta(Meta $meta) {
|
||||
http_response_code($meta->http_code);
|
||||
Wrappers::latte('error', new ErrorTemplate($meta->http_code, $meta->tiktok_msg, $meta->tiktok_code));
|
||||
public static function showMeta(Meta $meta) {
|
||||
http_response_code($meta->httpCode);
|
||||
Wrappers::latte('error', new ErrorTemplate($meta->httpCode, $meta->proxitokMsg, $meta->proxitokCode, $meta->response));
|
||||
}
|
||||
|
||||
static public function showText(int $code, string $msg) {
|
||||
public static function showText(int $code, string $msg) {
|
||||
http_response_code($code);
|
||||
Wrappers::latte('error', new ErrorTemplate($code, $msg));
|
||||
Wrappers::latte('error', new ErrorTemplate($code, $msg, null, null));
|
||||
}
|
||||
}
|
||||
|
||||
+34
-6
@@ -2,33 +2,61 @@
|
||||
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 {
|
||||
public static function getView(string $template): string {
|
||||
return __DIR__ . "/../../templates/views/{$template}.latte";
|
||||
}
|
||||
|
||||
public static function getScraperOptions(): array {
|
||||
$debug = self::env('APP_DEBUG', false);
|
||||
$url = self::env('API_CHROMEDRIVER', 'http://localhost:4444');
|
||||
$verifyFp = self::env('API_VERIFYFP', '');
|
||||
$device_id = self::env('API_DEVICE_ID', '');
|
||||
$ua = self::env('USER_AGENT', '');
|
||||
|
||||
$options = [
|
||||
'debug' => $debug,
|
||||
'browser' => [
|
||||
'url' => $url,
|
||||
'close_when_done' => false
|
||||
],
|
||||
'verify_fp' => $verifyFp,
|
||||
'device_id' => $device_id,
|
||||
'user_agent' => $ua
|
||||
];
|
||||
|
||||
$proxy = Misc::env('PROXY', '');
|
||||
|
||||
if ($proxy !== '') {
|
||||
$options['proxy'] = $proxy;
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Common method for rss feeds
|
||||
*/
|
||||
static public function rss(string $title) {
|
||||
public static function rss(string $title) {
|
||||
header('Content-Type: application/rss+xml');
|
||||
header('Content-Disposition: attachment; filename="' . $title . '.rss' . '"');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@
|
||||
namespace App\Helpers;
|
||||
|
||||
class UrlBuilder {
|
||||
static public function stream(string $url): string {
|
||||
public static function stream(string $url): string {
|
||||
return Misc::url('/stream?url=' . urlencode($url));
|
||||
}
|
||||
|
||||
static public function download(string $url, string $username, string $id, bool $watermark): string {
|
||||
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;
|
||||
}
|
||||
|
||||
static public function user(string $username): string {
|
||||
public static function user(string $username): string {
|
||||
return Misc::url('/@' . $username);
|
||||
}
|
||||
|
||||
static public function tag(string $tag): string {
|
||||
public static function tag(string $tag): string {
|
||||
return Misc::url('/tag/' . $tag);
|
||||
}
|
||||
|
||||
static public function video_internal(string $username, string $id): string {
|
||||
public static function video_internal(string $username, string $id): string {
|
||||
return Misc::url('/@' . $username . "/video/" . $id);
|
||||
}
|
||||
|
||||
static public function video_external(string $username, string $id): string {
|
||||
public static function video_external(string $username, string $id): string {
|
||||
return "https://www.tiktok.com/@" . $username . "/video/" . $id;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-56
@@ -12,7 +12,7 @@ class Wrappers {
|
||||
/**
|
||||
* Setup of Latte template engine
|
||||
*/
|
||||
static public function latte(string $template, BaseTemplate $base) {
|
||||
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);
|
||||
@@ -24,7 +24,7 @@ class Wrappers {
|
||||
});
|
||||
|
||||
// Static assets
|
||||
$latte->addFunction('static', function (string $type, string $file, bool $isVendor = false): string {
|
||||
$latte->addFunction('assets', function (string $type, string $file, bool $isVendor = false): string {
|
||||
$endpoint = '';
|
||||
switch ($type) {
|
||||
case 'js':
|
||||
@@ -34,7 +34,7 @@ class Wrappers {
|
||||
$endpoint .= '/styles';
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Invalid static asset type');
|
||||
throw new \Exception('Invalid asset type');
|
||||
}
|
||||
|
||||
if ($isVendor) $endpoint .= '/vendor';
|
||||
@@ -96,19 +96,13 @@ class Wrappers {
|
||||
});
|
||||
|
||||
// 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');
|
||||
// We do -1 to also take the # or @
|
||||
$text = mb_substr($desc, $extra->start - 1, $extra->end - $extra->start, 'UTF-8');
|
||||
switch ($extra->type) {
|
||||
// User URL
|
||||
case TextExtras::USER:
|
||||
@@ -120,7 +114,8 @@ class Wrappers {
|
||||
break;
|
||||
}
|
||||
|
||||
$out = str_replace($text, "<a href=\"$url\">$text</a>", $out);
|
||||
// We do \b to avoid non-strict matches ('#hi' would match with '#hii' and we don't want that)
|
||||
$out = preg_replace("/$text\b/", "<a href=\"$url\">$text</a>", $out);
|
||||
}
|
||||
return $out;
|
||||
});
|
||||
@@ -131,42 +126,8 @@ class Wrappers {
|
||||
/**
|
||||
* Setup of TikTok Api wrapper
|
||||
*/
|
||||
static public 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' => [
|
||||
'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)
|
||||
];
|
||||
}
|
||||
|
||||
public static function api(): \TikScraper\Api {
|
||||
$options = Misc::getScraperOptions();
|
||||
// Cache config
|
||||
$cacheEngine = null;
|
||||
if (isset($_ENV['API_CACHE'])) {
|
||||
@@ -189,20 +150,14 @@ class Wrappers {
|
||||
$password = $url['pass'] ?? null;
|
||||
} else {
|
||||
$host = $_ENV['REDIS_HOST'];
|
||||
$port = (int) $_ENV['REDIS_PORT'];
|
||||
$password = isset($_ENV['REDIS_PASSWORD']) ? $_ENV['REDIS_PASSWORD'] : null;
|
||||
$port = intval($_ENV['REDIS_PORT']);
|
||||
$password = $_ENV['REDIS_PASSWORD'] ?? null;
|
||||
}
|
||||
$cacheEngine = new RedisCache($host, $port, $password);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$customUa = Misc::env("USER_AGENT", '');
|
||||
|
||||
if ($customUa) {
|
||||
$options['user_agent'] = $customUa;
|
||||
}
|
||||
|
||||
return new \TikScraper\Api($options, $cacheEngine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?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,16 +1,20 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
use TikScraper\Models\Response;
|
||||
|
||||
class ErrorTemplate extends BaseTemplate {
|
||||
public int $http_code = 502;
|
||||
public ?int $tiktok_code = -1;
|
||||
public string $msg = '';
|
||||
|
||||
public ?Response $response = null;
|
||||
|
||||
function __construct(int $http_code, string $msg, ?int $tiktok_code = null) {
|
||||
|
||||
function __construct(int $http_code, string $msg, ?int $tiktok_code, ?Response $response) {
|
||||
parent::__construct('Error');
|
||||
$this->http_code = $http_code;
|
||||
$this->msg = $msg;
|
||||
$this->tiktok_code = $tiktok_code;
|
||||
$this->response = $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@ namespace App\Models;
|
||||
|
||||
class RSSTemplate extends BaseTemplate {
|
||||
public string $desc;
|
||||
public string $image;
|
||||
public string $link;
|
||||
public array $items;
|
||||
|
||||
function __construct(string $title, string $desc, string $link, array $items) {
|
||||
function __construct(string $title, string $desc, string $image, string $link, array $items) {
|
||||
parent::__construct($title);
|
||||
$this->desc = $desc;
|
||||
$this->image = $image;
|
||||
$this->link = $link;
|
||||
$this->items = $items;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ use TikScraper\Constants\DownloadMethods;
|
||||
class SettingsTemplate extends BaseTemplate {
|
||||
public array $downloaders = [];
|
||||
public array $themes = [];
|
||||
public bool $isTestEndpoints = false;
|
||||
public string $currentDownloader;
|
||||
public string $currentTheme;
|
||||
public bool $isServiceWorker = false;
|
||||
@@ -25,7 +24,6 @@ class SettingsTemplate extends BaseTemplate {
|
||||
$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');
|
||||
|
||||
+9
-7
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "pablouser1/proxitok",
|
||||
"description": "An alternative frontend for TikTok",
|
||||
"version": "2.4.9.0",
|
||||
"version": "2.5.0.0",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "project",
|
||||
"authors": [
|
||||
@@ -14,17 +14,19 @@
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"platform": {
|
||||
"php": "7.4"
|
||||
"php": "8.1"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.4|^8.0",
|
||||
"ext-redis": "^5.3.2",
|
||||
"php": "^8.1",
|
||||
"ext-mbstring": "*",
|
||||
"latte/latte": "^2.11",
|
||||
"latte/latte": "^3.0",
|
||||
"bramus/router": "^1.6",
|
||||
"josegonzalez/dotenv": "dev-master",
|
||||
"pablouser1/tikscraper": "^2.3"
|
||||
"pablouser1/tikscraper": "^2.6",
|
||||
"josegonzalez/dotenv": "^4.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-redis": "For using redis as a caching engine"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
Generated
+612
-179
File diff suppressed because it is too large
Load Diff
+24
-24
@@ -1,23 +1,24 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
web:
|
||||
container_name: proxitok-web
|
||||
image: ghcr.io/pablouser1/proxitok:master
|
||||
ports:
|
||||
- 8080:80
|
||||
- 8080:8080
|
||||
environment:
|
||||
- LATTE_CACHE=/cache
|
||||
- API_CACHE=redis
|
||||
- REDIS_HOST=proxitok-redis
|
||||
- REDIS_PORT=6379
|
||||
- API_SIGNER=remote
|
||||
- API_SIGNER_URL=http://proxitok-signer:8080/signature
|
||||
- API_CHROMEDRIVER=http://proxitok-chromedriver:9515
|
||||
# - API_VERIFYFP=verify_...
|
||||
# - API_DEVICE_ID=4586...
|
||||
labels:
|
||||
- "io.containers.autoupdate=registry"
|
||||
volumes:
|
||||
- proxitok-cache:/cache
|
||||
depends_on:
|
||||
- redis
|
||||
- signer
|
||||
- chromedriver
|
||||
networks:
|
||||
- proxitok
|
||||
security_opt:
|
||||
@@ -28,35 +29,34 @@ services:
|
||||
- CHOWN
|
||||
- SETGID
|
||||
- SETUID
|
||||
|
||||
# Redis, used for caching
|
||||
redis:
|
||||
container_name: proxitok-redis
|
||||
image: redis:7-alpine
|
||||
command: redis-server --save 60 1 --loglevel warning
|
||||
image: docker.io/library/redis:7.4-alpine
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- "io.containers.autoupdate=registry"
|
||||
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
|
||||
init: true
|
||||
user: nobody
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
|
||||
# Chromedriver instance, used for sending requests to TikTok
|
||||
chromedriver:
|
||||
container_name: proxitok-chromedriver
|
||||
image: zenika/alpine-chrome:with-chromedriver
|
||||
init: true
|
||||
labels:
|
||||
- "io.containers.autoupdate=registry"
|
||||
shm_size: 1g
|
||||
networks:
|
||||
- proxitok
|
||||
security_opt:
|
||||
- seccomp:./misc/setup/docker/chrome.json
|
||||
volumes:
|
||||
proxitok-cache:
|
||||
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
[
|
||||
{
|
||||
"clearnet": "https://proxitok.pabloferreiro.es/",
|
||||
"cdn": false,
|
||||
"country": "AT"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.pussthecat.org/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.esmailelbob.xyz/",
|
||||
"tor": "http://proxitok.esmail5pdn24shtvieloeedh7ehz3nrwcdivnfhfcedl7gf4kwddhkqd.onion/",
|
||||
"cdn": false,
|
||||
"country": "CA"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.privacydev.net/",
|
||||
"tor": "http://proxitok.g4c3eya4clenolymqbpgwz3q3tawoxw56yhzk4vugqrl6dtu3ejvhjid.onion/",
|
||||
"cdn": false,
|
||||
"country": "FR"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://tok.artemislena.eu/",
|
||||
"tor": "http://tok.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://tok.adminforge.de/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://tik.hostux.net/",
|
||||
"cdn": false,
|
||||
"country": "FR"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://tt.vern.cc/",
|
||||
"tor": "http://tt.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/",
|
||||
"i2p": "http://vern2gwxbtxzhb3rgchv4kbhlqppijhjqg7rmgvp4c5bxihxcm3a.b32.i2p/",
|
||||
"cdn": false,
|
||||
"country": "US"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://cringe.whatever.social/",
|
||||
"cdn": false,
|
||||
"country": "US"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.lunar.icu/",
|
||||
"cdn": true,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.privacy.com.de/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://cringe.whateveritworks.org/",
|
||||
"cdn": true,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://cringe.seitan-ayoub.lol/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.kyun.li/",
|
||||
"cdn": false,
|
||||
"country": "RO"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://cringe.datura.network/",
|
||||
"tor": "http://cringe.daturab6drmkhyeia4ch5gvfc2f3wgo6bhjrv3pz6n7kxmvoznlkq4yd.onion/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://tt.opnxng.com/",
|
||||
"cdn": false,
|
||||
"country": "SG"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.tinfoil-hat.net/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://tiktok.wpme.pl/",
|
||||
"cdn": true,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.r4fo.com/",
|
||||
"tor": "http://proxitok.r4focoma7gu2zdwwcjjad47ysxt634lg73sxmdbkdozanwqslho5ohyd.onion/",
|
||||
"cdn": true,
|
||||
"country": "NL"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://proxitok.belloworld.it/",
|
||||
"cdn": false,
|
||||
"country": "DE"
|
||||
},
|
||||
{
|
||||
"clearnet": "https://tok.habedieeh.re/",
|
||||
"tor": "http://tok.habeehrhadazsw3izbrbilqajalfyqqln54mrja3iwpqxgcuxnus7eid.onion/",
|
||||
"cdn": false,
|
||||
"country": "CA"
|
||||
},
|
||||
{
|
||||
"tor": "http://pt.skunky7dhv7nohsoalpwe3sxfz3fbkad7r3wk632riye25vqm3meqead.onion/",
|
||||
"i2p": "http://hm4d5t5jeycvraam3ptvmhlegfttjmxpxgl4lou2hibde7gzfsvq.b32.i2p/",
|
||||
"cdn": false
|
||||
}
|
||||
]
|
||||
@@ -16,6 +16,7 @@
|
||||
@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/tag.scss";
|
||||
|
||||
@import "./node_modules/css.gg/icons/scss/lock.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/lock-unlock.scss";
|
||||
|
||||
+12
-12
@@ -48,9 +48,9 @@ bulmaswatch@^0.8.1:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
css.gg@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/css.gg/-/css.gg-2.0.0.tgz#1ba891092ceac58a2550540171c2d469a86b27b2"
|
||||
integrity sha512-8qO59kSXLbewo7xaUM4eC8328MTdGmb8atpmw6PRzeDGsZrCkAVjJzKeFDIntagl1/aCee+NG1OQtIvWAjgG/A==
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/css.gg/-/css.gg-2.1.1.tgz#62b2e242633c1cdf9de9840f2cf343ce03f6548e"
|
||||
integrity sha512-OJrjd4+CdjrLvrVB+EFctAnk7eeM+zc8aKfVlO5BfNBgSqcC9wMHQTZ7ALcCiZGpE62kVVhwQ3Mvl1u6RkVFvQ==
|
||||
|
||||
fill-range@^7.0.1:
|
||||
version "7.0.1"
|
||||
@@ -60,9 +60,9 @@ fill-range@^7.0.1:
|
||||
to-regex-range "^5.0.1"
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.2"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
|
||||
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
||||
glob-parent@~5.1.2:
|
||||
version "5.1.2"
|
||||
@@ -72,9 +72,9 @@ glob-parent@~5.1.2:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
immutable@^4.0.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef"
|
||||
integrity sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==
|
||||
version "4.3.4"
|
||||
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f"
|
||||
integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==
|
||||
|
||||
is-binary-path@~2.1.0:
|
||||
version "2.1.0"
|
||||
@@ -118,9 +118,9 @@ readdirp@~3.6.0:
|
||||
picomatch "^2.2.1"
|
||||
|
||||
sass@^1.46.0:
|
||||
version "1.56.1"
|
||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.56.1.tgz#94d3910cd468fd075fa87f5bb17437a0b617d8a7"
|
||||
integrity sha512-VpEyKpyBPCxE7qGDtOcdJ6fFbcpOM+Emu7uZLxVrkX8KVU/Dp5UF7WLvzqRuUhB6mqqQt1xffLoG+AndxTZrCQ==
|
||||
version "1.68.0"
|
||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.68.0.tgz#0034b0cc9a50248b7d1702ac166fd25990023669"
|
||||
integrity sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==
|
||||
dependencies:
|
||||
chokidar ">=3.0.0 <4.0.0"
|
||||
immutable "^4.0.0"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
variables_order="EGPCS"
|
||||
|
||||
[Date]
|
||||
date.timezone="UTC"
|
||||
expose_php=Off
|
||||
+8
-9
@@ -56,19 +56,12 @@ $router->get('/download', 'ProxyController@download');
|
||||
$router->get('/redirect/search', 'RedirectController@search');
|
||||
$router->get('/redirect/download', 'RedirectController@download');
|
||||
|
||||
$router->mount('/trending', function () use ($router) {
|
||||
$router->get('/', 'TrendingController@get');
|
||||
$router->get('/rss', 'TrendingController@rss');
|
||||
});
|
||||
|
||||
$router->mount('/@([^/]+)', function () use ($router) {
|
||||
$router->get('/', 'UserController@get');
|
||||
$router->get('/video/(\w+)', 'UserController@video');
|
||||
$router->get('/rss', 'UserController@rss');
|
||||
});
|
||||
|
||||
// Deprecated, please use /@USERNAME/video/VIDEO_ID instead
|
||||
$router->get('/video/(\w+)', 'VideoController@get');
|
||||
// Workaround that allows /t endpoints
|
||||
$router->get('/t/([^/]+)', 'VideoController@get');
|
||||
|
||||
@@ -79,6 +72,14 @@ $router->mount('/tag/([^/]+)', function () use ($router) {
|
||||
|
||||
$router->get('/music/([^/]+)', 'MusicController@get');
|
||||
|
||||
// For you
|
||||
$router->mount('/foryou', function () use ($router) {
|
||||
$router->get('/', 'ForYouController@get');
|
||||
$router->get('/rss', 'ForYouController@rss');
|
||||
});
|
||||
|
||||
$router->get('/following', 'FollowingController@get');
|
||||
|
||||
// -- Settings -- //
|
||||
$router->mount('/settings', function () use ($router) {
|
||||
$router->get('/', 'SettingsController@index');
|
||||
@@ -87,7 +88,5 @@ $router->mount('/settings', function () use ($router) {
|
||||
$router->post('/misc', 'SettingsController@misc');
|
||||
});
|
||||
|
||||
$router->get('/discover', 'DiscoverController@get');
|
||||
|
||||
// -- EMBED -- //
|
||||
$router->get('/embed/v2/(\d+)', 'EmbedController@v2');
|
||||
|
||||
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":["../../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"}
|
||||
{"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/tag.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,QACI,cACA,iBAeA,eACA,2BACA,8BACA,sBACA,+BACA,kBACA,WACA,YApBA,gBACE,cACA,iBACA,WACA,kBACA,UACA,WACA,uBACA,oBACA,QACA,QAYF,eACE,WACA,cACA,sBACA,kBACA,WACA,YACA,wBACA,uBACA,+BACA,yBACA,MACA,WCtCN,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"}
|
||||
@@ -29,9 +29,9 @@
|
||||
{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')}">
|
||||
<link rel="stylesheet" href="{assets('css', 'cssgg.min.css', true)}">
|
||||
<link rel="stylesheet" href="{assets('css', 'bulma.min.css', true)}">
|
||||
<link rel="stylesheet" href="{assets('css', 'misc.css')}">
|
||||
<link rel="stylesheet" href="{assets('css', 'carousel.css')}">
|
||||
<title>{$title} - ProxiTok</title>
|
||||
</head>
|
||||
|
||||
@@ -26,4 +26,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<script src="{static('js', 'navbar.js')}"></script>
|
||||
<script src="{assets('js', 'navbar.js')}"></script>
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
{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">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<link rel="stylesheet" href="{static('css', 'themes/card.css')}">
|
||||
<link rel="stylesheet" href="{assets('css', 'themes/card.css')}">
|
||||
<section class="section">
|
||||
<noscript>JavaScript is required for this section to work!</noscript>
|
||||
<div class="columns is-multiline is-vcentered">
|
||||
@@ -67,4 +67,4 @@
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{static('js', 'themes/card.js')}"></script>
|
||||
<script src="{assets('js', 'themes/card.js')}"></script>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<p class="mb-1">{include '../../icon.latte', icon: 'music', text: $songTitle}</p>
|
||||
<audio controls preload="none" src="{url_stream($url)}"></audio>
|
||||
@@ -3,19 +3,25 @@
|
||||
<source src="{url_stream($item->video->playAddr)}" type="video/mp4" />
|
||||
</video>
|
||||
{else}
|
||||
<section class="carousel" aria-label="carousel" Tabindex="0">
|
||||
<div class="slides">
|
||||
{foreach $item->imagePost->images as $i => $image}
|
||||
<div class="slides-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="#image-{$i + 1}">{$i + 1}</a>
|
||||
{/for}
|
||||
</div>
|
||||
<div class="carousel__skip-message" id="skip-link" tabindex="0"></div>
|
||||
</section>
|
||||
{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}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
{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 => !$feed->hasMore" class="button is-success" href="?cursor={$feed->maxCursor}">Next</a>
|
||||
<a n:attr="disabled => !$feed->hasMore" class="button is-success" href="?cursor={$feed->cursor}">Next</a>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +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>
|
||||
<a target="_blank" href="{url_download($downloadAddr, $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>
|
||||
<a target="_blank" href="{url_download($playAddr, $uniqueId, $id, false)}" class="button is-success">No watermark</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<div class="tags">
|
||||
{foreach $challenges as $challenge}
|
||||
<a class="tag is-primary is-rounded" href="{path('/tag/' . $challenge->title)}">#{$challenge->title}</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
<details>
|
||||
<summary>{include '../../icon.latte', icon: 'tag', text: 'Tags used'}</summary>
|
||||
<div class="tags">
|
||||
{foreach $challenges as $challenge}
|
||||
<a class="tag is-primary is-rounded" href="{path('/tag/' . $challenge->title)}">#{$challenge->title}</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
</details>
|
||||
|
||||
@@ -8,33 +8,40 @@
|
||||
</figure>
|
||||
<div class="media-content">
|
||||
<p>
|
||||
<strong>{$item->author->nickname}</strong>
|
||||
<strong>
|
||||
{if $item->author->verified}
|
||||
{include '../icon.latte', icon: 'check-o', text: $item->author->nickname}
|
||||
{else}
|
||||
{$item->author->nickname}
|
||||
{/if}
|
||||
</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>
|
||||
{include './common/tags.latte', challenges: $item->challenges}
|
||||
{/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>
|
||||
<p class="mb-2 mt-2" n:ifcontent>{render_desc($item->desc, $item->textExtra ?? [])|noescape}</p>
|
||||
{include './common/audio.latte', songTitle: $item->music->title, url: $item->music->playUrl}
|
||||
{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}
|
||||
{include './common/download.latte', id: $item->id, uniqueId: $item->author->uniqueId, playAddr: $item->video->playAddr, downloadAddr: isset($item->video->downloadAddr) ? $item->video->downloadAddr : $item->video->playAddr}
|
||||
{/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)}
|
||||
<p>Can duet: {bool_to_str(isset($item->duetEnabled) ? $item->duetEnabled : boolval($item->duetDisplay))}</p>
|
||||
<p>Can stitch (add this video to other ones): {bool_to_str(isset($item->stitchEnabled) ? $item->stitchEnabled : boolval($item->stitchDisplay))}</p>
|
||||
<p>Can be shared: {bool_to_str(isset($item->shareEnabled) ? $item->shareEnabled : boolval($item->shareDisplay))}
|
||||
{/block}
|
||||
{/embed}
|
||||
</div>
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">Discover</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{foreach $data->items as $type => $items}
|
||||
<p class="title">{$type|firstUpper}</p>
|
||||
<div class="columns is-multiline is-vcentered">
|
||||
{foreach $items as $item}
|
||||
<div class="column is-one-quarter">
|
||||
{embed '../components/card.latte'}
|
||||
{block content}
|
||||
<div class="media">
|
||||
<!-- Show image if exists -->
|
||||
{if !empty($item->cardItem->cover)}
|
||||
<div class="media-left">
|
||||
<figure class="image is-96x96">
|
||||
<img loading="lazy" width="96" height="96" src="{path('/stream?url=' . urlencode($item->cardItem->cover))}" />
|
||||
</figure>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="media-content">
|
||||
<p class="title">{$item->cardItem->title}</p>
|
||||
<p class="subtitle">{$item->cardItem->subTitle}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{$item->cardItem->description}</p>
|
||||
</div>
|
||||
{/block}
|
||||
{block footer}
|
||||
<a href="{path($item->cardItem->link)}" class="card-footer-item">Go</a>
|
||||
{/block}
|
||||
{/embed}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{if !$iterator->last}
|
||||
<hr />
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/block}
|
||||
@@ -14,5 +14,11 @@
|
||||
{else}
|
||||
<p>{$msg}</p>
|
||||
{/if}
|
||||
{if isset($response)}
|
||||
<details>
|
||||
<summary>Show debug info</summary>
|
||||
<pre style="max-height: 60vh;">{json_encode($response, JSON_PRETTY_PRINT)}</pre>
|
||||
</details>
|
||||
{/if}
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">Discover</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
<div class="columns is-multiline is-vcentered">
|
||||
{foreach $feed->items as $item}
|
||||
<div class="column is-one-quarter">
|
||||
{embed '../components/card.latte'}
|
||||
{block content}
|
||||
<div class="media">
|
||||
<!-- Show image if exists -->
|
||||
{if !empty($item->info->detail->avatarLarger)}
|
||||
<div class="media-left">
|
||||
<figure class="image is-96x96">
|
||||
<img loading="lazy" width="96" height="96" src="{url_stream($item->info->detail->avatarLarger)}" />
|
||||
</figure>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="media-content">
|
||||
<p class="title">{$item->info->detail->nickname}</p>
|
||||
<p class="subtitle">{$item->info->detail->uniqueId}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{$item->info->detail->signature}</p>
|
||||
</div>
|
||||
{/block}
|
||||
{block footer}
|
||||
<a href="{url_user($item->info->detail->uniqueId)}" class="card-footer-item">Go</a>
|
||||
{/block}
|
||||
{/embed}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{include '../components/themes/common/controls.latte', feed: $feed}
|
||||
{/block}
|
||||
@@ -3,7 +3,7 @@
|
||||
{var $has_rss = true}
|
||||
|
||||
{block header}
|
||||
<p class="title">Trending</p>
|
||||
<p class="title">For you</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
{/block}
|
||||
|
||||
@@ -28,14 +28,14 @@
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
<div class="columns is-centered is-mobile">
|
||||
<div class="columns is-centered is-mobile mt-2">
|
||||
<div class="column is-narrow">
|
||||
<p>Discover</p>
|
||||
<a class="button is-success" href="{path('/discover')}">Go</a>
|
||||
<p>For you</p>
|
||||
<a class="button is-success" href="{path('/foryou')}">Go</a>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<p>Trending</p>
|
||||
<a class="button is-success" href="{path('/trending')}">Go</a>
|
||||
<div class="column is-narrow">
|
||||
<p>Following</p>
|
||||
<a class="button is-success" href="{path('/following')}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
{contentType application/rss+xml}
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<channel>
|
||||
<title>{$title}</title>
|
||||
<description><![CDATA[{$desc}]]></description>
|
||||
{if $image}
|
||||
<image>
|
||||
<link>{$link}</link>
|
||||
<title>{$title}</title>
|
||||
<url>{$image}</url>
|
||||
</image>
|
||||
{/if}
|
||||
<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>{$item->desc}</p><video controls="controls" preload="auto" src="{url_stream($item->video->playAddr)}"></video>]]></description>
|
||||
<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>
|
||||
<dc:creator>@{$item->author->uniqueId}</dc:creator>
|
||||
</item>
|
||||
{/foreach}
|
||||
</channel>
|
||||
|
||||
@@ -14,7 +14,12 @@
|
||||
{/if}
|
||||
<p class="title">{$info->detail->title}</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
<p>Videos: {number($info->stats->videoCount)} / Views: {number($info->stats->viewCount)}</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}
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
</figure>
|
||||
<p class="title">
|
||||
{if $info->detail->verified}
|
||||
{include '../components/icon.latte', icon: 'check-o', text: $info->detail->uniqueId}
|
||||
{include '../components/icon.latte', icon: 'check-o', text: $info->detail->nickname}
|
||||
{else}
|
||||
{$info->detail->uniqueId}
|
||||
{$info->detail->nickname}
|
||||
{/if}
|
||||
</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
@@ -31,8 +31,12 @@
|
||||
<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 isset($info->detail->region)}
|
||||
<p>Region: {$info->detail->region}</p>
|
||||
{/if}
|
||||
{if $info->detail->commerceUserInfo->commerceUser}
|
||||
<p>Category: {$info->detail->commerceUserInfo->category}</p>
|
||||
{/if}
|
||||
{/block}
|
||||
{/embed}
|
||||
{/block}
|
||||
|
||||
@@ -30,16 +30,18 @@
|
||||
<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 '../components/themes/common/tags.latte', challenges: $item->challenges}</p>
|
||||
{include '../components/themes/common/tags.latte', challenges: $item->challenges}
|
||||
{/if}
|
||||
<div class="content">
|
||||
<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>
|
||||
<p n:ifcontent>{render_desc($item->desc, $item->textExtra ?? [])|noescape}</p>
|
||||
{include '../components/themes/common/audio.latte', songTitle: $item->music->title, url: $item->music->playUrl}
|
||||
{include '../components/themes/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 '../components/themes/common/share.latte', uniqueId: $info->detail->uniqueId, id: $item->id}
|
||||
{if isset($item->video->playAddr) && $item->video->playAddr !== ""}
|
||||
<!-- Download links, not shown if item is a gallery -->
|
||||
{include '../components/themes/common/download.latte', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $info->detail->uniqueId}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user