Compare commits
10 commits
4188fcf064
...
9012ea5977
Author | SHA1 | Date | |
---|---|---|---|
D. Scott Boggs | 9012ea5977 | ||
19a2066fc2 | |||
e43580f3f9 | |||
b5d034437f | |||
4e191922fe | |||
d09830cc89 | |||
3556fef036 | |||
7e65da7fe9 | |||
3bd6c553f4 | |||
aadfeccab1 |
|
@ -6,7 +6,7 @@ use App\Helpers\Wrappers;
|
|||
use App\Models\DiscoverTemplate;
|
||||
|
||||
class DiscoverController {
|
||||
static public function get() {
|
||||
public static function get() {
|
||||
$api = Wrappers::api();
|
||||
$data = $api->discover();
|
||||
if ($data->meta->success) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -10,7 +10,7 @@ class ProxyController {
|
|||
"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);
|
||||
|
@ -18,7 +18,7 @@ class ProxyController {
|
|||
$streamer->url($url);
|
||||
}
|
||||
|
||||
static public function download() {
|
||||
public static function download() {
|
||||
self::checkUrl();
|
||||
$method = Cookies::downloader();
|
||||
$downloader = new \TikScraper\Download($method);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,7 +19,7 @@ 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'];
|
||||
|
|
|
@ -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,7 +23,7 @@ class TagController {
|
|||
}
|
||||
}
|
||||
|
||||
static public function rss(string $name) {
|
||||
public static function rss(string $name) {
|
||||
$api = Wrappers::api();
|
||||
$hashtag = $api->hashtag($name);
|
||||
$hashtag->feed();
|
||||
|
|
|
@ -8,7 +8,7 @@ use App\Helpers\Wrappers;
|
|||
use App\Models\RSSTemplate;
|
||||
|
||||
class TrendingController {
|
||||
static public function get() {
|
||||
public static function get() {
|
||||
$api = Wrappers::api();
|
||||
$cursor = Misc::getTtwid();
|
||||
|
||||
|
@ -23,7 +23,7 @@ class TrendingController {
|
|||
}
|
||||
}
|
||||
|
||||
static public function rss() {
|
||||
public static function rss() {
|
||||
$api = Wrappers::api();
|
||||
$trending = $api->trending();
|
||||
$trending->feed();
|
||||
|
|
|
@ -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,7 +37,7 @@ class UserController {
|
|||
}
|
||||
}
|
||||
|
||||
static public function rss(string $username) {
|
||||
public static function rss(string $username) {
|
||||
$api = Wrappers::api();
|
||||
$user = $api->user($username);
|
||||
$user->feed();
|
||||
|
|
|
@ -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,12 +5,12 @@ use App\Models\ErrorTemplate;
|
|||
use TikScraper\Models\Meta;
|
||||
|
||||
class ErrorHandler {
|
||||
static public function showMeta(Meta $meta) {
|
||||
public static function showMeta(Meta $meta) {
|
||||
http_response_code($meta->http_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);
|
||||
Wrappers::latte('error', new ErrorTemplate($code, $msg));
|
||||
}
|
||||
|
|
|
@ -2,33 +2,34 @@
|
|||
namespace App\Helpers;
|
||||
|
||||
class Misc {
|
||||
static public function getCursor(): int {
|
||||
public static function getCursor(): int {
|
||||
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0;
|
||||
}
|
||||
|
||||
static public function getTtwid(): string {
|
||||
public static function getTtwid(): string {
|
||||
return isset($_GET['cursor']) ? $_GET['cursor'] : '';
|
||||
}
|
||||
|
||||
static public function url(string $endpoint = ''): string {
|
||||
public static function url(string $endpoint = ''): string {
|
||||
return self::env('APP_URL', '') . $endpoint;
|
||||
}
|
||||
|
||||
static public function env(string $key, $default_value) {
|
||||
public static function env(string $key, $default_value) {
|
||||
return $_ENV[$key] ?? $default_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns absolute path for view
|
||||
*/
|
||||
static public function getView(string $template): string {
|
||||
public static function getView(string $template): string {
|
||||
return __DIR__ . "/../../templates/views/{$template}.latte";
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
@ -91,9 +91,19 @@ class Wrappers {
|
|||
return UrlBuilder::download($url, $username, $id, $watermark);
|
||||
});
|
||||
|
||||
$latte->addFunction('bool_to_str', function (bool $cond): string {
|
||||
return $cond ? 'yes' : 'no';
|
||||
});
|
||||
|
||||
// Add URLs to video descriptions
|
||||
// TODO: Make it work with unicode characters such as emojis
|
||||
$latte->addFunction('render_desc', function (string $desc, array $textExtras = []): string {
|
||||
$bytesCount = strlen($desc);
|
||||
$charsCount = mb_strlen($desc);
|
||||
// Skip urlify for now if there is a special char like an emoji to avoid issues
|
||||
if ($bytesCount !== $charsCount) {
|
||||
return $desc;
|
||||
}
|
||||
$sanitizedDesc = htmlspecialchars($desc);
|
||||
$out = $sanitizedDesc;
|
||||
foreach ($textExtras as $extra) {
|
||||
|
@ -121,7 +131,7 @@ class Wrappers {
|
|||
/**
|
||||
* Setup of TikTok Api wrapper
|
||||
*/
|
||||
static public function api(): \TikScraper\Api {
|
||||
public static function api(): \TikScraper\Api {
|
||||
$method = Misc::env('API_SIGNER', '');
|
||||
$url = Misc::env('API_SIGNER_URL', '');
|
||||
if (!$method) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "pablouser1/proxitok",
|
||||
"description": "An alternative frontend for TikTok",
|
||||
"version": "2.4.8.1",
|
||||
"version": "2.4.9.1",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "project",
|
||||
"authors": [
|
||||
|
|
14
composer.lock
generated
14
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "15a71acabddd2588be9800ae1bb37c92",
|
||||
"content-hash": "790ea9098323ef66c520cfe44b92b7d3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bramus/router",
|
||||
|
@ -303,16 +303,16 @@
|
|||
},
|
||||
{
|
||||
"name": "pablouser1/tikscraper",
|
||||
"version": "v2.3.6.2",
|
||||
"version": "v2.3.6.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
||||
"reference": "10394fb5fb5213d05fe0eb29f7582423fc15d08a"
|
||||
"reference": "b26764777121dbc4408f84140b802869a77b575e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/10394fb5fb5213d05fe0eb29f7582423fc15d08a",
|
||||
"reference": "10394fb5fb5213d05fe0eb29f7582423fc15d08a",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/b26764777121dbc4408f84140b802869a77b575e",
|
||||
"reference": "b26764777121dbc4408f84140b802869a77b575e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -346,9 +346,9 @@
|
|||
"description": "Get data from TikTok API",
|
||||
"support": {
|
||||
"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",
|
||||
|
|
|
@ -4,8 +4,8 @@ services:
|
|||
web:
|
||||
container_name: proxitok-web
|
||||
image: ghcr.io/pablouser1/proxitok:master
|
||||
ports:
|
||||
- 8080:80
|
||||
# ports:
|
||||
# - 8080:80
|
||||
environment:
|
||||
- LATTE_CACHE=/cache
|
||||
- API_CACHE=redis
|
||||
|
@ -13,6 +13,7 @@ services:
|
|||
- REDIS_PORT=6379
|
||||
- API_SIGNER=remote
|
||||
- API_SIGNER_URL=http://proxitok-signer:8080/signature
|
||||
- APP_URL=https://proxitok.tams.tech
|
||||
volumes:
|
||||
- proxitok-cache:/cache
|
||||
depends_on:
|
||||
|
@ -20,6 +21,7 @@ services:
|
|||
- signer
|
||||
networks:
|
||||
- proxitok
|
||||
- web
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
|
@ -28,6 +30,20 @@ services:
|
|||
- CHOWN
|
||||
- SETGID
|
||||
- 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:
|
||||
container_name: proxitok-redis
|
||||
|
@ -62,3 +78,6 @@ volumes:
|
|||
|
||||
networks:
|
||||
proxitok:
|
||||
internal: true
|
||||
web:
|
||||
external: true
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
@import "./node_modules/css.gg/icons/scss/comment.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/share.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/software-download.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/check-o.scss";
|
||||
|
||||
@import "./node_modules/css.gg/icons/scss/lock.scss";
|
||||
@import "./node_modules/css.gg/icons/scss/lock-unlock.scss";
|
||||
|
|
3
styles/misc.css
Normal file
3
styles/misc.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
.new-line {
|
||||
white-space: pre-wrap;
|
||||
}
|
2
styles/vendor/cssgg.min.css
vendored
2
styles/vendor/cssgg.min.css
vendored
File diff suppressed because one or more lines are too long
2
styles/vendor/cssgg.min.css.map
vendored
2
styles/vendor/cssgg.min.css.map
vendored
|
@ -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"}
|
4
templates/components/details.latte
Normal file
4
templates/components/details.latte
Normal file
|
@ -0,0 +1,4 @@
|
|||
<details>
|
||||
<summary>{$title}</summary>
|
||||
{block content}{/block}
|
||||
</details>
|
|
@ -31,6 +31,7 @@
|
|||
{/if}
|
||||
<link rel="stylesheet" href="{static('css', 'cssgg.min.css', true)}">
|
||||
<link rel="stylesheet" href="{static('css', 'bulma.min.css', true)}">
|
||||
<link rel="stylesheet" href="{static('css', 'misc.css')}">
|
||||
<link rel="stylesheet" href="{static('css', 'carousel.css')}">
|
||||
<title>{$title} - ProxiTok</title>
|
||||
</head>
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="tags">
|
||||
{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}
|
||||
</div>
|
||||
|
|
|
@ -17,17 +17,30 @@
|
|||
{if !empty($item->challenges)}
|
||||
<p>{include './common/tags.latte', challenges: $item->challenges}</p>
|
||||
{/if}
|
||||
<p n:ifcontent>{render_desc($item->desc, $item->textExtra)|noescape}</p>
|
||||
<p n:ifcontent>{render_desc($item->desc, $item->textExtra ?? [])|noescape}</p>
|
||||
<p>Song: {$item->music->title}</p>
|
||||
<audio controls preload="none" src="{url_stream($item->music->playUrl)}"></audio>
|
||||
{include './common/stats.latte', playCount: $item->stats->playCount, diggCount: $item->stats->diggCount, commentCount: $item->stats->commentCount, shareCount: $item->stats->shareCount}
|
||||
<div class="has-text-centered">
|
||||
{include './common/content.latte', item: $item, isAutoplay: false, isBig: false}
|
||||
</div>
|
||||
{if isset($item->video->playAddr) && $item->video->playAddr !== ""}
|
||||
<!-- Download links, not shown if item is a gallery -->
|
||||
<p class="has-text-centered"><b>Download video</b></p>
|
||||
{include './common/download.latte', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $item->author->uniqueId}
|
||||
{/if}
|
||||
<p class="has-text-centered"><b>Share link</b></p>
|
||||
{include './common/share.latte', uniqueId: $item->author->uniqueId, id: $item->id}
|
||||
<div class="has-text-centered">
|
||||
{embed '../details.latte', title: "Details"}
|
||||
{block content}
|
||||
<p>Is Ad: {bool_to_str($item->isAd)}
|
||||
<p>Can duet: {bool_to_str($item->duetEnabled)}</p>
|
||||
<p>Can stitch (add this video to other ones): {bool_to_str($item->stitchEnabled)}</p>
|
||||
<p>Can be shared: {bool_to_str($item->shareEnabled)}
|
||||
{/block}
|
||||
{/embed}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{/foreach}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
{contentType application/rss+xml}
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
|
@ -9,7 +8,7 @@
|
|||
{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>
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -10,17 +10,33 @@
|
|||
<figure class="image is-inline-block is-128x128">
|
||||
<img class="is-rounded" src="{url_stream($info->detail->avatarLarger)}" />
|
||||
</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>
|
||||
{if $info->detail->privateAccount}
|
||||
<p><strong>Private account</strong></p>
|
||||
{/if}
|
||||
<p>{$info->detail->signature}</p>
|
||||
<b>Description</b>
|
||||
<p class="new-line">{$info->detail->signature}</p>
|
||||
{if isset($info->detail->bioLink)}
|
||||
<p>Link: <a href="{$info->detail->bioLink->link}">{$info->detail->bioLink->link}</a></p>
|
||||
{/if}
|
||||
<b>Stats</b>
|
||||
<p>Following: {number($info->stats->followingCount)} / Followers: {number($info->stats->followerCount)}</p>
|
||||
<p>Hearts: {number($info->stats->heartCount)} / Videos: {$info->stats->videoCount}</p>
|
||||
{embed '../components/details.latte', title: "Details"}
|
||||
{block content}
|
||||
<p>Region: {$info->detail->region}</p>
|
||||
{if $info->detail->commerceUserInfo->commerceUser}
|
||||
<p>Category: {$info->detail->commerceUserInfo->category}</p>
|
||||
{/if}
|
||||
{/block}
|
||||
{/embed}
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
|
|
|
@ -33,13 +33,16 @@
|
|||
<p>{include '../components/themes/common/tags.latte', challenges: $item->challenges}</p>
|
||||
{/if}
|
||||
<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>
|
||||
<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}
|
||||
<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>
|
||||
|
|
Loading…
Reference in a new issue