mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e12d26562d | |||
| bdba336d3c | |||
| 578277d251 | |||
| 240b8d7540 | |||
| 08a28ffc3a | |||
| e1fbf75281 | |||
| c041e84967 | |||
| 6c7c0272d4 | |||
| f1728257f2 | |||
| 0c100d650b |
+1
-2
@@ -1,8 +1,7 @@
|
||||
# APP_PATH="/proxitok" # Relative path, PLEASE LEAVE EMPTY IF /
|
||||
# APP_URL="http://localhost:8000" # Absolute path to proxitok instance
|
||||
# LATTE_CACHE=/tmp/proxitok_api # Path for Latte cache, leave commented for ./cache/latte
|
||||
|
||||
# API CONFIG
|
||||
# API_FORCE_LEGACY=true # Force legacy mode for wrapper
|
||||
# API_SIGNER_URL="https://example.com" # External signing service
|
||||
# API_BROWSER_URL="http://localhost:4444" # chromedriver url
|
||||
# API_TEST_ENDPOINTS=true # Discomment for usage of testing TikTok endpoints, may help sometimes
|
||||
|
||||
@@ -35,13 +35,16 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
# Install the cosign tool except on PR
|
||||
# https://github.com/sigstore/cosign-installer
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@v2.3.0
|
||||
uses: sigstore/cosign-installer@main
|
||||
with:
|
||||
cosign-release: 'v1.7.1'
|
||||
cosign-release: 'v1.9.0'
|
||||
|
||||
|
||||
# Workaround: https://github.com/docker/build-push-action/issues/461
|
||||
@@ -68,14 +71,20 @@ jobs:
|
||||
|
||||
# Build and push Docker image with Buildx (don't push on PR)
|
||||
# https://github.com/docker/build-push-action
|
||||
- name: Set some variables for the image
|
||||
run: |
|
||||
echo "IMAGE_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
|
||||
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
tags: |
|
||||
ghcr.io/${{ env.IMAGE_NAME }}:latest
|
||||
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
@@ -22,3 +22,4 @@ RUN composer update --no-cache \
|
||||
&& rm -rf /usr/bin/composer
|
||||
|
||||
EXPOSE 80
|
||||
CMD apachectl -D FOREGROUND
|
||||
|
||||
@@ -25,10 +25,7 @@ class SettingsController {
|
||||
self::redirect();
|
||||
}
|
||||
static public function api() {
|
||||
if (isset($_POST['api-legacy'])) {
|
||||
$legacy = $_POST['api-legacy'];
|
||||
}
|
||||
Cookies::set('api-legacy', $legacy);
|
||||
// TODO, ADD COUNT
|
||||
self::redirect();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,13 +10,8 @@ use App\Models\RSSTemplate;
|
||||
class TrendingController {
|
||||
static public function get() {
|
||||
$api = Wrappers::api();
|
||||
$cursor = Misc::getTtwid();
|
||||
|
||||
// Ttwid if standard, cursor if legacy
|
||||
if ($api->isLegacy()) {
|
||||
$cursor = Misc::getCursor();
|
||||
} else {
|
||||
$cursor = Misc::getTtwid();
|
||||
}
|
||||
$trending = $api->trending();
|
||||
$trending->feed($cursor);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ class Misc {
|
||||
}
|
||||
|
||||
static public function getTtwid(): string {
|
||||
return isset($_GET['cursor']) ? $_GET['cursor'] : '';
|
||||
return isset($_GET['cursor']) ? $_GET['cursor'] : '';
|
||||
}
|
||||
|
||||
static public function url(string $endpoint = ''): string {
|
||||
|
||||
@@ -81,8 +81,6 @@ class Wrappers {
|
||||
}
|
||||
}
|
||||
|
||||
// Legacy mode
|
||||
$legacy = Misc::env('API_FORCE_LEGACY', false) || isset($_COOKIE['api-legacy']) && $_COOKIE['api-legacy'] === 'on';
|
||||
return new \TikScraper\Api($options, $legacy, $cacheEngine);
|
||||
return new \TikScraper\Api($options, $cacheEngine);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
{embed '../form.latte', path: '/settings/api', method: 'POST', submit: true}
|
||||
{block fields}
|
||||
<div class="field">
|
||||
<label class="label">Legacy mode</label>
|
||||
<div class="select">
|
||||
<select name="api-legacy">
|
||||
<option hidden disabled selected value> -- Select an option -- </option>
|
||||
<option value="on">On</option>
|
||||
<option value="off">Off</option>
|
||||
</select>
|
||||
</div>
|
||||
<p>TODO</p>
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "pablouser1/proxitok",
|
||||
"description": "An alternative frontend for TikTok",
|
||||
"version": "2.3.0.0",
|
||||
"version": "2.3.1.0",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "project",
|
||||
"authors": [
|
||||
@@ -24,7 +24,7 @@
|
||||
"latte/latte": "^2.11",
|
||||
"bramus/router": "^1.6",
|
||||
"josegonzalez/dotenv": "dev-master",
|
||||
"pablouser1/tikscraper": "^2.0"
|
||||
"pablouser1/tikscraper": "^2.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
Generated
+27
-27
@@ -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": "e0e24f4588d6e34423fa8931ae8ae9a3",
|
||||
"content-hash": "387c0d1d767d85d4d08fadad9b583080",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bramus/router",
|
||||
@@ -117,16 +117,16 @@
|
||||
},
|
||||
{
|
||||
"name": "latte/latte",
|
||||
"version": "v2.11.3",
|
||||
"version": "v2.11.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nette/latte.git",
|
||||
"reference": "f2e16d3ec6968854029740452c20c38a514e6842"
|
||||
"reference": "3a5ed09d92b3bb2c428814bb919c2f8637bc49b1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nette/latte/zipball/f2e16d3ec6968854029740452c20c38a514e6842",
|
||||
"reference": "f2e16d3ec6968854029740452c20c38a514e6842",
|
||||
"url": "https://api.github.com/repos/nette/latte/zipball/3a5ed09d92b3bb2c428814bb919c2f8637bc49b1",
|
||||
"reference": "3a5ed09d92b3bb2c428814bb919c2f8637bc49b1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -195,9 +195,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nette/latte/issues",
|
||||
"source": "https://github.com/nette/latte/tree/v2.11.3"
|
||||
"source": "https://github.com/nette/latte/tree/v2.11.4"
|
||||
},
|
||||
"time": "2022-05-08T03:22:55+00:00"
|
||||
"time": "2022-05-30T13:34:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "m1/env",
|
||||
@@ -263,16 +263,16 @@
|
||||
},
|
||||
{
|
||||
"name": "pablouser1/tikscraper",
|
||||
"version": "v2.0.1.3",
|
||||
"version": "v2.1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pablouser1/TikScraperPHP.git",
|
||||
"reference": "45812af395b376dff6835af192827f34ba7a4cf9"
|
||||
"reference": "443225d18f02073ea154b907f93400acd1fd49a4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/45812af395b376dff6835af192827f34ba7a4cf9",
|
||||
"reference": "45812af395b376dff6835af192827f34ba7a4cf9",
|
||||
"url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/443225d18f02073ea154b907f93400acd1fd49a4",
|
||||
"reference": "443225d18f02073ea154b907f93400acd1fd49a4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -298,9 +298,9 @@
|
||||
"description": "Get data from TikTok API",
|
||||
"support": {
|
||||
"issues": "https://github.com/pablouser1/TikScraperPHP/issues",
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.0.1.3"
|
||||
"source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.1.0.1"
|
||||
},
|
||||
"time": "2022-05-24T12:08:22+00:00"
|
||||
"time": "2022-06-04T18:53:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-webdriver/webdriver",
|
||||
@@ -399,16 +399,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.25.0",
|
||||
"version": "v1.26.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
|
||||
"reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -423,7 +423,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.23-dev"
|
||||
"dev-main": "1.26-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -462,7 +462,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -478,20 +478,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-11-30T18:21:41+00:00"
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.25.0",
|
||||
"version": "v1.26.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
|
||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
|
||||
"reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -500,7 +500,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.23-dev"
|
||||
"dev-main": "1.26-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -545,7 +545,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -561,7 +561,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-03-04T08:16:47+00:00"
|
||||
"time": "2022-05-10T07:21:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
{block content}
|
||||
<p class="title">About this instance</p>
|
||||
<p>Version: {version()}</p>
|
||||
<p>Forcing Legacy mode: {isset($_ENV['API_FORCE_LEGACY']) ? 'yes' : 'no'}</p>
|
||||
<hr />
|
||||
<p class="title">Why would I want to use ProxiTok?</p>
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user