3 Commits
ts ... dev

Author SHA1 Message Date
7028d92d5e changing convert to magick command because of deprecation
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 17s
2024-07-04 03:08:59 +02:00
c1f06de7c5 fixing p1nk theme nav-bg color
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 17s
2024-07-04 01:56:14 +02:00
ce7f854dd6 wip
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 18s
2024-07-04 01:18:41 +02:00
5 changed files with 80 additions and 63 deletions

View File

@ -32,7 +32,7 @@ for(let item of items) {
if(mime.startsWith('video/') || mime == 'image/gif') if(mime.startsWith('video/') || mime == 'image/gif')
await exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./tmp/${itemid}.png`); await exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./tmp/${itemid}.png`);
else if(mime.startsWith('image/') && mime != 'image/gif') else if(mime.startsWith('image/') && mime != 'image/gif')
await exec(`convert ./public/b/${filename} ./tmp/${itemid}.png`); await exec(`magick ./public/b/${filename} ./tmp/${itemid}.png`);
else if(mime.startsWith('audio/')) { else if(mime.startsWith('audio/')) {
if(link.match(/soundcloud/)) { if(link.match(/soundcloud/)) {
let cover = (await exec(`yt-dlp --get-thumbnail "${link}"`)).stdout.trim(); let cover = (await exec(`yt-dlp --get-thumbnail "${link}"`)).stdout.trim();
@ -42,8 +42,8 @@ for(let item of items) {
await exec(`wget "${cover}" -O ./tmp/${itemid}.jpg`); await exec(`wget "${cover}" -O ./tmp/${itemid}.jpg`);
const size = (await fs.promises.stat(`./tmp/${itemid}.jpg`)).size; const size = (await fs.promises.stat(`./tmp/${itemid}.jpg`)).size;
if(size >= 0) { if(size >= 0) {
await exec(`convert ./tmp/${itemid}.jpg ./tmp/${itemid}.png`); await exec(`magick ./tmp/${itemid}.jpg ./tmp/${itemid}.png`);
await exec(`convert ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`); await exec(`magick ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`);
} }
} catch(err) { } catch(err) {
//console.log(err); //console.log(err);
@ -51,21 +51,21 @@ for(let item of items) {
} }
else { else {
await exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`); await exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
await exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`); await exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
} }
} }
else { else {
await exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`); await exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
await exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`); await exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
} }
} }
await exec(`convert "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`); await exec(`magick "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`);
await fs.promises.unlink(`./tmp/${itemid}.png`).catch(err => {}); await fs.promises.unlink(`./tmp/${itemid}.png`).catch(err => {});
await fs.promises.unlink(`./tmp/${itemid}.jpg`).catch(err => {}); await fs.promises.unlink(`./tmp/${itemid}.jpg`).catch(err => {});
} catch(err) { } catch(err) {
//console.log(err); //console.log(err);
await exec(`convert ./mugge.png ./public/t/${itemid}.webp`); await exec(`magick ./mugge.png ./public/t/${itemid}.webp`);
} }
console.log(`current: ${itemid} (${count} / ${total})`); console.log(`current: ${itemid} (${count} / ${total})`);
count++; count++;
@ -76,7 +76,7 @@ for(let item of items) {
const itemid = item.id; const itemid = item.id;
const filename = item.dest; const filename = item.dest;
await exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./debug/tmp/${itemid}`); await exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./debug/tmp/${itemid}`);
await exec(`convert "./debug/tmp/${itemid}" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.png`); await exec(`magick "./debug/tmp/${itemid}" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.png`);
await fs.unlink(`./debug/tmp/${itemid}`); await fs.unlink(`./debug/tmp/${itemid}`);
console.log(`current: ${itemid} (${count} / ${total})`); console.log(`current: ${itemid} (${count} / ${total})`);
} catch(err) {} } catch(err) {}

View File

@ -72,7 +72,7 @@ html[theme='p1nk'] {
--black: #000; --black: #000;
--white: #fff; --white: #fff;
--gray: #262626; --gray: #262626;
--nav-bg: #2b2b2b; --nav-bg: #201f1f;
--nav-brand-border: inset 1px #242424; --nav-brand-border: inset 1px #242424;
--nav-brand-bg: #171717; --nav-brand-bg: #171717;
--navigation-links-bg: #201f1f; --navigation-links-bg: #201f1f;
@ -1618,9 +1618,10 @@ span.placeholder {
} }
@media (max-width: 1325px) { @media (max-width: 1325px) {
.ranking { /* ranking page - idea */
/* .ranking {
grid-template-columns: 1fr 1fr !important; grid-template-columns: 1fr 1fr !important;
} } */
.by-user, .by-user,
.by-stats, .by-stats,
@ -2401,7 +2402,7 @@ table.table tbody tr:nth-of-type(odd) {
.ranking { .ranking {
display: grid; display: grid;
grid-template-columns: auto; grid-template-columns: auto;
justify-content: center; /* justify-content: center; */
} }
.ranking div { .ranking div {
@ -2414,15 +2415,15 @@ table.table tbody tr:nth-of-type(odd) {
} }
.by-user { .by-user {
grid-column: 1; grid-row: 1;
} }
.by-stats { .by-stats {
grid-column: 3; grid-row: 3;
} }
.by-hoster { .by-hoster {
grid-column: 2; grid-row: 2;
} }
/* tags */ /* tags */
@ -3016,3 +3017,7 @@ input#s_avatar {
#s_avatar:hover { #s_avatar:hover {
background: #ffffff0f; background: #ffffff0f;
} }
.theforceofthree {
display: grid;
grid-template-columns: 0.4fr 1fr 0.4fr;
}

View File

@ -62,7 +62,7 @@ export default new class queue {
if(mime.startsWith('video/') || mime == 'image/gif') if(mime.startsWith('video/') || mime == 'image/gif')
await this.exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./tmp/${itemid}.png`); await this.exec(`ffmpegthumbnailer -i./public/b/${filename} -s1024 -o./tmp/${itemid}.png`);
else if(mime.startsWith('image/') && mime != 'image/gif') else if(mime.startsWith('image/') && mime != 'image/gif')
await this.exec(`convert "./public/b/${filename}[0]" ./tmp/${itemid}.png`); await this.exec(`magick "./public/b/${filename}[0]" ./tmp/${itemid}.png`);
else if(mime.startsWith('audio/')) { else if(mime.startsWith('audio/')) {
if(link.match(/soundcloud/)) { if(link.match(/soundcloud/)) {
let cover = (await this.exec(`yt-dlp -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' --get-thumbnail "${link}"`)).stdout.trim(); let cover = (await this.exec(`yt-dlp -f 'bv*[height<=720]+ba/b[height<=720] / wv*+ba/w' --get-thumbnail "${link}"`)).stdout.trim();
@ -72,23 +72,23 @@ export default new class queue {
await this.exec(`wget "${cover}" -O ./tmp/${itemid}.jpg`); await this.exec(`wget "${cover}" -O ./tmp/${itemid}.jpg`);
const size = (await fs.promises.stat(`./tmp/${itemid}.jpg`)).size; const size = (await fs.promises.stat(`./tmp/${itemid}.jpg`)).size;
if(size >= 0) { if(size >= 0) {
await this.exec(`convert ./tmp/${itemid}.jpg ./tmp/${itemid}.png`); await this.exec(`magick ./tmp/${itemid}.jpg ./tmp/${itemid}.png`);
await this.exec(`convert ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`); await this.exec(`magick ./tmp/${itemid}.jpg ./public/ca/${itemid}.webp`);
} }
} catch(err) {} } catch(err) {}
} }
else { else {
await this.exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`); await this.exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
await this.exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`); await this.exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
} }
} }
else { else {
await this.exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`); await this.exec(`ffmpeg -i ./public/b/${filename} -update 1 -map 0:v -map 0:1 -c copy ./tmp/${itemid}.png`);
await this.exec(`convert ./tmp/${itemid}.png ./public/ca/${itemid}.webp`); await this.exec(`magick ./tmp/${itemid}.png ./public/ca/${itemid}.webp`);
} }
} }
await this.exec(`convert "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`); await this.exec(`magick "./tmp/${itemid}.png" -resize "128x128^" -gravity center -crop 128x128+0+0 +repage ./public/t/${itemid}.webp`);
await fs.promises.unlink(`./tmp/${itemid}.png`).catch(_=>{}); await fs.promises.unlink(`./tmp/${itemid}.png`).catch(_=>{});
await fs.promises.unlink(`./tmp/${itemid}.jpg`).catch(_=>{}); await fs.promises.unlink(`./tmp/${itemid}.jpg`).catch(_=>{});
return true; return true;

View File

@ -247,7 +247,7 @@ export default async bot => {
try { try {
await queue.genThumbnail(filename, mime, itemid, link); await queue.genThumbnail(filename, mime, itemid, link);
} catch(err) { } catch(err) {
await queue.exec(`convert ./mugge.png ./public/t/${itemid}.webp`); await queue.exec(`magick ./mugge.png ./public/t/${itemid}.webp`);
} }
let speed = lib.calcSpeed(size, end); let speed = lib.calcSpeed(size, end);

View File

@ -1,51 +1,63 @@
@include(snippets/header) @include(snippets/header)
<div id="main"> <div id="main">
<div class="topf0ckers"> <div class="topf0ckers">
<h3>Top f0ckers of all time <br>- Ranking -</h3> <h3>f0ck Rankings?</h3>
</div> </div>
<div class="ranking"> <div class="theforceofthree">
<div class="by-user"> <div class="triin">
<h3>Biggest taggers</h3> </div>
<table class="table"> <div class="ranking">
<tbody> <div class="by-user">
@for(let i = 0; i < list.length; i++) <h3>Biggest taggers</h3>
<table class="table">
<tr> <tr>
<td>{{ i + 1 }}</td> <th>Rank</th>
<td><a href="/{{ list[i].avatar }}"><img class="avatar" src="/t/{{ list[i].avatar }}.webp"></a></td> <th>Avatar</th>
<td>@if(list[i].admin)&#11088;&nbsp;@endif<a href="/user/{!! list[i].user !!}">{!! list[i].user !!}</a></td> <th>Username</th>
<td>{{ list[i].count }}</td> <th>Tagged</th>
</tr> </tr>
@endfor <tbody>
</tbody> @for(let i = 0; i < list.length; i++)
</table> <tr>
</div> <td>{{ i + 1 }}</td>
<div class="by-hoster"> <td><a href="/{{ list[i].avatar }}"><img class="avatar" src="/t/{{ list[i].avatar }}.webp"></a></td>
<h3>Top {{ hoster.length }} hoster</h3> <td>@if(list[i].admin)&#11088;&nbsp;@endif<a href="/user/{!! list[i].user !!}">{!! list[i].user !!}</a></td>
<table class="table"> <td>{{ list[i].count }}</td>
@each(hoster as host) </tr>
<tr><td>{{ host.part.length ? host.part : "Telegram" }}</td><td>{{ host.c }}</td></tr> @endfor
@endeach </tbody>
</table> </table>
</div> </div>
<div class="by-stats"> <div class="by-hoster">
<h3>Tag stats</h3> <h3>Top {{ hoster.length }} hoster</h3>
<table class="table"> <table class="table">
<tr><td>total</td><td>{{ stats.total }}</td></tr> @each(hoster as host)
<tr><td>tagged</td><td>{{ stats.tagged }}</td></tr> <tr><td>{{ host.part.length ? host.part : "Telegram" }}</td><td>{{ host.c }}</td></tr>
<tr><td>untagged</td><td>{{ stats.untagged }}</td></tr> @endeach
<tr><td>SFW</td><td>{{ stats.sfw }}</td></tr> </table>
<tr><td>NSFW</td><td>{{ stats.nsfw }}</td></tr> </div>
<tr><td>deleted</td><td>{{ stats.deleted }}</td></tr> <div class="by-stats">
<tr><td>missing ids</td><td>{{ stats.untracked }}</td></tr> <h3>Tag stats</h3>
</table> <table class="table">
<tr><td>total</td><td>{{ stats.total }}</td></tr>
<tr><td>tagged</td><td>{{ stats.tagged }}</td></tr>
<tr><td>untagged</td><td>{{ stats.untagged }}</td></tr>
<tr><td>SFW</td><td>{{ stats.sfw }}</td></tr>
<tr><td>NSFW</td><td>{{ stats.nsfw }}</td></tr>
<tr><td>deleted</td><td>{{ stats.deleted }}</td></tr>
<tr><td>missing ids</td><td>{{ stats.untracked }}</td></tr>
</table>
<h3>Top f0cks</h3> <h3>Top f0cks</h3>
<table class="table"> <table class="table">
@each(favotop as favo) @each(favotop as favo)
<tr><td><a href="/{{ favo.item_id }}">{{ favo.item_id }}</a></td><td>{{ favo.favs }}</td></tr> <tr><td><a href="/{{ favo.item_id }}">{{ favo.item_id }}</a></td><td>{{ favo.favs }}</td></tr>
@endeach @endeach
</table> </table>
</div>
</div> </div>
</div> <div class="triout">
</div>
</div>
</div> </div>
@include(snippets/footer) @include(snippets/footer)