Compare commits

...

10 Commits

Author SHA1 Message Date
Pablo Ferreiro e12d26562d RIP Legacy Mode 2022-06-04 21:04:43 +02:00
Pablo Ferreiro bdba336d3c cosign update, allow docker deploy with Dockerfile 2022-06-04 20:21:42 +02:00
Pablo Ferreiro 578277d251 Added qemu action 2022-06-04 20:03:21 +02:00
Pablo Ferreiro 240b8d7540 Merge pull request #47 from alefvanoon/patch-1
add arm64 build
2022-06-04 19:56:44 +02:00
alefvanoon 08a28ffc3a add arm64 build 2022-06-04 11:38:23 +00:00
Pablo Ferreiro e1fbf75281 Fixed Video Cache and updated Latte 2022-06-02 11:18:16 +02:00
Pablo Ferreiro c041e84967 Fixed video on Safari 2022-05-30 13:48:06 +02:00
Pablo Ferreiro 6c7c0272d4 Added support for non-ascii characters 2022-05-24 16:35:48 +02:00
Pablo Ferreiro f1728257f2 Fix optional parameters positioning and ttwid 2022-05-24 16:03:43 +02:00
Pablo Ferreiro 0c100d650b hotfix 2022-05-24 14:17:41 +02:00
11 changed files with 49 additions and 58 deletions
+1 -2
View File
@@ -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
+13 -4
View File
@@ -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
+1
View File
@@ -22,3 +22,4 @@ RUN composer update --no-cache \
&& rm -rf /usr/bin/composer
EXPOSE 80
CMD apachectl -D FOREGROUND
+1 -4
View File
@@ -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();
}
}
+1 -6
View File
@@ -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);
+1 -1
View File
@@ -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 {
+1 -3
View File
@@ -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 -8
View File
@@ -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
View File
@@ -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
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": "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",
-1
View File
@@ -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>