Compare commits

...

10 commits

Author SHA1 Message Date
D. Scott Boggs 9012ea5977 inital config for proxitok.tams.tech 2023-09-01 08:26:18 -04:00
Pablo Ferreiro 19a2066fc2
changed keyword order 2023-04-27 20:23:23 +02:00
Pablo Ferreiro e43580f3f9
RSS TextExtra and Gallery support 2023-04-27 20:22:55 +02:00
Pablo Ferreiro b5d034437f
fix multiple carousel in one page 2023-04-08 12:03:33 +02:00
Pablo Ferreiro 4e191922fe
accept both desktop and mobile user agents scraper 2023-04-05 17:09:22 +02:00
Pablo Ferreiro d09830cc89
bump scraper 2023-04-03 16:24:51 +02:00
Pablo Ferreiro 3556fef036
commerce fix 2023-04-03 14:37:04 +02:00
Pablo Ferreiro 7e65da7fe9
fixes to ttag 2023-04-02 20:37:36 +02:00
Pablo Ferreiro 3bd6c553f4
bump 2023-04-02 20:18:10 +02:00
Pablo Ferreiro aadfeccab1
Added some details 2023-04-02 20:14:48 +02:00
31 changed files with 156 additions and 75 deletions

View file

@ -6,7 +6,7 @@ use App\Helpers\Wrappers;
use App\Models\DiscoverTemplate; use App\Models\DiscoverTemplate;
class DiscoverController { class DiscoverController {
static public function get() { public static function get() {
$api = Wrappers::api(); $api = Wrappers::api();
$data = $api->discover(); $data = $api->discover();
if ($data->meta->success) { if ($data->meta->success) {

View file

@ -6,7 +6,7 @@ use App\Helpers\Wrappers;
use App\Models\VideoTemplate; use App\Models\VideoTemplate;
class EmbedController { class EmbedController {
static public function v2(int $id) { public static function v2(int $id) {
$api = Wrappers::api(); $api = Wrappers::api();
$video = $api->video($id); $video = $api->video($id);
$video->feed(); $video->feed();

View file

@ -7,7 +7,7 @@ use App\Helpers\Wrappers;
use App\Models\FullTemplate; use App\Models\FullTemplate;
class MusicController { class MusicController {
static public function get(string $music_id) { public static function get(string $music_id) {
$cursor = Misc::getCursor(); $cursor = Misc::getCursor();
$api = Wrappers::api(); $api = Wrappers::api();

View file

@ -10,7 +10,7 @@ class ProxyController {
"tiktokcdn.com", "tiktokcdn-us.com", "tiktok.com" "tiktokcdn.com", "tiktokcdn-us.com", "tiktok.com"
]; ];
static public function stream() { public static function stream() {
self::checkUrl(); self::checkUrl();
$url = $_GET['url']; $url = $_GET['url'];
$config['user_agent'] = Misc::env("USER_AGENT", TikScraperUserAgents::DEFAULT); $config['user_agent'] = Misc::env("USER_AGENT", TikScraperUserAgents::DEFAULT);
@ -18,7 +18,7 @@ class ProxyController {
$streamer->url($url); $streamer->url($url);
} }
static public function download() { public static function download() {
self::checkUrl(); self::checkUrl();
$method = Cookies::downloader(); $method = Cookies::downloader();
$downloader = new \TikScraper\Download($method); $downloader = new \TikScraper\Download($method);

View file

@ -8,7 +8,7 @@ use App\Helpers\UrlBuilder;
* Used to be compatible with HTML forms * Used to be compatible with HTML forms
*/ */
class RedirectController { class RedirectController {
static public function search() { public static function search() {
$endpoint = '/'; $endpoint = '/';
if (isset($_GET['type'], $_GET['term'])) { if (isset($_GET['type'], $_GET['term'])) {
$term = trim($_GET['term']); $term = trim($_GET['term']);
@ -49,7 +49,7 @@ class RedirectController {
header("Location: {$url}"); header("Location: {$url}");
} }
static public function download() { public static function download() {
if (!(isset($_GET['videoId'], $_GET['authorUsername'], $_GET['playAddr']))) { if (!(isset($_GET['videoId'], $_GET['authorUsername'], $_GET['playAddr']))) {
ErrorHandler::showText(400, 'Request incomplete'); ErrorHandler::showText(400, 'Request incomplete');
return; return;

View file

@ -7,11 +7,11 @@ use App\Helpers\Wrappers;
use App\Models\SettingsTemplate; use App\Models\SettingsTemplate;
class SettingsController { class SettingsController {
static public function index() { public static function index() {
Wrappers::latte('settings', new SettingsTemplate()); Wrappers::latte('settings', new SettingsTemplate());
} }
static public function general() { public static function general() {
if (isset($_POST['theme'])) { if (isset($_POST['theme'])) {
$theme = $_POST['theme']; $theme = $_POST['theme'];
Cookies::set('theme', $theme); Cookies::set('theme', $theme);
@ -19,7 +19,7 @@ class SettingsController {
self::redirect(); self::redirect();
} }
static public function api() { public static function api() {
// TODO, ADD COUNT // TODO, ADD COUNT
if (isset($_POST['api-test_endpoints'])) { if (isset($_POST['api-test_endpoints'])) {
$test_endpoints = $_POST['api-test_endpoints']; $test_endpoints = $_POST['api-test_endpoints'];

View file

@ -9,7 +9,7 @@ use App\Models\FullTemplate;
use App\Models\RSSTemplate; use App\Models\RSSTemplate;
class TagController { class TagController {
static public function get(string $name) { public static function get(string $name) {
$cursor = Misc::getCursor(); $cursor = Misc::getCursor();
$api = Wrappers::api(); $api = Wrappers::api();
$hashtag = $api->hashtag($name); $hashtag = $api->hashtag($name);
@ -23,7 +23,7 @@ class TagController {
} }
} }
static public function rss(string $name) { public static function rss(string $name) {
$api = Wrappers::api(); $api = Wrappers::api();
$hashtag = $api->hashtag($name); $hashtag = $api->hashtag($name);
$hashtag->feed(); $hashtag->feed();

View file

@ -8,7 +8,7 @@ use App\Helpers\Wrappers;
use App\Models\RSSTemplate; use App\Models\RSSTemplate;
class TrendingController { class TrendingController {
static public function get() { public static function get() {
$api = Wrappers::api(); $api = Wrappers::api();
$cursor = Misc::getTtwid(); $cursor = Misc::getTtwid();
@ -23,7 +23,7 @@ class TrendingController {
} }
} }
static public function rss() { public static function rss() {
$api = Wrappers::api(); $api = Wrappers::api();
$trending = $api->trending(); $trending = $api->trending();
$trending->feed(); $trending->feed();

View file

@ -10,7 +10,7 @@ use App\Models\RSSTemplate;
use App\Models\VideoTemplate; use App\Models\VideoTemplate;
class UserController { class UserController {
static public function get(string $username) { public static function get(string $username) {
$cursor = Misc::getCursor(); $cursor = Misc::getCursor();
$api = Wrappers::api(); $api = Wrappers::api();
$user = $api->user($username); $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(); $api = Wrappers::api();
$video = $api->video($video_id); $video = $api->video($video_id);
$video->feed(); $video->feed();
@ -37,7 +37,7 @@ class UserController {
} }
} }
static public function rss(string $username) { public static function rss(string $username) {
$api = Wrappers::api(); $api = Wrappers::api();
$user = $api->user($username); $user = $api->user($username);
$user->feed(); $user->feed();

View file

@ -2,7 +2,7 @@
namespace App\Controllers; namespace App\Controllers;
class VideoController { class VideoController {
static public function get(string $video_id) { public static function get(string $video_id) {
UserController::video('placeholder', $video_id); UserController::video('placeholder', $video_id);
} }
} }

View file

@ -4,14 +4,14 @@ namespace App\Helpers;
use App\Constants\Themes; use App\Constants\Themes;
class Cookies { 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])) { if (isset($_COOKIE[$name]) && !empty($_COOKIE[$name])) {
return $_COOKIE[$name]; return $_COOKIE[$name];
} }
return $default_value; return $default_value;
} }
static public function theme(): string { public static function theme(): string {
$theme = self::get('theme'); $theme = self::get('theme');
$ref = new \ReflectionClass(Themes::class); $ref = new \ReflectionClass(Themes::class);
$themes = $ref->getConstants(); $themes = $ref->getConstants();
@ -21,20 +21,20 @@ class Cookies {
return 'default'; return 'default';
} }
static public function downloader(): string { public static function downloader(): string {
$downloader = self::get('api-downloader', 'default'); $downloader = self::get('api-downloader', 'default');
return $downloader; return $downloader;
} }
static public function exists(string $name): bool { public static function exists(string $name): bool {
return isset($_COOKIE[$name]); 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; 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); setcookie($name, $value, time()+60*60*24*30, '/', '', isset($_SERVER['HTTPS']), true);
} }
}; };

View file

@ -5,12 +5,12 @@ use App\Models\ErrorTemplate;
use TikScraper\Models\Meta; use TikScraper\Models\Meta;
class ErrorHandler { class ErrorHandler {
static public function showMeta(Meta $meta) { public static function showMeta(Meta $meta) {
http_response_code($meta->http_code); http_response_code($meta->http_code);
Wrappers::latte('error', new ErrorTemplate($meta->http_code, $meta->tiktok_msg, $meta->tiktok_code)); Wrappers::latte('error', new ErrorTemplate($meta->http_code, $meta->tiktok_msg, $meta->tiktok_code));
} }
static public function showText(int $code, string $msg) { public static function showText(int $code, string $msg) {
http_response_code($code); http_response_code($code);
Wrappers::latte('error', new ErrorTemplate($code, $msg)); Wrappers::latte('error', new ErrorTemplate($code, $msg));
} }

View file

@ -2,33 +2,34 @@
namespace App\Helpers; namespace App\Helpers;
class Misc { class Misc {
static public function getCursor(): int { public static function getCursor(): int {
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0; 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'] : ''; 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; 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; return $_ENV[$key] ?? $default_value;
} }
/** /**
* Returns absolute path for view * 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"; return __DIR__ . "/../../templates/views/{$template}.latte";
} }
/** /**
* Common method for rss feeds * 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' . '"'); header('Content-Disposition: attachment; filename="' . $title . '.rss' . '"');
} }
} }

View file

@ -2,29 +2,29 @@
namespace App\Helpers; namespace App\Helpers;
class UrlBuilder { class UrlBuilder {
static public function stream(string $url): string { public static function stream(string $url): string {
return Misc::url('/stream?url=' . urlencode($url)); 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); $down_url = Misc::url('/download?url=' . urlencode($url) . '&id=' . $id . '&user=' . $username);
if ($watermark) $down_url .= '&watermark=1'; if ($watermark) $down_url .= '&watermark=1';
return $down_url; return $down_url;
} }
static public function user(string $username): string { public static function user(string $username): string {
return Misc::url('/@' . $username); return Misc::url('/@' . $username);
} }
static public function tag(string $tag): string { public static function tag(string $tag): string {
return Misc::url('/tag/' . $tag); 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); 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; return "https://www.tiktok.com/@" . $username . "/video/" . $id;
} }
} }

View file

@ -12,7 +12,7 @@ class Wrappers {
/** /**
* Setup of Latte template engine * 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; $latte = new \Latte\Engine;
$cache_path = Misc::env('LATTE_CACHE', __DIR__ . '/../../cache/latte'); $cache_path = Misc::env('LATTE_CACHE', __DIR__ . '/../../cache/latte');
$latte->setTempDirectory($cache_path); $latte->setTempDirectory($cache_path);
@ -91,9 +91,19 @@ class Wrappers {
return UrlBuilder::download($url, $username, $id, $watermark); 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 // Add URLs to video descriptions
// TODO: Make it work with unicode characters such as emojis // TODO: Make it work with unicode characters such as emojis
$latte->addFunction('render_desc', function (string $desc, array $textExtras = []): string { $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); $sanitizedDesc = htmlspecialchars($desc);
$out = $sanitizedDesc; $out = $sanitizedDesc;
foreach ($textExtras as $extra) { foreach ($textExtras as $extra) {
@ -121,7 +131,7 @@ class Wrappers {
/** /**
* Setup of TikTok Api wrapper * Setup of TikTok Api wrapper
*/ */
static public function api(): \TikScraper\Api { public static function api(): \TikScraper\Api {
$method = Misc::env('API_SIGNER', ''); $method = Misc::env('API_SIGNER', '');
$url = Misc::env('API_SIGNER_URL', ''); $url = Misc::env('API_SIGNER_URL', '');
if (!$method) { if (!$method) {

View file

@ -1,7 +1,7 @@
{ {
"name": "pablouser1/proxitok", "name": "pablouser1/proxitok",
"description": "An alternative frontend for TikTok", "description": "An alternative frontend for TikTok",
"version": "2.4.8.1", "version": "2.4.9.1",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"type": "project", "type": "project",
"authors": [ "authors": [

14
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "15a71acabddd2588be9800ae1bb37c92", "content-hash": "790ea9098323ef66c520cfe44b92b7d3",
"packages": [ "packages": [
{ {
"name": "bramus/router", "name": "bramus/router",
@ -303,16 +303,16 @@
}, },
{ {
"name": "pablouser1/tikscraper", "name": "pablouser1/tikscraper",
"version": "v2.3.6.2", "version": "v2.3.6.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pablouser1/TikScraperPHP.git", "url": "https://github.com/pablouser1/TikScraperPHP.git",
"reference": "10394fb5fb5213d05fe0eb29f7582423fc15d08a" "reference": "b26764777121dbc4408f84140b802869a77b575e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/10394fb5fb5213d05fe0eb29f7582423fc15d08a", "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/b26764777121dbc4408f84140b802869a77b575e",
"reference": "10394fb5fb5213d05fe0eb29f7582423fc15d08a", "reference": "b26764777121dbc4408f84140b802869a77b575e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -346,9 +346,9 @@
"description": "Get data from TikTok API", "description": "Get data from TikTok API",
"support": { "support": {
"issues": "https://github.com/pablouser1/TikScraperPHP/issues", "issues": "https://github.com/pablouser1/TikScraperPHP/issues",
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.6.2" "source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.6.4"
}, },
"time": "2023-04-01T13:46:50+00:00" "time": "2023-04-05T15:08:06+00:00"
}, },
{ {
"name": "php-webdriver/webdriver", "name": "php-webdriver/webdriver",

View file

@ -4,8 +4,8 @@ services:
web: web:
container_name: proxitok-web container_name: proxitok-web
image: ghcr.io/pablouser1/proxitok:master image: ghcr.io/pablouser1/proxitok:master
ports: # ports:
- 8080:80 # - 8080:80
environment: environment:
- LATTE_CACHE=/cache - LATTE_CACHE=/cache
- API_CACHE=redis - API_CACHE=redis
@ -13,6 +13,7 @@ services:
- REDIS_PORT=6379 - REDIS_PORT=6379
- API_SIGNER=remote - API_SIGNER=remote
- API_SIGNER_URL=http://proxitok-signer:8080/signature - API_SIGNER_URL=http://proxitok-signer:8080/signature
- APP_URL=https://proxitok.tams.tech
volumes: volumes:
- proxitok-cache:/cache - proxitok-cache:/cache
depends_on: depends_on:
@ -20,6 +21,7 @@ services:
- signer - signer
networks: networks:
- proxitok - proxitok
- web
security_opt: security_opt:
- no-new-privileges:true - no-new-privileges:true
cap_drop: cap_drop:
@ -28,6 +30,20 @@ services:
- CHOWN - CHOWN
- SETGID - SETGID
- SETUID - SETUID
labels:
# Traefik
traefik.docker.network: web
traefik.domain: tams.tech
traefik.enable: "true"
# Traefik v1
traefik.frontend.rule: Host:proxitok.tams.tech
# DNS discovery (not used)
tech.tams.dns_hosts: proxitok.tams.tech
# Traefik V2
traefik.http.routers.proxitok.rule: Host(`proxitok.tams.tech`)
traefik.http.routers.proxitok.tls: true
traefik.http.routers.proxitok.tls.certresolver: letsencrypt
redis: redis:
container_name: proxitok-redis container_name: proxitok-redis
@ -62,3 +78,6 @@ volumes:
networks: networks:
proxitok: proxitok:
internal: true
web:
external: true

View file

@ -15,6 +15,7 @@
@import "./node_modules/css.gg/icons/scss/comment.scss"; @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/share.scss";
@import "./node_modules/css.gg/icons/scss/software-download.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.scss";
@import "./node_modules/css.gg/icons/scss/lock-unlock.scss"; @import "./node_modules/css.gg/icons/scss/lock-unlock.scss";

3
styles/misc.css Normal file
View file

@ -0,0 +1,3 @@
.new-line {
white-space: pre-wrap;
}

File diff suppressed because one or more lines are too long

View file

@ -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/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,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/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"}

View file

@ -0,0 +1,4 @@
<details>
<summary>{$title}</summary>
{block content}{/block}
</details>

View file

@ -31,6 +31,7 @@
{/if} {/if}
<link rel="stylesheet" href="{static('css', 'cssgg.min.css', true)}"> <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', 'bulma.min.css', true)}">
<link rel="stylesheet" href="{static('css', 'misc.css')}">
<link rel="stylesheet" href="{static('css', 'carousel.css')}"> <link rel="stylesheet" href="{static('css', 'carousel.css')}">
<title>{$title} - ProxiTok</title> <title>{$title} - ProxiTok</title>
</head> </head>

View file

@ -3,19 +3,25 @@
<source src="{url_stream($item->video->playAddr)}" type="video/mp4" /> <source src="{url_stream($item->video->playAddr)}" type="video/mp4" />
</video> </video>
{else} {else}
<section class="carousel" aria-label="carousel" Tabindex="0"> {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"> <div class="slides">
{foreach $item->imagePost->images as $i => $image} {foreach $item->imagePost->images as $i => $image}
<div class="slides-item" id="image-{$i + 1}" tabindex="0"> <div class="slides-item" id="{$item->id}-image{$i + 1}" tabindex="0">
<img src="{url_stream($image->imageURL->urlList[0])}" /> <img src="{url_stream($image->imageURL->urlList[0])}" />
</div> </div>
{/foreach} {/foreach}
</div> </div>
<div class="carousel__nav"> <div class="carousel__nav">
{for $i = 0; $i < count($item->imagePost->images); $i++} {for $i = 0; $i < count($item->imagePost->images); $i++}
<a class="slider-nav" href="#image-{$i + 1}">{$i + 1}</a> <a class="slider-nav" href="#{$item->id}-image{$i + 1}">{$i + 1}</a>
{/for} {/for}
</div> </div>
<div class="carousel__skip-message" id="skip-link" tabindex="0"></div> <div class="carousel__skip-message" id="skip-link" tabindex="0"></div>
</section> </section>
{/if}
{/if} {/if}

View file

@ -1,5 +1,5 @@
<div class="tags"> <div class="tags">
{foreach $challenges as $challenge} {foreach $challenges as $challenge}
<a class="tag is-rounded" href="{path('/tag/' . $challenge->title)}">#{$challenge->title}</a> <a class="tag is-primary is-rounded" href="{path('/tag/' . $challenge->title)}">#{$challenge->title}</a>
{/foreach} {/foreach}
</div> </div>

View file

@ -17,17 +17,30 @@
{if !empty($item->challenges)} {if !empty($item->challenges)}
<p>{include './common/tags.latte', challenges: $item->challenges}</p> <p>{include './common/tags.latte', challenges: $item->challenges}</p>
{/if} {/if}
<p n:ifcontent>{render_desc($item->desc, $item->textExtra)|noescape}</p> <p n:ifcontent>{render_desc($item->desc, $item->textExtra ?? [])|noescape}</p>
<p>Song: {$item->music->title}</p> <p>Song: {$item->music->title}</p>
<audio controls preload="none" src="{url_stream($item->music->playUrl)}"></audio> <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} {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"> <div class="has-text-centered">
{include './common/content.latte', item: $item, isAutoplay: false, isBig: false} {include './common/content.latte', item: $item, isAutoplay: false, isBig: false}
</div> </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> <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', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $item->author->uniqueId}
{/if}
<p class="has-text-centered"><b>Share link</b></p> <p class="has-text-centered"><b>Share link</b></p>
{include './common/share.latte', uniqueId: $item->author->uniqueId, id: $item->id} {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> </div>
</article> </article>
{/foreach} {/foreach}

View file

@ -1,4 +1,3 @@
{contentType application/rss+xml}
<?xml version="1.0" encoding="utf-8" ?> <?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">
<channel> <channel>
@ -9,7 +8,7 @@
{foreach $items as $item} {foreach $items as $item}
<item> <item>
<title>{$item->desc}</title> <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> <link>{url_video_internal($item->author->uniqueId, $item->id)}</link>
<pubDate>{date('r', $item->createTime)}</pubDate> <pubDate>{date('r', $item->createTime)}</pubDate>
<guid isPermaLink="false">{$item->id}</guid> <guid isPermaLink="false">{$item->id}</guid>

View file

@ -14,7 +14,12 @@
{/if} {/if}
<p class="title">{$info->detail->title}</p> <p class="title">{$info->detail->title}</p>
<p class="subtitle">{include '../components/rss.latte'}</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}
{block content} {block content}

View file

@ -10,17 +10,33 @@
<figure class="image is-inline-block is-128x128"> <figure class="image is-inline-block is-128x128">
<img class="is-rounded" src="{url_stream($info->detail->avatarLarger)}" /> <img class="is-rounded" src="{url_stream($info->detail->avatarLarger)}" />
</figure> </figure>
<p class="title">{$info->detail->uniqueId}</p> <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> <p class="subtitle">{include '../components/rss.latte'}</p>
{if $info->detail->privateAccount} {if $info->detail->privateAccount}
<p><strong>Private account</strong></p> <p><strong>Private account</strong></p>
{/if} {/if}
<p>{$info->detail->signature}</p> <b>Description</b>
<p class="new-line">{$info->detail->signature}</p>
{if isset($info->detail->bioLink)} {if isset($info->detail->bioLink)}
<p>Link: <a href="{$info->detail->bioLink->link}">{$info->detail->bioLink->link}</a></p> <p>Link: <a href="{$info->detail->bioLink->link}">{$info->detail->bioLink->link}</a></p>
{/if} {/if}
<b>Stats</b>
<p>Following: {number($info->stats->followingCount)} / Followers: {number($info->stats->followerCount)}</p> <p>Following: {number($info->stats->followingCount)} / Followers: {number($info->stats->followerCount)}</p>
<p>Hearts: {number($info->stats->heartCount)} / Videos: {$info->stats->videoCount}</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}
{block content} {block content}

View file

@ -33,13 +33,16 @@
<p>{include '../components/themes/common/tags.latte', challenges: $item->challenges}</p> <p>{include '../components/themes/common/tags.latte', challenges: $item->challenges}</p>
{/if} {/if}
<div class="content"> <div class="content">
<p n:ifcontent>{render_desc($item->desc, $item->textExtra)|noescape}</p> <p n:ifcontent>{render_desc($item->desc, $item->textExtra ?? [])|noescape}</p>
<p>Song: {$item->music->title}</p> <p>Song: {$item->music->title}</p>
<audio controls preload="none" src="{url_stream($item->music->playUrl)}"></audio> <audio controls preload="none" src="{url_stream($item->music->playUrl)}"></audio>
{include '../components/themes/common/stats.latte', playCount: $item->stats->playCount, diggCount: $item->stats->diggCount, commentCount: $item->stats->commentCount, shareCount: $item->stats->shareCount} {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"> <div class="has-text-centered">
{include '../components/themes/common/share.latte', uniqueId: $info->detail->uniqueId, id: $item->id} {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} {include '../components/themes/common/download.latte', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $info->detail->uniqueId}
{/if}
</div> </div>
</div> </div>
</div> </div>