public folder, update wrapper
This commit is contained in:
parent
58170665ed
commit
db3799c344
13
.htaccess
13
.htaccess
|
@ -1,13 +0,0 @@
|
||||||
RewriteEngine on
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteRule . index.php [L]
|
|
||||||
|
|
||||||
# Disable index view
|
|
||||||
Options -Indexes
|
|
||||||
|
|
||||||
# Hide a specific file
|
|
||||||
<Files .env>
|
|
||||||
Order allow,deny
|
|
||||||
Deny from all
|
|
||||||
</Files>
|
|
2
Procfile
2
Procfile
|
@ -1 +1 @@
|
||||||
web: vendor/bin/heroku-php-apache2
|
web: vendor/bin/heroku-php-apache2 public/
|
||||||
|
|
|
@ -21,7 +21,7 @@ WARNING: You'll need a personal Github token for composer.
|
||||||
|
|
||||||
Then you can run it using for example the PHP Development Server with:
|
Then you can run it using for example the PHP Development Server with:
|
||||||
```bash
|
```bash
|
||||||
php -S localhost:8080
|
php -S localhost:8080 -t public
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
|
@ -39,25 +39,25 @@ class ProxyController {
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function stream() {
|
static public function stream() {
|
||||||
if (isset($_GET['download'])) {
|
self::checkUrl();
|
||||||
$downloader = new \TikScraper\Download();
|
$url = $_GET['url'];
|
||||||
$watermark = isset($_GET['watermark']);
|
$streamer = new \TikScraper\Stream();
|
||||||
if ($watermark) {
|
$streamer->url($url);
|
||||||
self::checkUrl();
|
}
|
||||||
$filename = self::getFileName();
|
|
||||||
$downloader->url($_GET['url'], $filename, true);
|
static public function download() {
|
||||||
} else {
|
$downloader = new \TikScraper\Download();
|
||||||
if (!isset($_GET['id'])) {
|
$watermark = isset($_GET['watermark']);
|
||||||
die('You need to send an ID!');
|
if ($watermark) {
|
||||||
}
|
|
||||||
$filename = self::getFileName();
|
|
||||||
$downloader->url($_GET['id'], $filename, false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
self::checkUrl();
|
self::checkUrl();
|
||||||
$url = $_GET['url'];
|
$filename = self::getFileName();
|
||||||
$streamer = new \TikScraper\Stream();
|
$downloader->url($_GET['url'], $filename, true);
|
||||||
$streamer->url($url);
|
} else {
|
||||||
|
if (!isset($_GET['id'])) {
|
||||||
|
die('You need to send an ID!');
|
||||||
|
}
|
||||||
|
$filename = self::getFileName();
|
||||||
|
$downloader->url($_GET['id'], $filename, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
{do $share_url = 'https://tiktok.com/@' . $item->author->uniqueId . '/video/' . $item->id}
|
{do $share_url = 'https://tiktok.com/@' . $item->author->uniqueId . '/video/' . $item->id}
|
||||||
<div class="column is-one-quarter clickable-img" id="{$item->id}" onclick="openVideo(this.id)"
|
<div class="column is-one-quarter clickable-img" id="{$item->id}" onclick="openVideo(this.id)"
|
||||||
data-video_url="{path('/stream?url=' . urlencode($item->video->playAddr))}"
|
data-video_url="{path('/stream?url=' . urlencode($item->video->playAddr))}"
|
||||||
data-video_download_watermark="{path('/stream?url=' . urlencode($item->video->playAddr) . '&download=1&id=' . $item->id . '&user=' . $item->author->uniqueId) . '&watermark='}"
|
data-video_download_watermark="{path('/download?url=' . urlencode($item->video->playAddr) . '&id=' . $item->id . '&user=' . $item->author->uniqueId) . '&watermark='}"
|
||||||
data-video_download_nowatermark="{path('/stream?download=1&id=' . $item->id . '&user=' . $item->author->uniqueId)}"
|
data-video_download_nowatermark="{path('/download?id=' . $item->id . '&user=' . $item->author->uniqueId)}"
|
||||||
data-video_share_url="{$share_url}"
|
data-video_share_url="{$share_url}"
|
||||||
data-desc="{$item->desc}"
|
data-desc="{$item->desc}"
|
||||||
data-music_title="{$item->music->title}"
|
data-music_title="{$item->music->title}"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<meta property="og:title" content="ProxiTok" />
|
<meta property="og:title" content="ProxiTok" />
|
||||||
<meta property="og:description" content="Alternative frontend for TikTok" />
|
<meta property="og:description" content="Alternative frontend for TikTok" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<link rel="stylesheet" href="{path('/styles/bulma.min.css')}">
|
<!-- <link rel="stylesheet" href="{path('/styles/vendor/fontawesome.min.css')}"> -->
|
||||||
|
<link rel="stylesheet" href="{path('/styles/vendor/bulma.min.css')}">
|
||||||
<title>{$title} - ProxiTok</title>
|
<title>{$title} - ProxiTok</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
40
composer.lock
generated
40
composer.lock
generated
|
@ -306,16 +306,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pablouser1/tikscraper",
|
"name": "pablouser1/tikscraper",
|
||||||
"version": "v1.2.5.2",
|
"version": "v1.2.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
||||||
"reference": "9dec950ed23112268bde3e35d7c08fd9c6050f49"
|
"reference": "1bd1d62a62d8dcca433df904162649fd04905114"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/9dec950ed23112268bde3e35d7c08fd9c6050f49",
|
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/1bd1d62a62d8dcca433df904162649fd04905114",
|
||||||
"reference": "9dec950ed23112268bde3e35d7c08fd9c6050f49",
|
"reference": "1bd1d62a62d8dcca433df904162649fd04905114",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -339,9 +339,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/v1.2.5.2"
|
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v1.2.6"
|
||||||
},
|
},
|
||||||
"time": "2022-02-24T20:12:02+00:00"
|
"time": "2022-03-11T17:16:37+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpoption/phpoption",
|
"name": "phpoption/phpoption",
|
||||||
|
@ -416,7 +416,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
"version": "v1.24.0",
|
"version": "v1.25.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||||
|
@ -448,12 +448,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Ctype\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"bootstrap.php"
|
"bootstrap.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Ctype\\": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
|
@ -478,7 +478,7 @@
|
||||||
"portable"
|
"portable"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0"
|
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -498,7 +498,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-mbstring",
|
"name": "symfony/polyfill-mbstring",
|
||||||
"version": "v1.24.0",
|
"version": "v1.25.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||||
|
@ -561,7 +561,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
|
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -581,16 +581,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-php80",
|
"name": "symfony/polyfill-php80",
|
||||||
"version": "v1.24.0",
|
"version": "v1.25.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||||
"reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
|
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
|
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
|
||||||
"reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
|
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -644,7 +644,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
|
"source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -660,7 +660,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-09-13T13:58:33+00:00"
|
"time": "2022-03-04T08:16:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vlucas/phpdotenv",
|
"name": "vlucas/phpdotenv",
|
||||||
|
|
7
public/.htaccess
Normal file
7
public/.htaccess
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^ index.php [QSA,L]
|
||||||
|
|
||||||
|
# Disable index view
|
||||||
|
Options -Indexes
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
require __DIR__ . "/vendor/autoload.php";
|
require __DIR__ . "/../vendor/autoload.php";
|
||||||
|
|
||||||
// LOAD DOTENV
|
// LOAD DOTENV
|
||||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||||
|
@ -9,6 +9,6 @@ $dotenv->safeLoad();
|
||||||
$router = new Bramus\Router\Router();
|
$router = new Bramus\Router\Router();
|
||||||
$router->setNamespace('\App\Controllers');
|
$router->setNamespace('\App\Controllers');
|
||||||
|
|
||||||
require __DIR__ . '/routes.php';
|
require __DIR__ . '/../routes.php';
|
||||||
|
|
||||||
$router->run();
|
$router->run();
|
1
public/styles/vendor/bulma.min.css.map
vendored
Normal file
1
public/styles/vendor/bulma.min.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
/** @var \Bramus\Router\Router $router */
|
||||||
use App\Helpers\Misc;
|
use App\Helpers\Misc;
|
||||||
use App\Models\BaseTemplate;
|
use App\Models\BaseTemplate;
|
||||||
use App\Models\HomeTemplate;
|
use App\Models\HomeTemplate;
|
||||||
|
@ -14,6 +15,7 @@ $router->get('/about', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->get('/stream', 'ProxyController@stream');
|
$router->get('/stream', 'ProxyController@stream');
|
||||||
|
$router->get('/download', 'ProxyController@download');
|
||||||
$router->get('/redirect', 'RedirectController@redirect');
|
$router->get('/redirect', 'RedirectController@redirect');
|
||||||
|
|
||||||
$router->mount('/trending', function () use ($router) {
|
$router->mount('/trending', function () use ($router) {
|
||||||
|
|
11
scss/README.md
Normal file
11
scss/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
This facilities making the bulma.min.css and fontawesome.min.css files, install all dependencies using:
|
||||||
|
```
|
||||||
|
yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
And then use:
|
||||||
|
```
|
||||||
|
yarn bulma && yarn fa
|
||||||
|
```
|
||||||
|
|
||||||
|
This compiles bulma.scss and fontawesome.scss to a css file and helps lowering the size of the css that will be sent to the user.
|
2
scss/fontawesome.scss
vendored
Normal file
2
scss/fontawesome.scss
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
@import "./node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss";
|
||||||
|
@import "./node_modules/@fortawesome/fontawesome-free/scss/solid.scss";
|
14
scss/package.json
Normal file
14
scss/package.json
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"name": "proxitok-scss",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"bulma": "sass --style=compressed bulma.scss ../public/styles/vendor/bulma.min.css",
|
||||||
|
"fa": "sass --style=compressed fontawesome.scss ../public/styles/vendor/fontawesome.min.css"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@fortawesome/fontawesome-free": "^6.0.0",
|
||||||
|
"bulma": "^0.9.3",
|
||||||
|
"bulmaswatch": "^0.8.1",
|
||||||
|
"sass": "^1.46.0"
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,11 @@
|
||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
"@fortawesome/fontawesome-free@^6.0.0":
|
||||||
|
version "6.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.0.0.tgz#6f3bd8e42997c7d536a1246877ed8bcd4f005a54"
|
||||||
|
integrity sha512-6LB4PYBST1Rx40klypw1SmSDArjFOcfBf2LeX9Zg5EKJT2eXiyiJq+CyBYKeXyK0sXS2FsCJWSPr/luyhuvh0Q==
|
||||||
|
|
||||||
anymatch@~3.1.2:
|
anymatch@~3.1.2:
|
||||||
version "3.1.2"
|
version "3.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
|
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
|
||||||
|
@ -113,9 +118,9 @@ readdirp@~3.6.0:
|
||||||
picomatch "^2.2.1"
|
picomatch "^2.2.1"
|
||||||
|
|
||||||
sass@^1.46.0:
|
sass@^1.46.0:
|
||||||
version "1.49.7"
|
version "1.49.9"
|
||||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.49.7.tgz#22a86a50552b9b11f71404dfad1b9ff44c6b0c49"
|
resolved "https://registry.yarnpkg.com/sass/-/sass-1.49.9.tgz#b15a189ecb0ca9e24634bae5d1ebc191809712f9"
|
||||||
integrity sha512-13dml55EMIR2rS4d/RDHHP0sXMY3+30e1TKsyXaSz3iLWVoDWEoboY8WzJd5JMnxrRHffKO3wq2mpJ0jxRJiEQ==
|
integrity sha512-YlYWkkHP9fbwaFRZQRXgDi3mXZShslVmmo+FVK3kHLUELHHEYrCmL1x6IUjC7wLS6VuJSAFXRQS/DxdsC4xL1A==
|
||||||
dependencies:
|
dependencies:
|
||||||
chokidar ">=3.0.0 <4.0.0"
|
chokidar ">=3.0.0 <4.0.0"
|
||||||
immutable "^4.0.0"
|
immutable "^4.0.0"
|
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
||||||
This facilities making the bulma.min.css file, install all dependencies using:
|
|
||||||
```
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
And then use:
|
|
||||||
```
|
|
||||||
yarn bulma
|
|
||||||
```
|
|
||||||
|
|
||||||
This compiles bulma.scss to a css file and helps lowering the size of the css that will be sent to the user.
|
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"name": "proxitok-scss",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"bulma": "sass --style=compressed bulma.scss ../bulma.min.css"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bulma": "^0.9.3",
|
|
||||||
"bulmaswatch": "^0.8.1",
|
|
||||||
"sass": "^1.46.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,9 +15,16 @@
|
||||||
<p>Played {number($feed->info->stats->playCount)} times</p>
|
<p>Played {number($feed->info->stats->playCount)} times</p>
|
||||||
<p>Shared {number($feed->info->stats->shareCount)} times / {number($feed->info->stats->commentCount)} comments</p>
|
<p>Shared {number($feed->info->stats->shareCount)} times / {number($feed->info->stats->commentCount)} comments</p>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="buttons is-centered">
|
<div class="dropdown is-hoverable">
|
||||||
<a href="{path('/stream?url=' . urlencode($item->video->playAddr) . '&download=1&id=' . $item->id . '&user=' . $item->author->uniqueId) . '&watermark='}" class="button is-info">Download watermark</a>
|
<div class="dropdown-trigger">
|
||||||
<a href="{path('/stream?download=1&id=' . $item->id . '&user=' . $feed->info->detail->uniqueId)}" class="button is-info">Download no watermark</a>
|
<button class="button" aria-haspopup="true" aria-controls="dropdown-menu">Download</button>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-menu" role="menu">
|
||||||
|
<div class="dropdown-content">
|
||||||
|
<a href="{path('/download?url=' . urlencode($item->video->playAddr) . '&id=' . $item->id . '&user=' . $item->author->uniqueId) . '&watermark='}" class="dropdown-item">Watermark</a>
|
||||||
|
<a href="{path('/download?id=' . $item->id . '&user=' . $feed->info->detail->uniqueId)}" class="dropdown-item">No watermark</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>{$item->music->title}</p>
|
<p>{$item->music->title}</p>
|
||||||
<audio src="{path('/stream?url=' . urlencode($item->music->playUrl))}" controls preload="none"></audio>
|
<audio src="{path('/stream?url=' . urlencode($item->music->playUrl))}" controls preload="none"></audio>
|
||||||
|
|
Loading…
Reference in a new issue