web manifest tweaks and .latte structure
This commit is contained in:
parent
4bfc4c9434
commit
1176bc35fe
34 changed files with 3 additions and 3 deletions
40
templates/views/about.latte
Normal file
40
templates/views/about.latte
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">Welcome to ProxiTok!</p>
|
||||
<p class="subtitle">
|
||||
Made with <span style="color: #e25555;">♥</span> in <a href="https://github.com/pablouser1/ProxiTok">Github</a>
|
||||
</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
<div class="content">
|
||||
<p class="title">About this instance</p>
|
||||
<p>Frontend version: <b>{version_frontend()}</b></p>
|
||||
<p>Scraper version: <b>{version_scraper()}</b></p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="title">Why would I want to use ProxiTok?</p>
|
||||
<p>
|
||||
There are already
|
||||
<a rel="nofollow" href="https://penetrum.com/tiktok/Penetrum_TikTok_Security_Analysis_whitepaper.pdf">multiple</a>
|
||||
<a rel="nofollow" href="https://rufposten.de/blog/2019/12/05/privacy-analysis-of-tiktoks-app-and-website">articles</a>
|
||||
<a rel="nofollow" href="https://citizenlab.ca/2021/03/tiktok-vs-douyin-security-privacy-analysis">explaining</a>
|
||||
Tiktok's privacy issues.
|
||||
This program allows you to browse TikTok without having to worry about privacy concerns.
|
||||
</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="title">Third party</p>
|
||||
<p>
|
||||
This project wouldn't be possible without the help of the following projects:
|
||||
<ul>
|
||||
<li><a rel="nofollow" href="https://github.com/pablouser1/TikScraperPHP">TikScraperPHP</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/nette/latte">Latte</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/bramus/router">bramus/router</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/josegonzalez/php-dotenv">php-dotenv</a></li>
|
||||
<li><a rel="nofollow" href="https://github.com/jgthms/bulma">Bulma</a> and <a href="https://github.com/jenil/bulmaswatch">Bulmaswatch</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
{/block}
|
||||
44
templates/views/discover.latte
Normal file
44
templates/views/discover.latte
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">Discover</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{foreach $data->feed->items as $type => $items}
|
||||
<p class="title">{$type|firstUpper}</p>
|
||||
<div class="columns is-multiline is-vcentered">
|
||||
{foreach $items as $item}
|
||||
<div class="column is-one-quarter">
|
||||
{embed '../components/card.latte'}
|
||||
{block content}
|
||||
<div class="media">
|
||||
<!-- Show image if exists -->
|
||||
{if !empty($item->cardItem->cover)}
|
||||
<div class="media-left">
|
||||
<figure class="image is-96x96">
|
||||
<img loading="lazy" width="96" height="96" src="{path('/stream?url=' . urlencode($item->cardItem->cover))}" />
|
||||
</figure>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="media-content">
|
||||
<p class="title">{$item->cardItem->title}</p>
|
||||
<p class="subtitle">{$item->cardItem->subTitle}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{$item->cardItem->description}</p>
|
||||
</div>
|
||||
{/block}
|
||||
{block footer}
|
||||
<a href="{path($item->cardItem->link)}" class="card-footer-item">Go</a>
|
||||
{/block}
|
||||
{/embed}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{if !$iterator->last}
|
||||
<hr />
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/block}
|
||||
18
templates/views/error.latte
Normal file
18
templates/views/error.latte
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{layout '../layouts/hero.latte'}
|
||||
|
||||
{block content}
|
||||
<p class="title">There was an error processing your request!</p>
|
||||
<div class="content">
|
||||
<p>HTTP Code: {$http_code}</p>
|
||||
{if isset($tiktok_code)}
|
||||
<p>
|
||||
<span>API error code {$tiktok_code} ({$msg})</span>
|
||||
{if $tiktok_code === 10000 || $tiktok_code === -1}
|
||||
<a href="{path('/verify')}">What does this mean?</a>
|
||||
{/if}
|
||||
</p>
|
||||
{else}
|
||||
<p>{$msg}</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/block}
|
||||
41
templates/views/home.latte
Normal file
41
templates/views/home.latte
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{layout '../layouts/hero.latte'}
|
||||
|
||||
{block content}
|
||||
<p class="title">Welcome to ProxiTok!</p>
|
||||
<p class="subtitle">An alternative open source frontend for TikTok</p>
|
||||
{embed '../components/form.latte', path: '/redirect', method: 'GET'}
|
||||
{block fields}
|
||||
<div class="field has-addons has-addons-centered">
|
||||
<div class="control">
|
||||
<input class="input" name="term" placeholder="Search" required>
|
||||
</div>
|
||||
<div class="control">
|
||||
<div class="select">
|
||||
<select name="type">
|
||||
<option value="url">TikTok URL</option>
|
||||
<option value="user">Username</option>
|
||||
<option value="tag">Tag</option>
|
||||
<option value="music">Music ID</option>
|
||||
<option value="video">Video ID</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-success">
|
||||
{include '../components/icon.latte', icon: 'search', text: 'Search'}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{/embed}
|
||||
<div class="columns is-centered is-mobile">
|
||||
<div class="column is-narrow">
|
||||
<p>Discover</p>
|
||||
<a class="button is-success" href="{path('/discover')}">Go</a>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<p>Trending</p>
|
||||
<a class="button is-success" href="{path('/trending')}">Go</a>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
11
templates/views/music.latte
Normal file
11
templates/views/music.latte
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">{$data->info->detail->title}</p>
|
||||
<p class="subtitle">{$data->info->detail->desc}</p>
|
||||
<p>Videos: {number($data->info->stats->videoCount)}</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{include '../components/feed.latte'}
|
||||
{/block}
|
||||
21
templates/views/rss.latte
Normal file
21
templates/views/rss.latte
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{contentType application/rss+xml}
|
||||
{do header('Content-Disposition: attachment; filename="' . $title . '.rss' . '"')}
|
||||
{var $full_link = path($link)}
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{$title}</title>
|
||||
<description><![CDATA[{$desc}]]></description>
|
||||
<link>{$full_link}</link>
|
||||
<atom:link href="{$full_link . '/rss'}" rel="self" type="application/rss+xml"></atom:link>
|
||||
{foreach $items as $item}
|
||||
<item>
|
||||
<title>{$item->desc}</title>
|
||||
<description><![CDATA[<p>{$item->desc}</p><video controls="controls" preload="auto" src="{path('/stream?url=' . urlencode($item->video->playAddr))}"></video>]]></description>
|
||||
<link>{path('/@' . $item->author->uniqueId . '/video/' . $item->id)}</link>
|
||||
<pubDate>{date('r', $item->createTime)}</pubDate>
|
||||
<guid isPermaLink="false">{$item->id}</guid>
|
||||
</item>
|
||||
{/foreach}
|
||||
</channel>
|
||||
</rss>
|
||||
17
templates/views/settings.latte
Normal file
17
templates/views/settings.latte
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">Settings</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
<div class="content">
|
||||
<p class="title">General</p>
|
||||
{include '../components/settings/general.latte'}
|
||||
</div>
|
||||
<hr />
|
||||
<div class="content">
|
||||
<p class="title">Api</p>
|
||||
{include '../components/settings/api.latte'}
|
||||
</div>
|
||||
{/block}
|
||||
18
templates/views/tag.latte
Normal file
18
templates/views/tag.latte
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{var $has_rss = true}
|
||||
|
||||
{block header}
|
||||
{if $data->info->detail->profileThumb !== ''}
|
||||
<figure class="figure is-96x96">
|
||||
<img src="{path('/stream?url=' . urlencode($data->info->detail->profileThumb))}" />
|
||||
</figure>
|
||||
{/if}
|
||||
<p class="title">{$data->info->detail->title}</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
<p>Videos: {number($data->info->stats->videoCount)} / Views: {number($data->info->stats->viewCount)}</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{include '../components/feed.latte'}
|
||||
{/block}
|
||||
12
templates/views/trending.latte
Normal file
12
templates/views/trending.latte
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{var $has_rss = true}
|
||||
|
||||
{block header}
|
||||
<p class="title">Trending</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{include '../components/feed.latte'}
|
||||
{/block}
|
||||
18
templates/views/user.latte
Normal file
18
templates/views/user.latte
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{var $has_rss = true}
|
||||
|
||||
{block header}
|
||||
<figure class="figure is-96x96">
|
||||
<img src="{path('/stream?url=' . urlencode($data->info->detail->avatarThumb))}" />
|
||||
</figure>
|
||||
<p class="title">{$data->info->detail->uniqueId}</p>
|
||||
<p class="subtitle">{include '../components/rss.latte'}</p>
|
||||
<p>{$data->info->detail->signature}</p>
|
||||
<p>Following: {number($data->info->stats->followingCount)} / Followers: {number($data->info->stats->followerCount)}</p>
|
||||
<p>Hearts: {number($data->info->stats->heartCount)} / Videos: {$data->info->stats->videoCount}</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
{include '../components/feed.latte'}
|
||||
{/block}
|
||||
38
templates/views/verify.latte
Normal file
38
templates/views/verify.latte
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{layout '../layouts/default.latte'}
|
||||
|
||||
{block header}
|
||||
<p class="title">VERIFY_CODE</p>
|
||||
<p class="subtitle">What can I do?</p>
|
||||
{/block}
|
||||
|
||||
{block content}
|
||||
<p>TL;DR You probably have to search for another instance or wait some hours (or even better, have your own self-hosted instance)</p>
|
||||
<p>TikTok has some mecanisms in order to stop scraping on their api:</p>
|
||||
<hr />
|
||||
<div class="block">
|
||||
<p class="is-size-4">Rate limits</p>
|
||||
<p>
|
||||
This is pretty standard stuff,
|
||||
it blocks ips temporarly if you send too many requests to an endpoint and unbans you after some hours.
|
||||
</p>
|
||||
</div>
|
||||
<div class="block">
|
||||
<p class="is-size-4">IP Blacklist</p>
|
||||
<p>
|
||||
It is a list with IPs from popular Hosters (AWS, Heroku...). This IPs are banned <i>(I think) permanently</i> and
|
||||
can barely make requests.
|
||||
</p>
|
||||
<p>
|
||||
This makes hosting a public instance really hard. Even if you use a hosting platform that is not banned by TikTok, it is only a matter of time
|
||||
that it inevitably gets banned.
|
||||
</p>
|
||||
<p class="is-size-5">(For webmasters) How can I know if my server is not blacklisted?</p>
|
||||
<p>Run this command on your instance:</p>
|
||||
<code>
|
||||
curl \
|
||||
--url 'https://www.tiktok.com/@tiktok/?lang=en' \
|
||||
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36'
|
||||
</code>
|
||||
<p>If you don't get an empty response or a captcha, you are good to go</p>
|
||||
</div>
|
||||
{/block}
|
||||
25
templates/views/video.latte
Normal file
25
templates/views/video.latte
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{layout "../layouts/{$layout}.latte"}
|
||||
|
||||
{block content}
|
||||
<div class="columns has-text-centered is-centered is-vcentered is-gapless">
|
||||
<div class="column">
|
||||
<video controls autoplay poster="{url_stream($item->video->originCover)}">
|
||||
<source src="{url_stream($item->video->playAddr)}" type="video/mp4" />
|
||||
</video>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="box">
|
||||
<p class="title">Video by <a href="{url_user($detail->uniqueId)}">{$detail->uniqueId}</a></p>
|
||||
<p class="subtitle">{$item->desc}</p>
|
||||
{include '../components/themes/common/stats.latte', playCount: $item->stats->playCount, diggCount: $item->stats->diggCount, commentCount: $item->stats->commentCount, shareCount: $item->stats->shareCount}
|
||||
<div class="container mt-4">
|
||||
<p>{include '../components/icon.latte', icon: 'music', text: $item->music->title}</p>
|
||||
<audio src="{url_stream($item->music->playUrl)}" controls preload="none"></audio>
|
||||
</div>
|
||||
<hr />
|
||||
{include '../components/themes/common/share.latte', uniqueId: $detail->uniqueId, id: $item->id}
|
||||
{include '../components/themes/common/download.latte', playAddr: $item->video->playAddr, id: $item->id, uniqueId: $detail->uniqueId}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
Loading…
Add table
Add a link
Reference in a new issue