Auto patch API
This commit is contained in:
parent
c700036aa2
commit
c8d6516dd7
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@
|
|||
/vendor
|
||||
/cache/views/*
|
||||
!/cache/views/.gitkeep
|
||||
/.new_api
|
||||
|
|
|
@ -37,7 +37,7 @@ location /tiktok-viewer/.env {
|
|||
```
|
||||
|
||||
## Known issues
|
||||
* Right now there is an error when trying to fetch the desired user, there is already a pull request not merged yet fixing this issue on the TikTokApi repo, you can check it out [here](https://github.com/ssovit/TikTok-API-PHP/pull/43)
|
||||
* Right now there is an error when trying to fetch the desired user, there is already a pull request not merged yet fixing this issue on the TikTokApi repo, you can check it out [here](https://github.com/ssovit/TikTok-API-PHP/pull/43). **This is automatically patched after running composer install**
|
||||
|
||||
## TODO
|
||||
* Allow searching for just one video using the ID
|
||||
|
|
|
@ -10,5 +10,10 @@
|
|||
"steampixel/simple-php-router": "^0.7.0",
|
||||
"latte/latte": "^2.10",
|
||||
"vlucas/phpdotenv": "^5.4"
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"php fix_api.php"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
7
fix_api.php
Normal file
7
fix_api.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
if (!file_exists(__DIR__ . '/.new_api')) {
|
||||
$new_api = file_get_contents('https://raw.githubusercontent.com/attend-dunce/TikTok-API-PHP/master/lib/TikTok/Api.php');
|
||||
file_put_contents(__DIR__ . '/vendor/ssovit/tiktok-api/lib/TikTok/Api.php', $new_api);
|
||||
file_put_contents(__DIR__ . '/.new_api', 'DO NOT DELETE! This file proves that you have patched the API');
|
||||
echo('Patched API!');
|
||||
}
|
|
@ -11,6 +11,7 @@ $domains = [
|
|||
"v16-webapp.tiktok.com"
|
||||
],
|
||||
"audio" => [
|
||||
"sf16-ies-music-va.tiktokcdn.com"
|
||||
"sf16-ies-music-va.tiktokcdn.com",
|
||||
"sf77-ies-music-va.tiktokcdn.com"
|
||||
],
|
||||
];
|
||||
|
|
|
@ -3,10 +3,8 @@ require __DIR__ . "/vendor/autoload.php";
|
|||
use Steampixel\Route;
|
||||
|
||||
// LOAD DOTENV
|
||||
if (file_exists(__DIR__ . '/.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||
$dotenv->load();
|
||||
}
|
||||
$dotenv->safeLoad();
|
||||
|
||||
// -- HELPERS -- //
|
||||
function getSubdir(): string {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<footer class="footer">
|
||||
<div class="content">
|
||||
<p class="has-text-centered">
|
||||
Made with <span style="color: #e25555;">♥</span> in <a href="https://github.com/pablouser1/tiktok-viewer">Github</a>
|
||||
Made with <span style="color: #e25555;">♥</span> in <a href="https://github.com/pablouser1/tiktok-alt-frontend">Github</a>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
{include 'components/head.latte', title: 'Home'}
|
||||
|
||||
<body>
|
||||
<section class="hero is-fullheight">
|
||||
<div class="hero-head">
|
||||
{include 'components/navbar.latte'}
|
||||
<section class="hero is-fullheight-with-navbar">
|
||||
</div>
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<p class="title">Welcome to TikTok Alt-Frontend!</p>
|
||||
|
|
Loading…
Reference in a new issue