mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89d9ad2f9c | |||
| 7ddf6f7738 | |||
| 059bf7208a | |||
| d5858c39fd | |||
| 76be343c13 | |||
| a7b0edf8fe | |||
| 73e9d7a1cd | |||
| 0224cd25eb |
@@ -3,7 +3,7 @@ name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: pablouser1
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "pablouser1/proxitok",
|
||||
"description": "An alternative frontend for TikTok",
|
||||
"version": "2.4.3.5",
|
||||
"version": "2.4.4.0",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "project",
|
||||
"authors": [
|
||||
|
||||
Generated
+13
-13
@@ -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.1",
|
||||
"version": "v2.3.3.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
||||
"reference": "b62fad1c00a4d62eda3e86811d35f7241cac097e"
|
||||
"reference": "dff2feebe7973d576f4ba097e624fdecd9f7d337"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/b62fad1c00a4d62eda3e86811d35f7241cac097e",
|
||||
"reference": "b62fad1c00a4d62eda3e86811d35f7241cac097e",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/dff2feebe7973d576f4ba097e624fdecd9f7d337",
|
||||
"reference": "dff2feebe7973d576f4ba097e624fdecd9f7d337",
|
||||
"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.1"
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.3.3.2"
|
||||
},
|
||||
"time": "2022-11-26T22:50:46+00:00"
|
||||
"time": "2023-01-25T12:58:06+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": [],
|
||||
|
||||
Vendored
+1
@@ -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
@@ -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');
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
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
@@ -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,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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user