Merge pull request 'main' (#2) from ashley/poke:main into main

Reviewed-on: https://codeberg.org/Korbs/poke/pulls/2
This commit is contained in:
Korbs 2024-05-01 21:31:28 +00:00
commit 7db35edfda
6 changed files with 42 additions and 53 deletions

View file

@ -47,9 +47,9 @@ This is the source code of Poke (formerly PokeTube), the privacy-friendly youtub
# Features # Features
| <img width="100%" style="border-radius: 24px" src="./css/README_RYD.png"> | <div style="text-align: left"><h3>Return YouTube Dislikes Built-In</h3> Dislikes are viewable thanks to the Return YouTube Dislikes API.</div> | | <img width="100%" style="border-radius: 24px" src="./css/README_RYD.png"> | <div style="text-align: left"><h3>Return YouTube Dislikes Built-In</h3>See the dislikes from returnyoutubedislike! </div> |
| - | - | | - | - |
| <div style="text-align: right"><h3>PWA Support</h3> With PWA Support, you can install Poke on your mobile device.</div> | <img width="100%" style="border-radius: 24px" src="./css/README_PWA.jpg"> | | <div style="text-align: right"><h3>PWA Support</h3> With PWA Support, you can install Poke on your mobile device :3</div> | <img width="100%" style="border-radius: 24px" src="./css/README_PWA.jpg"> |
<h3>Customize</h3> <h3>Customize</h3>
Customize Poketube However you want :3 Customize Poketube However you want :3
@ -84,7 +84,7 @@ PLEASE NOTE THAT THIS SOFTWARE MAY INCULUDE CODECS THAT IN CERTAIN COUNTRIES MAY
Before you host, if ur server is in usa, set the proxylocation to `USA` (which is the default) - if you use any eu server set it to `EU` instead to make videos load faster Before you host, if ur server is in usa, set the proxylocation to `USA` (which is the default) - if you use any eu server set it to `EU` instead to make videos load faster
### With NodeJS ### With NodeJS
To self host your own Poke instance, you'll need some packages installed on your Linux install. To self host your own Poke instance, you'll need some packages installed on your GNU/Linux install.
<details> <details>
<summary>For Fedora/RHEL/Rocky/CentOS</summary> <summary>For Fedora/RHEL/Rocky/CentOS</summary>

View file

@ -28,7 +28,7 @@
<meta name="theme-color" content="#414161"> <meta name="theme-color" content="#414161">
<meta http-equiv="content-language" content="en-us"> <meta http-equiv="content-language" content="en-us">
<meta name="viewport" content="width=device-1200px, initial-scale=1.0, shrink-to-fit=yes, viewport-fit=cover"> <meta name="viewport" content="width=device-1200px, initial-scale=1.0, shrink-to-fit=yes, viewport-fit=cover">
<link rel="stylesheet" href="/css/landing.css?v=244"> <link rel="stylesheet" href="/css/landing.css?v=2544">
<link rel="stylesheet" href="/css/snow.css"> <link rel="stylesheet" href="/css/snow.css">
<link rel="stylesheet" href="/css/app.main.css"> <link rel="stylesheet" href="/css/app.main.css">
<link href=/css/yt-ukraine.svg?v=6 rel=icon> <link href=/css/yt-ukraine.svg?v=6 rel=icon>
@ -193,13 +193,6 @@
)%> )%>
</div> </div>
<style>
@import url(https://ka-p.fontawesome.com/releases/v6.4.2/css/pro.min.css?token=fe06fc099b);
@import url(https://ka-p.fontawesome.com/releases/v6.4.2/css/pro-v4-shims.min.css?token=fe06fc099b);
@import url(https://ka-p.fontawesome.com/releases/v6.4.2/css/pro-v5-font-face.min.css?token=fe06fc099b);
@import url(https://ka-p.fontawesome.com/releases/v6.4.2/css/pro-v4-font-face.min.css?token=fe06fc099b);
@import url(https://ka-p.fontawesome.com/assets/fe06fc099b/108504408/custom-icons.css?token=fe06fc099b);
</style>
<script> <script>
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-3.0-or-later // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-3.0-or-later

View file

@ -21,9 +21,6 @@
<!-- Global Header--> <!-- Global Header-->
<!-- This should be inserted as a component/partial --> <!-- This should be inserted as a component/partial -->
<!-- Eventfully, this should be used on ALL pages, to keep things -->
<!-- things consistant across Poke. -->
<header> <header>
<div class="header-content"> <div class="header-content">
<div class="header-start"> <div class="header-start">
@ -31,35 +28,6 @@
<img src="/css/logo-poke.svg?v=5"/> <img src="/css/logo-poke.svg?v=5"/>
<p class="subtitle"> <%- random %></p> <p class="subtitle"> <%- random %></p>
</a> </a>
<% if (secure) { %>
<i style="margin-left: 12px;" class="fa-light fa-lock"
title="
This is a secure and/or offical instance!
you can trust this instance becuase:
- its a offical instance (offical instances have the max. privacy rules )
- logs are kept closed
if you see this lock icon, you can trust the instance!!
But Please note that unofficial instances can add the same lock icon, so please be careful about dad :D!
To verfiy u cab use this hashed code on SHA-265
d312fe1994124e29478
caaddefabec047746608
b8ef09b69b3ac2f63f4
e53a4a
if your domain matches this code you are probably in poketube.fun owo:3
"></i>
<% } %>
<% if (verify) { %>
<i style="margin-left: 12px;" class="fa-light fa-badge-check"
title="
This is a veried instance!
this instance was verified to be fast and secure!
"></i>
<% } %>
</div> </div>
<div class="header-center"> <div class="header-center">
<form action="/search"> <form action="/search">
@ -91,6 +59,7 @@
justify-content: space-between; justify-content: space-between;
max-width: 1264px; max-width: 1264px;
margin: auto; margin: auto;
height: 3em;
} }
.header-start { .header-start {
@ -100,6 +69,7 @@
.header-start img { .header-start img {
height: 32px; height: 32px;
margin-top: 3em;
} }
form[action="/search"] { form[action="/search"] {
@ -151,4 +121,4 @@
color: white; color: white;
gap: 6px; gap: 6px;
} }
</style> </style> <link href="<%- proxyurl %>/https://site-assets.fontawesome.com/releases/v6.1.1/css/all.css" rel=stylesheet>

View file

@ -458,15 +458,15 @@ Web
<% results.forEach(x => { %> <% results.forEach(x => { %>
<div class="video" style="height: 6em;"> <div class="video" style="height: 6em;">
<a style="min-width: 81em;" href="<%= x.link %>"><%= x.title %></a><br> <a style="min-width: 81em;" href="<%= x.url %>"><%= x.title %></a><br>
<p style="color:gray;display: flex;flex-direction: column;width: 48em;margin-top: -8em;"><%= x.link %><br> <p style="color:gray;display: flex;flex-direction: column;width: 48em;margin-top: -8em;"><%= x.url %><br>
<% if (!isMobile) { %> <% if (!isMobile) { %>
<span style="color:white;width: 48em;display: flex;"><%= x.snippet %></span> <span style="color:white;width: 48em;display: flex;"><%= x.description %></span>
<% } %> <% } %>
<% if (isMobile) { %> <% if (isMobile) { %>
<span style="color:white;max-width: 15em;display: flex;"><%= x.snippet %></span> <span style="color:white;max-width: 15em;display: flex;"><%= x.description %></span>
<% } %> <% } %>
</p> </p>
</div> </div>

View file

@ -47,6 +47,29 @@ const splash = [
"pika!", "pika!",
"fsf.org", "fsf.org",
"ssfffssfssfffaassssfsdf!", "ssfffssfssfffaassssfsdf!",
"can you save my hds?",
"sahlo folina!",
"we come for you!",
"no chances!",
"dema dont control us!",
"im fairly local!",
"i dont wanna go like this!",
"east is up!",
"not done, josh dun!",
"your the judge, oh no!",
"I dont wanna backslide",
"sai is propaganda!",
" •|i|• Ø i+! ].[",
"stay alive! |-/",
"the few, the proud, the Emotional!",
"ill morph into someone else",
"still alive",
"follow the torches",
"i created this world!",
"to feel some control!",
"destory it if i want!",
"o7 keons",
"at least let me clean my room",
"100+ stars on gh!", "100+ stars on gh!",
"now even gayer!", "now even gayer!",
"poketube!!!", "poketube!!!",
@ -116,6 +139,7 @@ module.exports = function (app, config, renderTemplate) {
const random = splash[Math.floor(Math.random() * splash.length)]; const random = splash[Math.floor(Math.random() * splash.length)];
const browser = req.useragent.browser; const browser = req.useragent.browser;
const isOldWindows = (uaos === "Windows 7" || uaos === "Windows 8") && browser === "Firefox"; const isOldWindows = (uaos === "Windows 7" || uaos === "Windows 8") && browser === "Firefox";
var proxyurl = config.p_url;
const secure = [ const secure = [
"poketube.fun", "poketube.fun",
@ -136,6 +160,7 @@ module.exports = function (app, config, renderTemplate) {
secure, secure,
verify, verify,
isOldWindows, isOldWindows,
proxyurl,
random random
}); });
}; };

View file

@ -188,7 +188,7 @@ module.exports = function (app, config, renderTemplate) {
const { fetch } = await import("undici"); const { fetch } = await import("undici");
const search = await fetch( const search = await fetch(
`https://librex.uk.to/api.php?q=${query}&p=1&t=0` `https://4get.sudovanilla.com/api/v1/web?s=${query}`
); );
const web = getJson(await search.text()); const web = getJson(await search.text());
@ -229,7 +229,8 @@ module.exports = function (app, config, renderTemplate) {
let continuation = req.query.continuation || ""; let continuation = req.query.continuation || "";
try { try {
const results = Object.entries(web);
const results = web.web;
renderTemplate(res, req, "search-web.ejs", { renderTemplate(res, req, "search-web.ejs", {
j: "", j: "",