Fixed /video and set user on video download

This commit is contained in:
Pablo Ferreiro 2022-02-07 18:40:32 +01:00
parent 19553f8837
commit dd5964cb97
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
4 changed files with 9 additions and 9 deletions

View file

@ -26,8 +26,8 @@ class ProxyController {
// Download // Download
$downloader = new \Sovit\TikTok\Download(); $downloader = new \Sovit\TikTok\Download();
$filename = 'tiktok-video'; $filename = 'tiktok-video';
if (isset($_GET['id'])) { if (isset($_GET['id'], $_GET['user'])) {
$filename .= '-' . $_GET['id']; $filename .= '-' . $_GET['user'] . '-' . $_GET['id'];
} }
$downloader->url($url, $filename, 'mp4'); $downloader->url($url, $filename, 'mp4');
} else { } else {

View file

@ -6,7 +6,7 @@
<div class="column is-one-quarter"> <div class="column is-one-quarter">
<a class="clickable-img" id="{$item->id}" href="#{$item->id}" <a class="clickable-img" id="{$item->id}" href="#{$item->id}"
data-video_url="{path('/stream?url=' . urlencode($item->video->playAddr))}" data-video_url="{path('/stream?url=' . urlencode($item->video->playAddr))}"
data-video_download="{path('/stream?url=' . urlencode($item->video->playAddr) . '&download=1&id=' . $item->id)}" data-video_download="{path('/stream?url=' . urlencode($item->video->playAddr) . '&download=1&id=' . $item->id . '&user=' . $item->author->uniqueId)}"
data-desc="{$item->desc}" data-desc="{$item->desc}"
data-music_title="{$item->music->title}" data-music_title="{$item->music->title}"
data-music_url="{path('/stream?url=' . urlencode($item->music->playUrl))}"> data-music_url="{path('/stream?url=' . urlencode($item->music->playUrl))}">

View file

@ -1,7 +1,7 @@
{ {
"name": "pablouser1/proxitok", "name": "pablouser1/proxitok",
"description": "An alternative frontend for TikTok", "description": "An alternative frontend for TikTok",
"version": "1.4.1.1", "version": "1.4.1.2",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"type": "project", "type": "project",
"homepage": "https://github.com/pablouser1/ProxiTok", "homepage": "https://github.com/pablouser1/ProxiTok",

View file

@ -3,20 +3,20 @@
{block content} {block content}
<div class="columns is-centered is-vcentered"> <div class="columns is-centered is-vcentered">
<div class="column"> <div class="column">
<video controls poster="{path('stream?url=' . urlencode($item->items[0]->video->originCover))}"> <video controls poster="{path('/stream?url=' . urlencode($item->items[0]->video->originCover))}">
<source src="{path('stream?url=' . urlencode($item->items[0]->video->playAddr))}" type="video/mp4" /> <source src="{path('/stream?url=' . urlencode($item->items[0]->video->playAddr))}" type="video/mp4" />
</video> </video>
</div> </div>
<div class="column has-text-centered"> <div class="column has-text-centered">
<div class="box"> <div class="box">
<p class="title">Video by <a href="{path('@'.$item->info->detail->user->uniqueId)}">{$item->info->detail->user->uniqueId}</a></p> <p class="title">Video by <a href="{path('/@'.$item->info->detail->user->uniqueId)}">{$item->info->detail->user->uniqueId}</a></p>
<p class="subtitle">{$item->items[0]->desc}</p> <p class="subtitle">{$item->items[0]->desc}</p>
<p>Played {number($item->info->detail->stats->playCount)} times</p> <p>Played {number($item->info->detail->stats->playCount)} times</p>
<p>Shared {number($item->info->detail->stats->shareCount)} times / {number($item->info->detail->stats->commentCount)} comments</p> <p>Shared {number($item->info->detail->stats->shareCount)} times / {number($item->info->detail->stats->commentCount)} comments</p>
<hr /> <hr />
<a href="{path('stream?url=' . urlencode($item->items[0]->video->playAddr) . '&download=1')}" class="button is-info">Download video</a> <a href="{path('/stream?url=' . urlencode($item->items[0]->video->playAddr) . '&download=1')}" class="button is-info">Download video</a>
<p>{$item->items[0]->music->title}</p> <p>{$item->items[0]->music->title}</p>
<audio src="{path('stream?url=' . urlencode($item->items[0]->music->playUrl))}" controls preload="none"></audio> <audio src="{path('/stream?url=' . urlencode($item->items[0]->music->playUrl))}" controls preload="none"></audio>
</div> </div>
</div> </div>
</div> </div>