<%=video.Channel.Name %>
@@ -1308,7 +1315,7 @@ Recommended Videos
@@ -1483,8 +1490,8 @@ document.addEventListener('fullscreenchange', () => {
setInterval(fadeInElements, 500);
-// Get all anchor links on the page
-const links = document.querySelectorAll('a');
+// Get all anchor links on the page except for links with "jump_to_time" onclick attribute
+const links = document.querySelectorAll('a:not([data-onclick="jump_to_time"])');
// Add a click event listener to each link
links.forEach(link => {
@@ -1512,6 +1519,45 @@ links.forEach(link => {
}
});
});
+
+
+const a = document.querySelectorAll('a[data-onclick="jump_to_time"]');
+
+function jumpToTime(e) {
+ e.preventDefault();
+
+ const link = e.target;
+ const video = document.getElementById('video');
+ const time = link.dataset.jumpTime;
+
+ video.currentTime = time;
+
+ window.location.hash = 'top'; // Add #video to the URL
+
+ setTimeout(() => {
+ history.replaceState(null, null, ' '); // Remove #video after 1 second
+ }, 250);
+}
+
+a.forEach(link => {
+ const href = link.getAttribute('href');
+ if (link.dataset.jumpTime) {
+ link.removeAttribute('href');
+ }
+
+ if (href && href.includes('&t=')) {
+ const params = new URLSearchParams(href.split('?')[1]);
+ const time = params.get('t');
+
+ if (time) {
+ link.dataset.jumpTime = time;
+ link.addEventListener('click', jumpToTime);
+ link.removeAttribute('href');
+ }
+ }
+});
+
+
const urls = document.querySelectorAll('a[href*="/watch?v="]'); // get all links with "/watch?v=" in href attribute
const spinner = document.createElement('div');
@@ -1545,6 +1591,7 @@ urls.forEach(link => {
}
console.log(`Fetched ${url.origin}`);
fetchedCount++;
+ console.clear()
if (fetchedCount === urls.length) {
spinner.classList.add('hide');
@@ -1556,7 +1603,7 @@ urls.forEach(link => {
.catch(error => {
spinner.classList.add('hide');
text.classList.add('hide');
-
+ console.clear()
// Ignore network errors
if (!(error instanceof TypeError && error.message.includes('Failed to fetch'))) {
console.error(`Error fetching ${url.origin}: ${error}`);
@@ -2118,7 +2165,7 @@ More Epic options owo~
<% if (optout) { %>
<% } %>
<% if (!optout) { %>
- •
+ •
Opt out of Metrics (
Wut?)
<% } %>
<% if (lyrics && !r) { %>
@@ -2329,7 +2376,7 @@ More Epic options owo~
<% } %>
<% if (optout) { %>
-
<%=x.duration %>
+ <%=x.duration %>
<% } %>