mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-25 17:28:37 +01:00
Merge pull request 'main' (#8) from ashley/poke:main into main
Reviewed-on: https://codeberg.org/Korbs/poketube/pulls/8
This commit is contained in:
commit
5d3e08be33
15 changed files with 251 additions and 149 deletions
|
@ -22,7 +22,7 @@ RUN apt-get update && apt-get -y install \
|
|||
RUN mkdir -p /etc/apt/keyrings
|
||||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
|
||||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install nodejs npm
|
||||
|
|
10
README.md
10
README.md
|
@ -82,7 +82,11 @@ you can view the source code of the openh264 codec in this repo :3 --> https://g
|
|||
PLEASE NOTE THAT THIS SOFTWARE MAY INCULUDE CODECS THAT IN CERTAIN COUNTRIES MAY BE COVERED BY PATENTS OR HAVE LEGAL ISSUES. PATENT AND COPYRIGHT LAWS OPERATE DIFFERENTLY DEPENDING ON WHICH COUNTRY YOU ARE IN. PLEASE OBTAIN LEGAL ADVICE IF YOU ARE UNSURE WHETHER A PARTICULAR PATENT OR RESTRICTION APPLIES TO A CODEC YOU WISH TO USE IN YOUR COUNTRY.
|
||||
|
||||
## Hosting Poke~
|
||||
### With NodeJS
|
||||
|
||||
### IMPORTANT
|
||||
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
|
||||
- To self host your own Poke instance, you'll need the following:
|
||||
|
||||
- [Node.js](https://nodejs.org/en/download/)
|
||||
|
@ -103,11 +107,11 @@ git clone https://github.com/ashley0143/poke.git
|
|||
Or you can use our forgejo instance:
|
||||
|
||||
```
|
||||
git clone https://git.poketube.fun/ashley/poke.gitt
|
||||
git clone https://git.poketube.fun/ashley/poke.git
|
||||
```
|
||||
|
||||
Now, install the needed dependencies within the Poke folder:
|
||||
( go to the folder by running cd pokee)
|
||||
( go to the folder by running cd poke)
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"media_proxy": "https://image-proxy.poketube.fun",
|
||||
"cacher_max_age": "864000",
|
||||
"enablealwayshttps": false,
|
||||
"proxylocation":"USA",
|
||||
"t_url": "https://t.poketube.fun/",
|
||||
"server_port": "6003"
|
||||
}
|
|
@ -890,7 +890,7 @@ video {
|
|||
height: 100%;
|
||||
object-fit: cover;
|
||||
z-index: -1;
|
||||
opacity: 0.2;
|
||||
opacity: 0.27;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -585,19 +585,6 @@ color:#ea9999 !important;
|
|||
|
||||
|
||||
<% } %>
|
||||
<% if (!isMobile) { %>
|
||||
|
||||
<div onclick="closePopup()" id="popup-container">
|
||||
<div id="close-btn" onclick="closePopup()">X</div>
|
||||
|
||||
<% if (cinv.descriptionHtml) { %>
|
||||
|
||||
|
||||
<p style="color:#fff;margin-left: 10px;font-weight: bold;"><%-cinv.descriptionHtml%></p>
|
||||
</div>
|
||||
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
|
||||
|
||||
|
@ -624,26 +611,61 @@ color:#ea9999 !important;
|
|||
</nav>
|
||||
|
||||
<% } %>
|
||||
<% if (cinv.error) { %>
|
||||
<style>
|
||||
|
||||
body {
|
||||
background: #111 !important;
|
||||
height: 100%;
|
||||
}
|
||||
.banned-user {
|
||||
border-radius: 50%;
|
||||
margin-bottom: -2em;
|
||||
pointer-events: none;
|
||||
}
|
||||
.ban-reason {
|
||||
background: #b91f1f;
|
||||
border-radius: 2em;
|
||||
padding: 10px;
|
||||
margin-top: 4em;
|
||||
}
|
||||
|
||||
</style>
|
||||
<img class="banned-user" src="<%- media_proxy_url %>/proxy?url=https://yt3.googleusercontent.com/a/default-user=s100-c-k-c0x00ffffff-no-rj">
|
||||
<p class="ban-reason"> <%- cinv.error %> - literally 1984 lmao</p>
|
||||
|
||||
<% } %>
|
||||
|
||||
<section class=youtube-video>
|
||||
<div class="channel-page">
|
||||
|
||||
<div class="channel-page">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<% if (!cinv.error) { %>
|
||||
|
||||
<% if (!isMobile) { %>
|
||||
<div class="channel-info-container" style="text-align: center;">
|
||||
|
||||
<% if (j?.Channel?.Metadata?.Banners.Thumbnail) { %>
|
||||
<% let thumbnailFound = false; %>
|
||||
<% for (let i = 5; i >= 1; i--) { %>
|
||||
<% if (j.Channel.Metadata.Banners.Thumbnail[i]?.['$t']) { %>
|
||||
<img src="<%- media_proxy_url %>/proxy?url=<%= j.Channel.Metadata.Banners.Thumbnail[i].$t %>" style="height: 30em; object-fit: cover; pointer-events: none;" id="thumbnail_version_<%= i %>">
|
||||
<% thumbnailFound = true; %>
|
||||
<% break; %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if (!thumbnailFound) { %>
|
||||
<img src="https://yt3.googleusercontent.com/tfEr9n7lMxqks-RabIC3cp66_Z2QVFk9qyGofc3MGfvM-NfndDHZPT8AVa9LCoNmzQSQ9wx2Mg=w1707-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj" style="height: 30em; object-fit: cover; pointer-events: none;" id="default_thumbnail">
|
||||
<% } %>
|
||||
<% } else { %>
|
||||
<img src="https://yt3.googleusercontent.com/tfEr9n7lMxqks-RabIC3cp66_Z2QVFk9qyGofc3MGfvM-NfndDHZPT8AVa9LCoNmzQSQ9wx2Mg=w1707-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj" style="height: 30em; object-fit: cover; pointer-events: none;" id="default_thumbnail">
|
||||
<% } %>
|
||||
|
||||
<% if (j?.Channel?.Metadata?.Banners.Thumbnail) { %>
|
||||
|
||||
<img src="https://p.poketube.fun/<%=j.Channel?.Metadata.Banners.Thumbnail[2].$t%>">
|
||||
<% } %>
|
||||
|
||||
<div class="channel-info" style="margin-bottom: 2em;margin-left:3em">
|
||||
<div class="channel-info" style="margin-bottom: 3em;margin-left:2em;margin-top: -11em;">
|
||||
<a href="/avatars/<%=j.Channel?.Metadata.Avatars.Thumbnail?.$t.replace("https://yt3.googleusercontent.com/", "")%>" class="avatar">
|
||||
<img src="/avatars/<%=j.Channel?.Metadata.Avatars.Thumbnail?.$t.replace("https://yt3.googleusercontent.com/", "")%>" alt="Channel Avatar">
|
||||
<img src="/avatars/<%=j.Channel?.Metadata.Avatars.Thumbnail?.$t.replace("https://yt3.googleusercontent.com/", "")%>" alt="Channel Avatar" style="border: 1px solid gray;border-radius: 50%;">
|
||||
</a>
|
||||
|
||||
|
||||
|
@ -1540,6 +1562,19 @@ width: fit-content;
|
|||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (!isMobile) { %>
|
||||
|
||||
<div onclick="closePopup()" id="popup-container">
|
||||
<div id="close-btn" onclick="closePopup()">X</div>
|
||||
|
||||
<% if (cinv.descriptionHtml) { %>
|
||||
|
||||
<p style="color:#fff;margin-left: 10px;font-weight: bold;text-align: left;"><%-cinv.descriptionHtml%></p>
|
||||
</div>
|
||||
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<script src="/css/custom-css.js"> </script>
|
||||
<script>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<meta name="theme-color" content="#414161">
|
||||
<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">
|
||||
<link rel="stylesheet" href="/css/landing.css">
|
||||
<link rel="stylesheet" href="/css/landing.css?v=243">
|
||||
<link rel="stylesheet" href="/css/snow.css">
|
||||
<link href=/css/yt-ukraine.svg?v=6 rel=icon>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
|
|
|
@ -166,7 +166,8 @@ font-family:Ubuntu
|
|||
}
|
||||
|
||||
.playlist-info{
|
||||
position: sticky
|
||||
position: sticky;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.playlist-info::before {
|
||||
|
|
|
@ -395,7 +395,7 @@ a[data-onclick="jump_to_time"] {
|
|||
<% } %>
|
||||
<!-- ICONS -->
|
||||
<link href="<%- proxyurl %>/https://site-assets.fontawesome.com/releases/v6.1.1/css/all.css" rel=stylesheet>
|
||||
<link href="<%- proxyurl %>/https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.css" rel=stylesheet>
|
||||
<link href="<%- proxyurl %>/https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.min.css" rel=stylesheet>
|
||||
|
||||
|
||||
<noscript>
|
||||
|
@ -1199,7 +1199,7 @@ display: block; !important;" autoplay controls>
|
|||
</a>
|
||||
|
||||
<% if (!video?.Channel.Name.endsWith(' - Topic')) { %>
|
||||
<% if (!inv_vid.title.endsWith('Audio)')) { %>
|
||||
<% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %>
|
||||
<% if (support != undefined) { %>
|
||||
|
||||
<div class="new-button button-encryption">
|
||||
|
@ -1221,7 +1221,7 @@ display: block; !important;" autoplay controls>
|
|||
<% if (support == undefined) { %>
|
||||
|
||||
<% if (!video?.Channel.Name.endsWith(' - Topic')) { %>
|
||||
<% if (!inv_vid.title.endsWith('Audio)')) { %>
|
||||
<% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %>
|
||||
|
||||
<div class="new-button button-encryption">
|
||||
<a title="Switch PokeTube Instance :3" style="color:var(--text-color);text-decoration: none;" href="https://redirect.poketube.fun/watch?v=<%=inv_vid.videoId%>">
|
||||
|
@ -1238,14 +1238,12 @@ display: block; !important;" autoplay controls>
|
|||
<% }%> <% }%>
|
||||
<% }%> <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %>
|
||||
|
||||
<% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %>
|
||||
<a class="new-button" title="open this song in poketube music player :3" style="color:var(--text-color);text-decoration: none;" href="/music?v=<%=inv_vid.videoId%>">
|
||||
<% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %>
|
||||
<a class="new-button" title="open this song in poketube music player :3" style="color:var(--text-color);text-decoration: none;" href="/">
|
||||
<div class="pill-button">
|
||||
|
||||
<i class="fa-light fa-music"></i>
|
||||
Open In Music Player
|
||||
</div>
|
||||
</a>
|
||||
WIP! </a>
|
||||
|
||||
<% }%>
|
||||
<% }%>
|
||||
|
@ -1253,7 +1251,7 @@ display: block; !important;" autoplay controls>
|
|||
|
||||
|
||||
<% if (!video?.Channel.Name.endsWith(' - Topic')) { %>
|
||||
<% if (!inv_vid.title.endsWith('Audio)')) { %>
|
||||
<% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %>
|
||||
<% if (inv.comments) { %>
|
||||
|
||||
<div class="new-button button-lite" style=";margin-left: -4px;">
|
||||
|
@ -1291,7 +1289,7 @@ display: block; !important;" autoplay controls>
|
|||
<div style="margin-top:1em;">
|
||||
|
||||
|
||||
<%-String(channelurlfixer(inv_vid.descriptionHtml)).replace(/\n/g, " <br> ").replace(/twitter\.com/g, "nitter.freedit.eu").replace(/reddit\.com/g, "redlib.matthew.science") %>
|
||||
<%-String(channelurlfixer(inv_vid.descriptionHtml)).replace(/\n/g, " <br> ").replace(/twitter\.com/g, "twitter.com").replace(/reddit\.com/g, "redlib.matthew.science") %>
|
||||
</div>
|
||||
<% } %> <% } %> <% } %>
|
||||
|
||||
|
@ -1302,7 +1300,7 @@ display: block; !important;" autoplay controls>
|
|||
<div style="margin-top:1em;">
|
||||
|
||||
|
||||
<%-String(linkify(inv_vid.description)).replace(/\n/g, " <br> ").replace(/twitter\.com/g, "nitter.freedit.eu").replace(/reddit\.com/g, "redlib.matthew.science") %>
|
||||
<%-String(linkify(inv_vid.description)).replace(/\n/g, " <br> ").replace(/twitter\.com/g, "twitter.com").replace(/reddit\.com/g, "redlib.matthew.science") %>
|
||||
</div>
|
||||
<% } %> <% } %> <% } %>
|
||||
|
||||
|
@ -1411,7 +1409,7 @@ display: block; !important;" autoplay controls>
|
|||
<div style="display: flex;margin-left: -134px;gap: 3px;margin-top: 8px;">
|
||||
<% if (twitter) { %>
|
||||
<div style="background: #0009;width: fit-content;padding: 5px;border-radius: 6px;margin-bottom: -15px;">
|
||||
<img src="<%- proxyurl %>/https://cdn.glitch.global/d68d17bb-f2c0-4bc3-993f-50902734f652/8473b88f-36a4-437f-8c14-fb9e38a623d9.image.png?v=1693424579898" class="loaded" style="width: 22px;height: 23px;vertical-align: -7px;"><a style="margin: 1px;" href="https://nitter.freedit.eu/<%- twitter.name %>"> @<%- twitter.name %></a>
|
||||
<img src="<%- proxyurl %>/https://cdn.glitch.global/d68d17bb-f2c0-4bc3-993f-50902734f652/8473b88f-36a4-437f-8c14-fb9e38a623d9.image.png?v=1693424579898" class="loaded" style="width: 22px;height: 23px;vertical-align: -7px;"><a style="margin: 1px;" href="https://twitter.com/<%- twitter.name %>"> @<%- twitter.name %></a>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
|
@ -1825,21 +1823,7 @@ if (/[?&]autoplay=/.test(location.search)) {
|
|||
}
|
||||
<% } %>
|
||||
|
||||
const lazyElements = document.querySelectorAll('*');
|
||||
|
||||
const observer = new IntersectionObserver((entries, observer) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('loaded');
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
lazyElements.forEach(element => {
|
||||
observer.observe(element);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
const languageCode = localStorage.getItem("Language");
|
||||
|
@ -1906,10 +1890,19 @@ lazyElements.forEach(element => {
|
|||
|
||||
<script>
|
||||
let requestId;
|
||||
let lastDrawTime = 0; // Timestamp of the last draw request
|
||||
|
||||
const loopStart = () => {
|
||||
requestId = window.requestAnimationFrame(loopStart)
|
||||
}
|
||||
const now = performance.now();
|
||||
const elapsed = now - lastDrawTime;
|
||||
if (elapsed >= (1000 / 30)) { // Adjusted for milliseconds
|
||||
lastDrawTime = now;
|
||||
draw();
|
||||
}
|
||||
|
||||
// Continue loop using requestAnimationFrame
|
||||
requestId = window.requestAnimationFrame(loopStart);
|
||||
};
|
||||
|
||||
const loopCancel = () => {
|
||||
window.cancelAnimationFrame(requestId)
|
||||
|
@ -2009,7 +2002,10 @@ window.addEventListener("unload", cleanup)
|
|||
</script>
|
||||
<!-- SCRIPTS END -->
|
||||
|
||||
</div> <script>
|
||||
</div>
|
||||
<% if(secure) { %>
|
||||
|
||||
<script>
|
||||
var statsurl = "https://invid-api.poketube.fun/api/v1/stats"
|
||||
|
||||
const userAgent = window.navigator.userAgent;
|
||||
|
@ -2044,6 +2040,7 @@ fetch(statsurl + "?browser=" + encodedBrowserName)
|
|||
|
||||
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
|
||||
</ptd-app-ejs>
|
||||
|
@ -2098,7 +2095,7 @@ fetch(statsurl + "?browser=" + encodedBrowserName)
|
|||
<title> <%=inv_vid.title%> | PokeTube Mobile</title>
|
||||
<link href="/css/mobile.css?v=2" rel=stylesheet>
|
||||
<link href="/css/app.main.css" rel=stylesheet>
|
||||
<link href=<%- proxyurl %>/https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.css rel=stylesheet>
|
||||
<link href="<%- proxyurl %>/https://unpkg.com/ionicons@4.5.10-0/dist/css/ionicons.css" rel=stylesheet>
|
||||
|
||||
<link href=<%- proxyurl %>/https://site-assets.fontawesome.com/releases/v6.1.1/css/all.css rel=stylesheet>
|
||||
<style>
|
||||
|
@ -2113,7 +2110,7 @@ fetch(statsurl + "?browser=" + encodedBrowserName)
|
|||
text-decoration:underline;
|
||||
font-weight:bold
|
||||
}
|
||||
|
||||
|
||||
.video a {
|
||||
text-decoration:none !important;
|
||||
}
|
||||
|
@ -2253,10 +2250,8 @@ a {
|
|||
<% } %>
|
||||
|
||||
</div>
|
||||
<div class="video-title" style="padding: 10px;background: #0009;margin-bottom: 6px;margin-left: 6px;margin-right: 12px;border-radius: 15px;margin-top: 4px;font-family: poketube flex;font-weight: 800;font-stretch: ultra-expanded;">
|
||||
|
||||
<%=inv_vid.title%> <br>
|
||||
<a id="language-button" href="#desc-container" style="color: pink;
|
||||
<div class="video-title" style="padding: 10px;background: #0009;margin-bottom: 6px;margin-left: 6px;margin-right: 12px;border-radius: 15px;margin-top: 4px;font-family: poketube flex;font-weight: 800;font-stretch: ultra-expanded;"><%=inv_vid.title%> <br>
|
||||
<a id="language-button" href="#desc-container" style="color: pink;
|
||||
margin: 0;
|
||||
font-size: 13px;margin:0;padding:0;white-space: nowrap;
|
||||
" class="switch"><%=engagement.viewCount.toLocaleString()%> views <%=date%> <ptd-custom-more>...more</ptd-custom-more>
|
||||
|
@ -2376,28 +2371,7 @@ font-size: 13px;margin:0;padding:0;white-space: nowrap;
|
|||
</div>
|
||||
|
||||
<div class="video-info-bar" style="font-family:'Inter';">
|
||||
|
||||
<!--
|
||||
<div class="video-info-buttons" style="font-family:'Inter';;white-space:yes;background:#333;border-radius: 15px;margin: 6px;align-self: center;align-items: center;">
|
||||
<div>
|
||||
<i class="fa-light fa-thumbs-up" style="font-size:x-large" ></i>
|
||||
<%=convert(engagement.likes)%>
|
||||
</div>
|
||||
<div>
|
||||
<i class="fa-light fa-thumbs-down" style="font-size:x-large" ></i><%=convert(engagement.dislikes)%>
|
||||
</div>
|
||||
<a style="color:#fff" href="/download?v=<%=inv_vid.videoId%>&from=mobile">
|
||||
<i style="font-size:x-large" class="fa-light fa-download"></i>
|
||||
Download
|
||||
</a>
|
||||
<a style="color:#fff" onclick="share()">
|
||||
<i style="font-size:x-large" class="fa-light fa-share"></i>
|
||||
Share
|
||||
</a>
|
||||
<a style="color:#fff" href="#more-button-container"> <i style="font-size:x-large;color:#fff" class="fa-thin fa-circle-plus"></i>More.. </a>
|
||||
</div>
|
||||
|
||||
-->
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2405,7 +2379,7 @@ font-size: 13px;margin:0;padding:0;white-space: nowrap;
|
|||
<div style="display: flex;gap: 3px;">
|
||||
<% if (twitter) { %>
|
||||
<div style="background: #000;width: fit-content;padding: 5px;border-radius: 6px;margin-bottom: -15px;">
|
||||
<img src="<%- proxyurl %>/https://cdn.glitch.global/d68d17bb-f2c0-4bc3-993f-50902734f652/8473b88f-36a4-437f-8c14-fb9e38a623d9.image.png?v=1693424579898" class="loaded" style="width: 22px;height: 23px;vertical-align: -7px;"><a style="margin: 1px;" href="https://nitter.freedit.eu/<%- twitter.name %>"> @<%- twitter.name %></a>
|
||||
<img src="<%- proxyurl %>/https://cdn.glitch.global/d68d17bb-f2c0-4bc3-993f-50902734f652/8473b88f-36a4-437f-8c14-fb9e38a623d9.image.png?v=1693424579898" class="loaded" style="width: 22px;height: 23px;vertical-align: -7px;"><a style="margin: 1px;" href="https://twitter.com/<%- twitter.name %>"> @<%- twitter.name %></a>
|
||||
</div>
|
||||
|
||||
<% } %>
|
||||
|
@ -2527,24 +2501,29 @@ font-size: 13px;margin:0;padding:0;white-space: nowrap;
|
|||
|
||||
|
||||
<div class="nerddd" style="background:#272727;padding: 5px;margin-top: 12px;border-radius: 11px;font-family: 'PokeTube Flex';font-stretch: extra-expanded;font-weight: 700;">
|
||||
<%-String(channelurlfixer(inv_vid.descriptionHtml)).replace(/\n/g, " <br> ").replace(/twitter\.com/g, "nitter.freedit.eu").replace(/reddit\.com/g, "redlib.matthew.science") %>
|
||||
<%-String(channelurlfixer(inv_vid.descriptionHtml)).replace(/\n/g, " <br> ").replace(/twitter\.com/g, "twitter.com").replace(/reddit\.com/g, "redlib.matthew.science") %>
|
||||
|
||||
<div style="margin: 10px;">
|
||||
<div style="justify-content: center;display: flex;padding: 11px;font-family: Ginto nord;gap: 3px;background: #1f1f1f;border-top-left-radius: 10px;border-top-right-radius: 10px;">
|
||||
Connections
|
||||
</div>
|
||||
<p style="background: #1f1f1f;text-align:center;margin-bottom:1px">
|
||||
the channels social media accounts!
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<div style="background:#181818;" class="fromtheweb-outer">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div style="background: #272727;margin-top:10px;border-radius: 11px;">
|
||||
|
||||
|
||||
|
||||
<div class="fromtheweb-outer" style="height: 7em;">
|
||||
|
||||
<div class="fromtheweb-inner" style="height: 2em;">
|
||||
<div class="video-title" style="color:var(--text-color);font-family:var(--text-font-primary);;font-weight:var(--text-header-weight);font-stretch: extra-expanded;margin-top: 10px;margin-bottom: 10px;">Connections</div>
|
||||
|
||||
<div style="display: flex;gap: 3px;">
|
||||
<% if (twitter) { %>
|
||||
<div style="background: #0009;width: fit-content;padding: 5px;border-radius: 6px;margin-bottom: -15px;">
|
||||
<img src="<%- proxyurl %>/https://cdn.glitch.global/d68d17bb-f2c0-4bc3-993f-50902734f652/8473b88f-36a4-437f-8c14-fb9e38a623d9.image.png?v=1693424579898" class="loaded" style="width: 22px;height: 23px;vertical-align: -7px;"><a style="margin: 1px;" href="https://nitter.freedit.eu/<%- twitter.name %>"> @<%- twitter.name %></a>
|
||||
<img src="<%- proxyurl %>/https://cdn.glitch.global/d68d17bb-f2c0-4bc3-993f-50902734f652/8473b88f-36a4-437f-8c14-fb9e38a623d9.image.png?v=1693424579898" class="loaded" style="width: 22px;height: 23px;vertical-align: -7px;"><a style="margin: 1px;" href="https://twitter.com/<%- twitter.name %>"> @<%- twitter.name %></a>
|
||||
</div>
|
||||
|
||||
<% } %>
|
||||
|
@ -2597,33 +2576,6 @@ the channels social media accounts!
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<% if (Array.isArray(inv_vid?.keywords)) { %>
|
||||
|
||||
<div class="video-title" style="color:var(--text-color);font-family:var(--text-font-primary);;font-weight:var(--text-header-weight);font-stretch: extra-expanded;margin-top: 10px;margin-bottom: 10px;">Tags</div>
|
||||
<div class="tags">
|
||||
|
||||
<% inv_vid.keywords.forEach(x => { %>
|
||||
<div class="tag">
|
||||
<a href="/hashtag/<%=x %>" style="color:var(--text-color)">
|
||||
<%=x %>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% }) %>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr style="clear: both;display: block;border: none;border-bottom: 0.5px solid #2f2f2f;/*! width: 4.5em; */height: 0;">
|
||||
<% } %>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div style="padding:10px;background: #272727;margin-top:10px;border-radius: 11px;">
|
||||
<div class="video-title" style="color:var(--text-color);font-family:var(--text-font-primary);;font-weight:var(--text-header-weight);font-stretch: extra-expanded;margin-top: 10px;margin-bottom: 10px;">Uploader</div>
|
||||
|
||||
|
@ -2645,6 +2597,25 @@ the channels social media accounts!
|
|||
|
||||
|
||||
</div>
|
||||
<% if (Array.isArray(inv_vid?.keywords)) { %>
|
||||
<div class="video-title" style="background: #272727;color:var(--text-color);font-family:var(--text-font-primary);;font-weight:var(--text-header-weight);font-stretch: extra-expanded;margin-top: 10px;margin-bottom: -10px;padding: 10px;border-top-left-radius: 11px;border-top-right-radius: 11px;">Tags</div>
|
||||
<div class="tags" style="padding: 10px;background: #272727;margin-top: 10px;border-bottom-left-radius: 11px;border-bottom-right-radius:11px;">
|
||||
<br>
|
||||
<% inv_vid.keywords.forEach(x => { %>
|
||||
<div class="tag">
|
||||
<a href="/hashtag/<%=x %>" style="color:var(--text-color)">
|
||||
<%=x %>
|
||||
</a>
|
||||
</div> <% }) %>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<% } %>
|
||||
|
||||
<style>
|
||||
.nerddd {
|
||||
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
|
||||
|
@ -2663,14 +2634,15 @@ the channels social media accounts!
|
|||
Video id : <%=inv_vid.videoId%> <br>
|
||||
ImmersiveAmbientModecolor: <% if (lightOrDark(color) == "light") { %><%=color%> (color 1)<% } %><% if (lightOrDark(color) == "dark") { %> <%=color2%> (color 2) <% } %> <br>
|
||||
Video Format :<% if (!qua) { %> 22 (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz <% } %>
|
||||
<% if (qua === "medium") { %> 18 (320p) openh264 (https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz <% } %> <br>
|
||||
PokeTubeEncryptID: <%=sha384(inv_vid.videoId)%> <br>
|
||||
<% if (qua === "medium") { %> 18 (320p) openh264 (https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz <% } %>
|
||||
|
||||
<% if (inv_vid.genre === "Music") { %>
|
||||
Audio Format: ALAC lossless (https://codeberg.org/Ashley/poke/src/branch/main/alac) Audio/ Flac<br>
|
||||
<br> Audio Format: ALAC lossless (https://codeberg.org/Ashley/poke/src/branch/main/alac) Audio/ Flac<br>
|
||||
<% } %>
|
||||
<% if (inv_vid.genre !== "Music") { %>
|
||||
Audio Format: Opus - Normalized audio<br>
|
||||
<% } %>
|
||||
<br> Audio Format: Opus - Normalized audio<br>
|
||||
<% } %>
|
||||
PokeTubeEncryptID: <%=sha384(inv_vid.videoId)%> <br>
|
||||
<% if (isvidious) { %>
|
||||
|
||||
Proxy : <%= u.replace("https://","") %> - refresh the page to change the proxy location<br>
|
||||
|
|
|
@ -57,6 +57,33 @@
|
|||
"branch": "dev"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"poke.shiggy.cloud",
|
||||
{
|
||||
"uri": "https://poke.shiggy.cloud",
|
||||
"CLOUDFLARE": false,
|
||||
"piwik": false,
|
||||
"region": "🇬🇧",
|
||||
"software": {
|
||||
"name": "poketube",
|
||||
"version": "latest",
|
||||
"branch": "dev"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"poke.fr1.shiggy.cloud",
|
||||
{
|
||||
"uri": "https://poke.fr1.shiggy.cloud",
|
||||
"CLOUDFLARE": false,
|
||||
"piwik": false,
|
||||
"region": "🇫🇷",
|
||||
"software": {
|
||||
"name": "poketube",
|
||||
"version": "latest",
|
||||
"branch": "dev"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
]
|
|
@ -31,6 +31,8 @@
|
|||
} = require("./src/libpoketube/libpoketube-initsys.js");
|
||||
const media_proxy = require("./src/libpoketube/libpoketube-video.js");
|
||||
const { sinit } = require("./src/libpoketube/init/superinit.js");
|
||||
const innertube = require("./src/libpoketube/libpoketube-youtubei-objects.json");
|
||||
|
||||
const config = require("./config.json");
|
||||
const u = await media_proxy();
|
||||
initlog("Loading...");
|
||||
|
@ -160,10 +162,12 @@ toobusy.maxLag(3500);
|
|||
});
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
res.header("X-PokeTube-Youtube-Client-Name", "1");
|
||||
res.header("X-PokeTube-Youtube-Client-Name", innertube.innertube.CONTEXT_CLIENT.INNERTUBE_CONTEXT_CLIENT_NAME);
|
||||
res.header("Hey-there", "Do u wanna help poke? contributons are welcome :3 https://codeberg.org/Ashley/poke")
|
||||
res.header("X-PokeTube-Youtube-Client-Version", "2.20240111.00.00");
|
||||
res.header("X-PokeTube-Youtube-Client-Version", innertube.innertube.CLIENT.clientVersion);
|
||||
res.header("X-PokeTube-Client-name", innertube.innertube.CLIENT.projectClientName);
|
||||
res.header("X-PokeTube-Speeder", "3 seconds no cache, 280ms w/cache");
|
||||
res.header("X-HOSTNAME", req.hostname);
|
||||
if (req.url.match(/^\/(css|js|img|font)\/.+/)) {
|
||||
res.setHeader(
|
||||
"Cache-Control",
|
||||
|
@ -173,6 +177,7 @@ toobusy.maxLag(3500);
|
|||
}
|
||||
|
||||
const a = 890;
|
||||
|
||||
if (!req.url.match(/^\/(css|js|img|font)\/.+/)) {
|
||||
res.setHeader("Cache-Control", "public, max-age=" + a); // cache header
|
||||
res.setHeader("poketube-cacher", "PAGE");
|
||||
|
|
|
@ -28,6 +28,7 @@ function getJson(str) {
|
|||
|
||||
const pkg = require("../../../package.json");
|
||||
const cnf = require("../../../config.json");
|
||||
const innertube = require("../libpoketube-youtubei-objects.json");
|
||||
|
||||
const verfull = "v24.2801-JeSsIcA-MAJOR-stable-dev-nonLTS-git-MTcwNjQzMTc0OQ==";
|
||||
const versmol = "v24.2801-JeSsIcA"
|
||||
|
@ -188,6 +189,7 @@ app.get("/avatars/:v", async function (req, res) {
|
|||
v8: process.versions.v8,
|
||||
},
|
||||
invidious,
|
||||
innertube,
|
||||
flac: {
|
||||
poketube_flac: "1.2a",
|
||||
apple_musickit: "1.2.3",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const {
|
||||
fetcher,
|
||||
core,
|
||||
INNERTUBE,
|
||||
wiki,
|
||||
musicInfo,
|
||||
modules,
|
||||
|
@ -192,7 +192,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
var contentlang = hl || "en-US";
|
||||
var contentregion = region || "US";
|
||||
|
||||
const isVideoValid = await core.isvalidvideo(v);
|
||||
const isVideoValid = await INNERTUBE.isvalidvideo(v);
|
||||
if (!isVideoValid) {
|
||||
return res.redirect("/?fromerror=21_video_not_valid");
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
const secure = ["poketube.fun"].includes(req.hostname);
|
||||
const verify = req.hostname === "poketube.sudovanilla.com";
|
||||
|
||||
core.video(v, contentlang, contentregion).then((data) => {
|
||||
INNERTUBE.getYouTubeApiVideo(v, contentlang, contentregion).then((data) => {
|
||||
try {
|
||||
const k = data?.video;
|
||||
const channel_uploads = data?.channel_uploads
|
||||
|
@ -357,9 +357,9 @@ module.exports = function (app, config, renderTemplate) {
|
|||
engagement,
|
||||
comments: inv_comments,
|
||||
vid: inv_vid,
|
||||
} = await core.video(v);
|
||||
} = await INNERTUBE.getYouTubeApiVideo(v);
|
||||
|
||||
const data = await core.video(v);
|
||||
const data = await INNERTUBE.getYouTubeApiVideo(v);
|
||||
const color = data.color;
|
||||
const color2 = data.color2;
|
||||
const desc = data?.desc;
|
||||
|
|
|
@ -10,16 +10,18 @@ const { toJson } = require("xml2json");
|
|||
const { curly } = require("node-libcurl");
|
||||
const getdislikes = require("../libpoketube/libpoketube-dislikes.js");
|
||||
const getColors = require("get-image-colors");
|
||||
const config = require("../../config.json")
|
||||
|
||||
/**
|
||||
* Class representing PokeTube's core functionality.
|
||||
*/
|
||||
class PokeTubeCore {
|
||||
class InnerTubePokeVidious {
|
||||
/**
|
||||
* Create an instance of PokeTubeCore.
|
||||
* @param {object} config - Configuration object for PokeTubeCore.
|
||||
* Create an instance of InnerTubePokeVidious.
|
||||
* @param {object} config - Configuration object for InnerTubePokeVidious.
|
||||
* @param {string} config.tubeApi - Tube API URL.
|
||||
* @param {string} config.invapi - Invid API URL.
|
||||
* @param {string} config.invapi_alt - Invid API URL - ALT .
|
||||
* @param {string} config.dislikes - Dislikes API URL.
|
||||
* @param {string} config.t_url - Matomo URL.
|
||||
*/
|
||||
|
@ -27,6 +29,8 @@ class PokeTubeCore {
|
|||
this.config = config;
|
||||
this.cache = {};
|
||||
this.language = "hl=en-US";
|
||||
this.apikey = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"
|
||||
this.INNERTUBE_CONTEXT_CLIENT_VERSION = "1"
|
||||
this.region = "region=US";
|
||||
this.sqp = "-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw";
|
||||
}
|
||||
|
@ -62,7 +66,7 @@ class PokeTubeCore {
|
|||
* @param {string} v - Video ID.
|
||||
* @returns {Promise<object>} Promise resolving to the video information.
|
||||
*/
|
||||
async video(v, contentlang, contentregion) {
|
||||
async getYouTubeApiVideo(v, contentlang, contentregion) {
|
||||
|
||||
const { fetch } = await import("undici");
|
||||
|
||||
|
@ -167,11 +171,11 @@ class PokeTubeCore {
|
|||
}
|
||||
}
|
||||
|
||||
// Create an instance of PokeTubeCore with the provided config
|
||||
const pokeTubeApiCore = new PokeTubeCore({
|
||||
// Create an instance of InnerTubePokeVidious with the provided config
|
||||
const pokeTubeApiCore = new InnerTubePokeVidious({
|
||||
tubeApi: "https://inner-api.poketube.fun/api/",
|
||||
invapi: "https://invid-api.poketube.fun/api/v1",
|
||||
invapi_alt: "https://iv.ggtyler.dev/api/v1",
|
||||
invapi_alt: config.proxylocation === "EU" ? "https://invid-api.poketube.fun/api/v1" : "https://iv.ggtyler.dev/api/v1",
|
||||
dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=",
|
||||
t_url: "https://t.poketube.fun/",
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
PokeTube is a Free/Libre youtube front-end !
|
||||
|
||||
Copyright (C) 2021-2023 POKETUBE
|
||||
Copyright (C) 2021-2024 POKETUBE
|
||||
|
||||
This file is Licensed under LGPL-3.0-or-later. Poketube itself is GPL, Only this file is LGPL.
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
|||
|
||||
const fetcher = require("../libpoketube/libpoketube-dislikes.js");
|
||||
const core = require("../libpoketube/libpoketube-core.js");
|
||||
const INNERTUBE = require("../libpoketube/libpoketube-core.js");
|
||||
const musicInfo = require("music-info");
|
||||
const wiki = require("wikipedia");
|
||||
const config = require("../../config.json")
|
||||
|
@ -68,6 +69,7 @@ module.exports = {
|
|||
* @type {object}
|
||||
*/
|
||||
core,
|
||||
INNERTUBE,
|
||||
|
||||
/**
|
||||
* The musicInfo module
|
||||
|
|
49
src/libpoketube/libpoketube-youtubei-objects.json
Normal file
49
src/libpoketube/libpoketube-youtubei-objects.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"innertube": {
|
||||
"innertubeApiVersion":"v1",
|
||||
"pokevidious":"20.24",
|
||||
"innertubeContextClientVersion":"2.20240214.05.00",
|
||||
"youtubei":"https://www.youtube.com/youtubei/v1/",
|
||||
"PAGE_BUILD_LABEL": "youtube.desktop.web_20240214_05_RC00",
|
||||
"CLIENT": {
|
||||
"clientName": "WEB",
|
||||
"projectClientName":"PokeVidious",
|
||||
"clientVersion": "2.20240214.05.00"
|
||||
},
|
||||
"CONTEXT_CLIENT": {
|
||||
"INNERTUBE_CONTEXT_CLIENT_NAME": "1",
|
||||
"INNERTUBE_CONTEXT_CLIENT_VERSION": "2.20240214.05.00",
|
||||
"INNERTUBE_CONTEXT_GL": "US",
|
||||
"INNERTUBE_CONTEXT_HL": "en-US"
|
||||
},
|
||||
"LATEST_ECATCHER_SERVICE_PARAMS": { "client.name": "WEB" },
|
||||
"INNERTUBE_API_KEYS": {
|
||||
"WEB_KIDS": "AIzaSyBbZV_fZ3an51sF-mvs5w37OqqbsTOzwtU",
|
||||
"WEB_MUSIC": "AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",
|
||||
"WEB_CREATOR": "AIzaSyBUPetSUmoZL-OhlxA7wSac5XinrygCqMo",
|
||||
"WEB_REMIX": "AIzaSyC9XL3ZjWddXya6X74dJoCTL-WEYFDNX30",
|
||||
"WEB": "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",
|
||||
"ANDROID_MUSIC": "AIzaSyAOghZGza2MQSZkY_zfZ370N-PUdXEo8AI",
|
||||
"ANDROID_EMBEDDED": "AIzaSyCjc_pVEDi4qsv5MtC2dMXzpIaDoRFLsxw",
|
||||
"ANDROID_CREATOR": "AIzaSyD_qjV8zaaUMehtLkrKFgVeSX_Iqbtyws8",
|
||||
"ANDROID_KIDS": "AIzaSyAxxQKWYcEX8jHlflLt2Qcbb-rlolzBhhk",
|
||||
"ANDROID": "AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w",
|
||||
"IOS_MUSIC": "AIzaSyBAETezhkwP0ZWA02RsqT1zu78Fpt0bC_s",
|
||||
"IOS_CREATOR": "AIzaSyAPyF5GfQI-kOa6nZwO8EsNrGdEx9bioNs",
|
||||
"IOS_KIDS": "AIzaSyA6_JWXwHaVBQnoutCv1-GvV97-rJ949Bc",
|
||||
"IOS": "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc",
|
||||
"TV": "AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8"
|
||||
},
|
||||
"INNERTUBE_API_ENPOINTS": {
|
||||
"UPLOAD_ENPOINT": "https://upload.youtube.com",
|
||||
"LIVE_CHAT_BASE_TANGO_CONFIG": {
|
||||
"apiKey": "AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc",
|
||||
"channelUri": "https://client-channel.google.com/client-channel/client",
|
||||
"clientName": "yt-live-comments",
|
||||
"requiresAuthToken": false,
|
||||
"senderUri": "https://clients4.google.com/invalidation/lcs/client",
|
||||
"useNewTango": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue