Compare commits

..

11 Commits

Author SHA1 Message Date
Pablo Ferreiro faf1dcee51 bump, video showing up 2023-01-25 15:18:46 +01:00
Pablo Ferreiro 89d9ad2f9c Mobile-friendly 2023-01-25 15:00:52 +01:00
Pablo Ferreiro 7ddf6f7738 bump cosign 2023-01-25 14:10:35 +01:00
Pablo Ferreiro 059bf7208a bump 2023-01-25 13:59:59 +01:00
Pablo Ferreiro d5858c39fd Fixed undefined vars 2022-12-27 16:58:03 +01:00
Pablo Ferreiro 76be343c13 Merge pull request #114 from TheFrenchGhosty/patch-1
Update the credits, deprecate my image
2022-12-27 14:37:27 +00:00
TheFrenchGhosty a7b0edf8fe Update the credits, deprecate my image 2022-12-21 17:37:23 +01:00
Pablo Ferreiro 73e9d7a1cd Dynamically generated manifest 2022-11-27 14:26:35 +01:00
Pablo Ferreiro 0224cd25eb Added url_tag 2022-11-27 00:05:11 +01:00
Pablo Ferreiro 215f984fe4 Properly implemented OG 2022-11-26 23:51:45 +01:00
Pablo Ferreiro ee6e8b0593 Revert "Added better og support"
This reverts commit fa3f1e0a7c.
2022-11-26 23:36:20 +01:00
20 changed files with 116 additions and 78 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: pablouser1
assignees: ''
---
+1 -1
View File
@@ -44,7 +44,7 @@ jobs:
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.13.1'
cosign-release: 'v2.0.0-rc.0'
# Workaround: https://github.com/docker/build-push-action/issues/461
+2 -1
View File
@@ -40,7 +40,8 @@ Apply to: Main window (address bar)
* Add custom amount of videos per page
## Credits
[@TheFrenchGhosty](https://github.com/TheFrenchGhosty): Initial Dockerfile and fixes to a usable state. You can check his Docker image [here](https://github.com/PussTheCat-org/docker-proxitok-quay) on Github or [here](https://quay.io/repository/pussthecatorg/proxitok) on Quay
[TheFrenchGhosty](https://thefrenchghosty.me) ([Github](https://github.com/TheFrenchGhosty)): Initial Dockerfile and fixes to a usable state.
### External libraries
* [TikScraperPHP](https://github.com/pablouser1/TikScraperPHP)
* [Latte](https://github.com/nette/latte)
+20 -1
View File
@@ -2,12 +2,13 @@
namespace App\Controllers;
use App\Helpers\ErrorHandler;
use App\Helpers\Misc;
use App\Helpers\UrlBuilder;
/**
* Used to be compatible with HTML forms
*/
class RedirectController {
static public function redirect() {
static public function search() {
$endpoint = '/';
if (isset($_GET['type'], $_GET['term'])) {
$term = trim($_GET['term']);
@@ -48,6 +49,24 @@ class RedirectController {
header("Location: {$url}");
}
static public function download() {
if (!(isset($_GET['videoId'], $_GET['authorUsername'], $_GET['playAddr']))) {
ErrorHandler::showText(400, 'Request incomplete');
return;
}
$watermark = isset($_GET['watermark']) && $_GET['watermark'] === 'yes' ? true : false;
$url = '';
if ($watermark) {
$url = UrlBuilder::download($_GET['playAddr'], $_GET['authorUsername'], $_GET['videoId'], true);
} else {
$url = UrlBuilder::download(UrlBuilder::video_external($_GET['authorUsername'], $_GET['videoId']), $_GET['authorUsername'], $_GET['videoId'], false);
}
header("Location: {$url}");
}
/**
* to_endpoint maps a TikTok URL into a ProxiTok-compatible endpoint URL.
*/
+3
View File
@@ -76,6 +76,9 @@ class Wrappers {
$latte->addFunction('url_user', function (string $username): string {
return UrlBuilder::user($username);
});
$latte->addFunction('url_tag', function (string $tag): string {
return UrlBuilder::tag($tag);
});
$latte->addFunction('url_video_internal', function (string $username, string $id): string {
return UrlBuilder::video_internal($username, $id);
});
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "pablouser1/proxitok",
"description": "An alternative frontend for TikTok",
"version": "2.4.3.4",
"version": "2.4.4.1",
"license": "AGPL-3.0-or-later",
"type": "project",
"authors": [
Generated
+13 -13
View File
@@ -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": "5ed78859acc6f451f60b75dca1887104",
"content-hash": "f9cec7d0ed07b8f1d6db885ceefd3226",
"packages": [
{
"name": "bramus/router",
@@ -263,16 +263,16 @@
},
{
"name": "pablouser1/tikscraper",
"version": "v2.3.3.0",
"version": "v2.3.3.3",
"source": {
"type": "git",
"url": "https://github.com/pablouser1/TikScraperPHP.git",
"reference": "2da42296d97138acb75df5a3b70e7fd0a24ec270"
"reference": "a870b234fbb10f2bafea2130510f463b03069dd8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/2da42296d97138acb75df5a3b70e7fd0a24ec270",
"reference": "2da42296d97138acb75df5a3b70e7fd0a24ec270",
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/a870b234fbb10f2bafea2130510f463b03069dd8",
"reference": "a870b234fbb10f2bafea2130510f463b03069dd8",
"shasum": ""
},
"require": {
@@ -305,9 +305,9 @@
"description": "Get data from TikTok API",
"support": {
"issues": "https://github.com/pablouser1/TikScraperPHP/issues",
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.3.0"
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.3.3"
},
"time": "2022-11-26T22:27:16+00:00"
"time": "2023-01-25T14:15:59+00:00"
},
{
"name": "php-webdriver/webdriver",
@@ -572,16 +572,16 @@
},
{
"name": "symfony/process",
"version": "v5.4.11",
"version": "v5.4.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1"
"reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1",
"reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1",
"url": "https://api.github.com/repos/symfony/process/zipball/c5ba874c9b636dbccf761e22ce750e88ec3f55e1",
"reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1",
"shasum": ""
},
"require": {
@@ -614,7 +614,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v5.4.11"
"source": "https://github.com/symfony/process/tree/v5.4.19"
},
"funding": [
{
@@ -630,7 +630,7 @@
"type": "tidelift"
}
],
"time": "2022-06-27T16:58:25+00:00"
"time": "2023-01-01T08:32:19+00:00"
}
],
"packages-dev": [],
+1
View File
@@ -28,6 +28,7 @@ $bulmaswatch-import-font: false;
@import "./node_modules/bulma/sass/form/tools.sass";
// Components
@import "./node_modules/bulma/sass/components/breadcrumb.sass";
@import "./node_modules/bulma/sass/components/card.sass";
@import "./node_modules/bulma/sass/components/dropdown.sass";
@import "./node_modules/bulma/sass/components/media.sass";
+32 -1
View File
@@ -2,6 +2,7 @@
/** @var \Bramus\Router\Router $router */
use App\Helpers\ErrorHandler;
use App\Helpers\Misc;
use App\Helpers\Wrappers;
use App\Models\BaseTemplate;
@@ -21,9 +22,39 @@ $router->get('/verify', function () {
Wrappers::latte('verify', new BaseTemplate('verify'));
});
$router->get('/manifest', function () {
header('Content-Type: application/json');
$data = [
"name" => "ProxiTok",
"short_name" => "ProxiTok",
"description" => "Use TikTok with a privacy-friendly alternative frontend",
"lang" => "en-US",
"theme_color" => "#4040ff",
"background_color" => "#ffffff",
"display" => "standalone",
"orientation" => "portrait-primary",
"icons" => [
[
"src" => Misc::url('/android-chrome-192x192.png'),
"sizes" => "192x192",
"type" => "image/png"
],
[
"src" => Misc::url('/android-chrome-512x512.png'),
"sizes" => "512x512",
"type" => "image/png"
]
],
"start_url" => Misc::url('/'),
"scope" => Misc::url('/')
];
echo json_encode($data, JSON_PRETTY_PRINT);
});
$router->get('/stream', 'ProxyController@stream');
$router->get('/download', 'ProxyController@download');
$router->get('/redirect', 'RedirectController@redirect');
$router->get('/redirect/search', 'RedirectController@search');
$router->get('/redirect/download', 'RedirectController@download');
$router->mount('/trending', function () use ($router) {
$router->get('/', 'TrendingController@get');
-23
View File
@@ -1,23 +0,0 @@
{
"name": "ProxiTok",
"short_name": "ProxiTok",
"description": "Use TikTok with a privacy-friendly alternative frontend",
"orientation": "portrait-primary",
"icons": [
{
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"id": "./",
"start_url": "./",
"theme_color": "#4040ff",
"background_color": "#ffffff",
"display": "standalone"
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -5,7 +5,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="{path('/apple-touch-icon.png')}">
<link rel="icon" type="image/png" sizes="32x32" href="{path('/favicon-32x32.png')}">
<link rel="icon" type="image/png" sizes="16x16" href="{path('/favicon-16x16.png')}">
<link rel="manifest" href="{path('/site.webmanifest')}">
<link rel="manifest" href="{path('/manifest')}">
{if isset($og, $og_content, $og_url)}
<!-- Using TikTok's meta config -->
<meta property="og:title" content="{$og->title}" />
+1 -1
View File
@@ -1,6 +1,6 @@
<link rel="stylesheet" href="{static('css', 'themes/card.css')}">
<noscript>JavaScript is required for this section to work!</noscript>
<section class="section">
<noscript>JavaScript is required for this section to work!</noscript>
<div class="columns is-multiline is-vcentered">
{foreach $feed->items as $item}
{do $share_url = url_video_external($item->author->uniqueId, $item->id)}
@@ -1,7 +1,7 @@
<div n:ifset="$data->info" class="buttons">
<div n:ifset="$info" class="buttons">
{* is_numeric is used to avoid having a back button with ttwid cursors *}
{if isset($_GET['cursor']) && is_numeric($_GET['cursor']) && $_GET['cursor'] != 0}
<a class="button is-danger" href="?cursor=0">First</a>
{/if}
<a n:attr="disabled => !$data->feed->hasMore" class="button is-success" href="?cursor={$data->feed->maxCursor}">Next</a>
<a n:attr="disabled => !$feed->hasMore" class="button is-success" href="?cursor={$feed->maxCursor}">Next</a>
</div>
@@ -1,13 +1,22 @@
<div class="dropdown is-hoverable">
<div class="dropdown-trigger">
<button class="button is-success" aria-haspopup="true" aria-controls="dropdown-menu">
{include '../../icon.latte', icon: 'software-download', text: 'Download'}
</button>
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a target="_blank" href="{url_download($playAddr, $uniqueId, $id, true)}" class="dropdown-item">Watermark</a>
<a target="_blank" href="{url_download(url_video_external($uniqueId, $id), $uniqueId, $id, false)}" class="dropdown-item">No watermark</a>
{embed '../../form.latte', path: '/redirect/download', method: 'GET'}
{block fields}
<div class="field has-addons has-addons-centered">
<div class="control">
<div class="select">
<select name="watermark">
<option value="yes">WM</option>
<option value="no">No WM</option>
</select>
</div>
</div>
<div class="control">
<button type="submit" class="button is-success">
{include '../../icon.latte', icon: 'software-download', text: 'Download'}
</a>
</div>
</div>
</div>
</div>
<input type="hidden" name="playAddr" value="{$playAddr}" />
<input type="hidden" name="videoId" value="{$id}" />
<input type="hidden" name="authorUsername" value="{$uniqueId}" />
{/block}
{/embed}
+10 -13
View File
@@ -1,17 +1,14 @@
<div class="dropdown is-hoverable">
<div class="dropdown-trigger">
<button class="button is-primary" aria-haspopup="true" aria-controls="dropdown-menu">
{include '../../icon.latte', icon: 'share', text: 'Share'}
</button>
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a href="{url_video_internal($uniqueId, $id)}" class="dropdown-item has-text-success">
<nav class="breadcrumb is-centered" aria-label="breadcrumbs">
<ul>
<li>
<a class="has-text-success" href="{url_video_internal($uniqueId, $id)}">
{include '../../icon.latte', icon: 'lock', text: 'Instance link'}
</a>
<a href="{url_video_external($uniqueId, $id)}" class="dropdown-item has-text-warning">
</li>
<li>
<a class="has-text-warning" href="{url_video_external($uniqueId, $id)}">
{include '../../icon.latte', icon: 'lock-unlock', text: 'Original Link'}
</a>
</div>
</div>
</div>
</li>
</ul>
</nav>
+1 -1
View File
@@ -25,8 +25,8 @@
</video>
</div>
<div class="has-text-centered">
{include './common/share.latte', uniqueId: $item->author->uniqueId, id: $item->id}
{include './common/download.latte', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $item->author->uniqueId}
<div class="mt-2">{include './common/share.latte', uniqueId: $item->author->uniqueId, id: $item->id}</div>
</div>
</div>
</article>
+1 -1
View File
@@ -3,7 +3,7 @@
{block content}
<p class="title has-text-centered">Welcome to ProxiTok!</p>
<p class="subtitle has-text-centered">An alternative open source frontend for TikTok</p>
{embed '../components/form.latte', path: '/redirect', method: 'GET'}
{embed '../components/form.latte', path: '/redirect/search', method: 'GET'}
{block fields}
<div class="field has-addons has-addons-centered">
<div class="control">
+3 -3
View File
@@ -1,9 +1,9 @@
{layout '../layouts/default.latte'}
{block header}
<p class="title">{$data->info->detail->title}</p>
<p class="subtitle">{$data->info->detail->desc}</p>
<p>Videos: {number($data->info->stats->videoCount)}</p>
<p class="title">{$info->detail->title}</p>
<p class="subtitle">{$info->detail->desc}</p>
<p>Videos: {number($info->stats->videoCount)}</p>
{/block}
{block content}