Spaces:
Running
Running
vericudebuget
commited on
Upload 11 files
Browse files- all_videos.html +383 -0
- index.html +510 -424
- index3.html +371 -0
- output.vtt +21 -0
- rules.html +298 -0
- search-results.html +0 -0
- test.html +175 -0
- test.py +19 -0
- upload.html +103 -0
- video-player copy.html +464 -0
- video-player.html +1096 -0
all_videos.html
ADDED
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>HuggingTube</title>
|
8 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
9 |
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
|
10 |
+
<style>
|
11 |
+
body {
|
12 |
+
font-family: 'Montserrat', sans-serif;
|
13 |
+
}
|
14 |
+
|
15 |
+
:root {
|
16 |
+
--bg-primary: #0a0f18;
|
17 |
+
--bg-secondary: #141e2f;
|
18 |
+
--text-primary: #ffffff;
|
19 |
+
--text-secondary: #adbac7;
|
20 |
+
--accent: #2188ff;
|
21 |
+
}
|
22 |
+
|
23 |
+
* {
|
24 |
+
margin: 0;
|
25 |
+
padding: 0;
|
26 |
+
box-sizing: border-box;
|
27 |
+
}
|
28 |
+
|
29 |
+
body {
|
30 |
+
background-color: var(--bg-primary);
|
31 |
+
color: var(--text-primary);
|
32 |
+
}
|
33 |
+
|
34 |
+
header {
|
35 |
+
display: flex;
|
36 |
+
justify-content: space-between;
|
37 |
+
align-items: center;
|
38 |
+
padding: 0.5rem 1rem;
|
39 |
+
background-color: var(--bg-secondary);
|
40 |
+
position: fixed;
|
41 |
+
top: 0;
|
42 |
+
left: 0;
|
43 |
+
right: 0;
|
44 |
+
z-index: 1000;
|
45 |
+
}
|
46 |
+
|
47 |
+
.logo {
|
48 |
+
color: var(--text-primary);
|
49 |
+
font-size: 1.2rem;
|
50 |
+
font-weight: bold;
|
51 |
+
display: flex;
|
52 |
+
align-items: center;
|
53 |
+
}
|
54 |
+
|
55 |
+
.logo i {
|
56 |
+
color: var(--accent);
|
57 |
+
margin-right: 0.5rem;
|
58 |
+
}
|
59 |
+
|
60 |
+
.search-bar {
|
61 |
+
flex-grow: 1;
|
62 |
+
max-width: 600px;
|
63 |
+
margin: 0 1rem;
|
64 |
+
}
|
65 |
+
|
66 |
+
.search-bar input {
|
67 |
+
width: 100%;
|
68 |
+
padding: 0.5rem 1rem;
|
69 |
+
border-radius: 20px;
|
70 |
+
border: 1px solid var(--text-secondary);
|
71 |
+
background-color: var(--bg-primary);
|
72 |
+
color: var(--text-primary);
|
73 |
+
}
|
74 |
+
|
75 |
+
.user-actions i {
|
76 |
+
margin-left: 1rem;
|
77 |
+
cursor: pointer;
|
78 |
+
}
|
79 |
+
|
80 |
+
main {
|
81 |
+
display: flex;
|
82 |
+
margin-top: 56px; /* Header height */
|
83 |
+
}
|
84 |
+
|
85 |
+
.sidebar {
|
86 |
+
width: 240px;
|
87 |
+
padding: 1rem;
|
88 |
+
position: fixed;
|
89 |
+
top: 56px;
|
90 |
+
bottom: 0;
|
91 |
+
overflow-y: auto;
|
92 |
+
background-color: var(--bg-primary);
|
93 |
+
}
|
94 |
+
|
95 |
+
.sidebar-item {
|
96 |
+
display: flex;
|
97 |
+
align-items: center;
|
98 |
+
padding: 0.75rem 1rem;
|
99 |
+
cursor: pointer;
|
100 |
+
border-radius: 10px;
|
101 |
+
}
|
102 |
+
|
103 |
+
.sidebar-item:hover {
|
104 |
+
background-color: var(--bg-secondary);
|
105 |
+
}
|
106 |
+
|
107 |
+
.sidebar-item i {
|
108 |
+
margin-right: 1rem;
|
109 |
+
width: 20px;
|
110 |
+
}
|
111 |
+
|
112 |
+
.content {
|
113 |
+
flex-grow: 1;
|
114 |
+
padding: 1rem;
|
115 |
+
margin-left: 240px;
|
116 |
+
}
|
117 |
+
|
118 |
+
.video-grid {
|
119 |
+
display: flex;
|
120 |
+
flex-direction: column;
|
121 |
+
}
|
122 |
+
|
123 |
+
.video-card {
|
124 |
+
display: flex;
|
125 |
+
align-items: center;
|
126 |
+
padding: 0.5rem;
|
127 |
+
border-bottom: 1px solid var(--text-secondary);
|
128 |
+
}
|
129 |
+
|
130 |
+
.thumbnail {
|
131 |
+
width: 80px;
|
132 |
+
height: 80px;
|
133 |
+
margin-right: 1rem;
|
134 |
+
border-radius: 10px;
|
135 |
+
overflow: hidden;
|
136 |
+
}
|
137 |
+
|
138 |
+
.thumbnail img {
|
139 |
+
width: 100%;
|
140 |
+
height: 100%;
|
141 |
+
object-fit: cover;
|
142 |
+
}
|
143 |
+
|
144 |
+
.video-info {
|
145 |
+
flex-grow: 1;
|
146 |
+
}
|
147 |
+
|
148 |
+
.video-title {
|
149 |
+
font-size: 1rem;
|
150 |
+
font-weight: bold;
|
151 |
+
margin-bottom: 0.25rem;
|
152 |
+
}
|
153 |
+
|
154 |
+
.video-uploader {
|
155 |
+
font-size: 0.9rem;
|
156 |
+
color: var(--text-secondary);
|
157 |
+
}
|
158 |
+
|
159 |
+
.video-date {
|
160 |
+
font-size: 0.9rem;
|
161 |
+
color: var(--text-secondary);
|
162 |
+
}
|
163 |
+
|
164 |
+
.subtitle {
|
165 |
+
display: flex;
|
166 |
+
align-items: center;
|
167 |
+
margin-left: 1rem;
|
168 |
+
padding: 0.25rem 0.5rem;
|
169 |
+
border-radius: 5px;
|
170 |
+
background-color: rgb(0, 72, 85);
|
171 |
+
}
|
172 |
+
|
173 |
+
.subtitle_icon {
|
174 |
+
width: auto;
|
175 |
+
height: 1em;
|
176 |
+
margin-right: 0.5rem;
|
177 |
+
}
|
178 |
+
|
179 |
+
.subtitle_text {
|
180 |
+
font-size: 0.9rem;
|
181 |
+
color: #000000;
|
182 |
+
}
|
183 |
+
|
184 |
+
.video-url {
|
185 |
+
font-size: 0.8rem;
|
186 |
+
color: var(--text-secondary);
|
187 |
+
margin-top: 0.25rem;
|
188 |
+
}
|
189 |
+
|
190 |
+
/* Mobile styles */
|
191 |
+
@media (max-width: 768px) {
|
192 |
+
.video-card {
|
193 |
+
flex-direction: column;
|
194 |
+
align-items: flex-start;
|
195 |
+
}
|
196 |
+
|
197 |
+
.thumbnail {
|
198 |
+
width: 100%;
|
199 |
+
height: 150px;
|
200 |
+
margin-bottom: 1rem;
|
201 |
+
}
|
202 |
+
|
203 |
+
.video-info {
|
204 |
+
width: 100%;
|
205 |
+
}
|
206 |
+
}
|
207 |
+
</style>
|
208 |
+
</head>
|
209 |
+
|
210 |
+
<body>
|
211 |
+
<header>
|
212 |
+
<div class="logo">
|
213 |
+
<i class="fab fa-youtube"></i>
|
214 |
+
<span>HuggingTube</span>
|
215 |
+
</div>
|
216 |
+
<div class="search-bar">
|
217 |
+
<input type="text" placeholder="Search">
|
218 |
+
</div>
|
219 |
+
<div class="user-actions" onclick="toggleVideoUpload()">
|
220 |
+
<i class="fas fa-video"></i>
|
221 |
+
<i class="fas fa-info-circle" onclick="toggleInfo()"></i>
|
222 |
+
</div>
|
223 |
+
|
224 |
+
<script>
|
225 |
+
function toggleVideoUpload() {
|
226 |
+
window.location.href = "upload.html";
|
227 |
+
}
|
228 |
+
|
229 |
+
function toggleInfo() {
|
230 |
+
window.location.href = "about.html";
|
231 |
+
}
|
232 |
+
</script>
|
233 |
+
</header>
|
234 |
+
|
235 |
+
<main>
|
236 |
+
<aside class="sidebar">
|
237 |
+
<div class="sidebar-item">
|
238 |
+
<i class="fas fa-home" onclick="homeInfo()"></i> Home
|
239 |
+
</div>
|
240 |
+
|
241 |
+
<div class="sidebar-item" onclick="toggleVideoUpload()">
|
242 |
+
<i class="fas fa-upload"></i> Upload
|
243 |
+
</div>
|
244 |
+
<div class="sidebar-item">
|
245 |
+
<i class="fas fa-photo-video"></i> All videos
|
246 |
+
</div>
|
247 |
+
</aside>
|
248 |
+
|
249 |
+
<section class="content" style="max-width: 100vw;">
|
250 |
+
<div class="video-grid" id="videoGrid">
|
251 |
+
<!-- Dynamic video cards will be inserted here -->
|
252 |
+
</div>
|
253 |
+
</section>
|
254 |
+
</main>
|
255 |
+
|
256 |
+
<nav class="mobile-nav">
|
257 |
+
<div class="mobile-nav-items">
|
258 |
+
<div class="mobile-nav-item">
|
259 |
+
<i class="fas fa-home"></i> Home
|
260 |
+
</div>
|
261 |
+
<div class="mobile-nav-item" onclick="toggleVideoUpload()">
|
262 |
+
<i class="fas fa-upload"></i> Upload
|
263 |
+
</div>
|
264 |
+
<div class="mobile-nav-item">
|
265 |
+
<i class="fas fa-photo-video"></i> Library
|
266 |
+
</div>
|
267 |
+
</div>
|
268 |
+
</nav>
|
269 |
+
|
270 |
+
<script>
|
271 |
+
async function fetchVideoMetadata() {
|
272 |
+
try {
|
273 |
+
// Clear the 'video_to_watch' key from localStorage on page load
|
274 |
+
localStorage.removeItem('video_to_watch');
|
275 |
+
// Fetch the video-index JSON data
|
276 |
+
const response = await fetch('https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/video-index.json');
|
277 |
+
const videoIndexData = await response.json();
|
278 |
+
// Sort the video index data from latest to oldest
|
279 |
+
videoIndexData.sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp));
|
280 |
+
// Base URLs for metadata and thumbnails
|
281 |
+
const baseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/';
|
282 |
+
const thumbnailBaseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/thumbnails/';
|
283 |
+
// Function to insert a video card in the correct position based on uploadTimestamp
|
284 |
+
const insertVideoCard = (videoCard, videoTimestamp) => {
|
285 |
+
const existingCards = document.querySelectorAll('.video-card');
|
286 |
+
let inserted = false;
|
287 |
+
for (const card of existingCards) {
|
288 |
+
const cardTimestamp = new Date(card.getAttribute('data-timestamp'));
|
289 |
+
if (videoTimestamp > cardTimestamp) {
|
290 |
+
card.parentNode.insertBefore(videoCard, card);
|
291 |
+
inserted = true;
|
292 |
+
break;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
// If no cards are newer, append it to the end
|
296 |
+
if (!inserted) {
|
297 |
+
videoGrid.appendChild(videoCard);
|
298 |
+
}
|
299 |
+
};
|
300 |
+
// Function to encrypt the link
|
301 |
+
const encryptLink = (link, key) => {
|
302 |
+
// Simple XOR encryption for demonstration purposes
|
303 |
+
const encrypted = link.split('').map((char, i) => {
|
304 |
+
return String.fromCharCode(char.charCodeAt(0) ^ key.charCodeAt(i % key.length));
|
305 |
+
}).join('');
|
306 |
+
return btoa(encrypted); // base64 encode
|
307 |
+
};
|
308 |
+
// Loop through each URL in the sorted list and fetch the respective metadata
|
309 |
+
const videoGrid = document.getElementById('videoGrid');
|
310 |
+
for (let i = 0; i < videoIndexData.length; i++) {
|
311 |
+
let videoIndexUrl = videoIndexData[i].url;
|
312 |
+
// Extract only the file name (last part of the URL)
|
313 |
+
let fileName = videoIndexUrl.substring(videoIndexUrl.lastIndexOf('/') + 1);
|
314 |
+
// Create the full URL by appending the file name to the base URL
|
315 |
+
let finalUrl = baseUrl + encodeURIComponent(fileName);
|
316 |
+
try {
|
317 |
+
// Fetch metadata from the properly encoded URL
|
318 |
+
const videoResponse = await fetch(finalUrl);
|
319 |
+
const videoData = await videoResponse.json();
|
320 |
+
// Fix thumbnail URL by using the online location
|
321 |
+
let thumbnailUrl = thumbnailBaseUrl + encodeURIComponent(videoData.thumbnailLocation.substring(videoData.thumbnailLocation.lastIndexOf('/') + 1));
|
322 |
+
// Convert duration from seconds to mm:ss
|
323 |
+
const formatDuration = (duration) => {
|
324 |
+
if (duration === null || duration === undefined) return 'N/A';
|
325 |
+
const minutes = Math.floor(duration / 60);
|
326 |
+
const seconds = duration % 60;
|
327 |
+
return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
328 |
+
};
|
329 |
+
// Function to handle click event and store video index URL in localStorage
|
330 |
+
const handleVideoClick = () => {
|
331 |
+
const encryptedLink = encryptLink(finalUrl, 'JesusIsGod');
|
332 |
+
window.location.href = `video-player.html#${encryptedLink}`;
|
333 |
+
};
|
334 |
+
|
335 |
+
// Create a video card dynamically
|
336 |
+
const videoCard = document.createElement('div');
|
337 |
+
videoCard.classList.add('video-card');
|
338 |
+
videoCard.setAttribute('data-timestamp', new Date(videoData.uploadTimestamp).toISOString());
|
339 |
+
videoCard.innerHTML = `
|
340 |
+
<div class="thumbnail">
|
341 |
+
<img src="${thumbnailUrl}" alt="${videoData.title}">
|
342 |
+
</div>
|
343 |
+
<div class="video-info">
|
344 |
+
<h3 class="video-title">${videoData.title}</h3>
|
345 |
+
<p class="video-uploader">${videoData.uploader}</p>
|
346 |
+
<p class="video-date">${new Intl.DateTimeFormat('en-US', { month: 'long', day: 'numeric', year: 'numeric' }).format(new Date(videoData.uploadTimestamp))}</p>
|
347 |
+
${videoData.subtitleLocation && videoData.subtitleLocation.trim() !== "" ? `
|
348 |
+
<div class="subtitle">
|
349 |
+
<img class="subtitle_icon" src="https://cdn.iconscout.com/icon/free/png-512/free-subtitles-icon-download-in-svg-png-gif-file-formats--subtitle-text-translate-basic-multimedia-pack-user-interface-icons-4083807.png?f=webp&w=256">
|
350 |
+
<span class="subtitle_text">Subtitles</span>
|
351 |
+
</div>
|
352 |
+
` : ''}
|
353 |
+
|
354 |
+
</div>
|
355 |
+
`;
|
356 |
+
|
357 |
+
// Add event listeners for the thumbnail and title
|
358 |
+
videoCard.querySelector('.thumbnail img').addEventListener('click', handleVideoClick);
|
359 |
+
videoCard.querySelector('.video-title').addEventListener('click', handleVideoClick);
|
360 |
+
|
361 |
+
// Insert the video card in the correct position based on uploadTimestamp
|
362 |
+
const videoTimestamp = new Date(videoData.uploadTimestamp);
|
363 |
+
insertVideoCard(videoCard, videoTimestamp);
|
364 |
+
|
365 |
+
// Wait 0.3 seconds before fetching the next URL
|
366 |
+
await new Promise(resolve => setTimeout(resolve, 10));
|
367 |
+
|
368 |
+
} catch (videoError) {
|
369 |
+
;
|
370 |
+
}
|
371 |
+
}
|
372 |
+
} catch (error) {
|
373 |
+
console.error('Error fetching video metadata:', error);
|
374 |
+
}
|
375 |
+
}
|
376 |
+
|
377 |
+
// Call the function on page load
|
378 |
+
window.onload = fetchVideoMetadata;
|
379 |
+
</script>
|
380 |
+
</body>
|
381 |
+
|
382 |
+
</html>
|
383 |
+
|
index.html
CHANGED
@@ -1,424 +1,510 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="en">
|
3 |
-
|
4 |
-
<head>
|
5 |
-
<meta charset="UTF-8">
|
6 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
-
<title>HuggingTube</title>
|
8 |
-
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
9 |
-
<
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
margin: 0
|
67 |
-
}
|
68 |
-
|
69 |
-
.search-bar
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
margin-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
}
|
120 |
-
|
121 |
-
.
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
}
|
126 |
-
|
127 |
-
.video-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
margin-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
.
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
}
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
}
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
<
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
<
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
//
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>HuggingTube</title>
|
8 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
9 |
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
|
10 |
+
<style>
|
11 |
+
|
12 |
+
|
13 |
+
body {
|
14 |
+
font-family: 'Montserrat', sans-serif;
|
15 |
+
}
|
16 |
+
|
17 |
+
|
18 |
+
:root {
|
19 |
+
--bg-primary: #0a0f18;
|
20 |
+
--bg-secondary: #141e2f;
|
21 |
+
--text-primary: #ffffff;
|
22 |
+
--text-secondary: #adbac7;
|
23 |
+
--accent: #2188ff;
|
24 |
+
}
|
25 |
+
|
26 |
+
* {
|
27 |
+
margin: 0;
|
28 |
+
padding: 0;
|
29 |
+
box-sizing: border-box;
|
30 |
+
}
|
31 |
+
|
32 |
+
.video-card {
|
33 |
+
width: 250px;
|
34 |
+
margin: 15px;
|
35 |
+
}
|
36 |
+
|
37 |
+
body {
|
38 |
+
|
39 |
+
background-color: var(--bg-primary);
|
40 |
+
color: var(--text-primary);
|
41 |
+
}
|
42 |
+
|
43 |
+
header {
|
44 |
+
display: flex;
|
45 |
+
justify-content: space-between;
|
46 |
+
align-items: center;
|
47 |
+
padding: 0.5rem 1rem;
|
48 |
+
background-color: var(--bg-secondary);
|
49 |
+
position: fixed;
|
50 |
+
top: 0;
|
51 |
+
left: 0;
|
52 |
+
right: 0;
|
53 |
+
z-index: 1000;
|
54 |
+
}
|
55 |
+
|
56 |
+
.logo {
|
57 |
+
color: var(--text-primary);
|
58 |
+
font-size: 1.2rem;
|
59 |
+
font-weight: bold;
|
60 |
+
display: flex;
|
61 |
+
align-items: center;
|
62 |
+
}
|
63 |
+
|
64 |
+
.logo i {
|
65 |
+
color: var(--accent);
|
66 |
+
margin-right: 0.5rem;
|
67 |
+
}
|
68 |
+
|
69 |
+
.search-bar {
|
70 |
+
flex-grow: 1;
|
71 |
+
max-width: 600px;
|
72 |
+
margin: 0 1rem;
|
73 |
+
}
|
74 |
+
|
75 |
+
.search-bar input {
|
76 |
+
width: 100%;
|
77 |
+
padding: 0.5rem 1rem;
|
78 |
+
border-radius: 20px;
|
79 |
+
border: 1px solid var(--text-secondary);
|
80 |
+
background-color: var(--bg-primary);
|
81 |
+
color: var(--text-primary);
|
82 |
+
}
|
83 |
+
|
84 |
+
.user-actions i {
|
85 |
+
margin-left: 1rem;
|
86 |
+
cursor: pointer;
|
87 |
+
}
|
88 |
+
|
89 |
+
main {
|
90 |
+
display: flex;
|
91 |
+
margin-top: 56px; /* Header height */
|
92 |
+
}
|
93 |
+
|
94 |
+
.sidebar {
|
95 |
+
width: 240px;
|
96 |
+
padding: 1rem;
|
97 |
+
position: fixed;
|
98 |
+
top: 56px;
|
99 |
+
bottom: 0;
|
100 |
+
overflow-y: auto;
|
101 |
+
background-color: var(--bg-primary);
|
102 |
+
}
|
103 |
+
|
104 |
+
.sidebar-item {
|
105 |
+
display: flex;
|
106 |
+
align-items: center;
|
107 |
+
padding: 0.75rem 1rem;
|
108 |
+
cursor: pointer;
|
109 |
+
border-radius: 10px;
|
110 |
+
}
|
111 |
+
|
112 |
+
.sidebar-item:hover {
|
113 |
+
background-color: var(--bg-secondary);
|
114 |
+
}
|
115 |
+
|
116 |
+
.sidebar-item i {
|
117 |
+
margin-right: 1rem;
|
118 |
+
width: 20px;
|
119 |
+
}
|
120 |
+
|
121 |
+
.content {
|
122 |
+
flex-grow: 1;
|
123 |
+
padding: 1rem;
|
124 |
+
margin-left: 240px;
|
125 |
+
}
|
126 |
+
|
127 |
+
.video-grid {
|
128 |
+
display: grid;
|
129 |
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
130 |
+
gap: 1rem;
|
131 |
+
}
|
132 |
+
|
133 |
+
.video-card {
|
134 |
+
cursor: pointer;
|
135 |
+
}
|
136 |
+
|
137 |
+
.thumbnail {
|
138 |
+
position: relative;
|
139 |
+
width: 100%;
|
140 |
+
height: 0;
|
141 |
+
padding-bottom: 56.25%;
|
142 |
+
background-color: var(--bg-secondary);
|
143 |
+
border-radius: 10px;
|
144 |
+
overflow: hidden;
|
145 |
+
}
|
146 |
+
|
147 |
+
.video-duration {
|
148 |
+
position: absolute;
|
149 |
+
bottom: 5px;
|
150 |
+
right: 5px;
|
151 |
+
background-color: rgba(0, 0, 0, 0.8);
|
152 |
+
padding: 2px 4px;
|
153 |
+
border-radius: 4px;
|
154 |
+
font-size: 0.8rem;
|
155 |
+
}
|
156 |
+
|
157 |
+
.video-info {
|
158 |
+
display: grid;
|
159 |
+
margin-top: 0.5rem;
|
160 |
+
}
|
161 |
+
|
162 |
+
.channel-avatar {
|
163 |
+
width: 36px;
|
164 |
+
height: 36px;
|
165 |
+
border-radius: 50%;
|
166 |
+
background-color: var(--bg-secondary);
|
167 |
+
margin-right: 0.5rem;
|
168 |
+
flex-shrink: 0;
|
169 |
+
}
|
170 |
+
|
171 |
+
.video-details h3 {
|
172 |
+
font-size: 1rem;
|
173 |
+
margin-bottom: 0.25rem;
|
174 |
+
}
|
175 |
+
|
176 |
+
.video-details p {
|
177 |
+
font-size: 0.9rem;
|
178 |
+
color: var(--text-secondary);
|
179 |
+
}
|
180 |
+
|
181 |
+
.mobile-nav {
|
182 |
+
display: none;
|
183 |
+
position: fixed;
|
184 |
+
bottom: 0;
|
185 |
+
left: 0;
|
186 |
+
right: 0;
|
187 |
+
background-color: var(--bg-secondary);
|
188 |
+
padding: 0.5rem;
|
189 |
+
z-index: 1000;
|
190 |
+
}
|
191 |
+
|
192 |
+
.mobile-nav-items {
|
193 |
+
display: flex;
|
194 |
+
justify-content: space-around;
|
195 |
+
}
|
196 |
+
|
197 |
+
.mobile-nav-item {
|
198 |
+
display: flex;
|
199 |
+
flex-direction: column;
|
200 |
+
align-items: center;
|
201 |
+
font-size: 0.8rem;
|
202 |
+
}
|
203 |
+
|
204 |
+
.mobile-nav-item i {
|
205 |
+
font-size: 1.2rem;
|
206 |
+
margin-bottom: 0.25rem;
|
207 |
+
}
|
208 |
+
|
209 |
+
/* Mobile styles */
|
210 |
+
@media (max-width: 768px)
|
211 |
+
|
212 |
+
{
|
213 |
+
|
214 |
+
.video-card {
|
215 |
+
width: 100%;
|
216 |
+
margin: 15px;
|
217 |
+
}
|
218 |
+
|
219 |
+
.logo span {
|
220 |
+
display: none;
|
221 |
+
}
|
222 |
+
|
223 |
+
.search-bar {
|
224 |
+
margin: 0 0.5rem;
|
225 |
+
}
|
226 |
+
|
227 |
+
.user-actions i {
|
228 |
+
margin-left: 0.5rem;
|
229 |
+
}
|
230 |
+
|
231 |
+
.sidebar {
|
232 |
+
display: none;
|
233 |
+
}
|
234 |
+
|
235 |
+
.content {
|
236 |
+
margin-left: 0;
|
237 |
+
margin-bottom: 60px; /* Space for mobile nav */
|
238 |
+
}
|
239 |
+
|
240 |
+
.mobile-nav {
|
241 |
+
display: block;
|
242 |
+
}
|
243 |
+
|
244 |
+
.video-grid {
|
245 |
+
display: grid;
|
246 |
+
grid-template-columns: 1fr;
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
}
|
251 |
+
|
252 |
+
|
253 |
+
/* Small mobile styles */
|
254 |
+
@media (max-width: 480px) {
|
255 |
+
|
256 |
+
|
257 |
+
.video-card {
|
258 |
+
width: 100%;
|
259 |
+
margin: 15px;
|
260 |
+
}
|
261 |
+
|
262 |
+
|
263 |
+
.user-actions {
|
264 |
+
display: none;
|
265 |
+
}
|
266 |
+
|
267 |
+
.search-bar input {
|
268 |
+
font-size: 14px;
|
269 |
+
}
|
270 |
+
|
271 |
+
.video-details h3 {
|
272 |
+
font-size: 0.9rem;
|
273 |
+
}
|
274 |
+
|
275 |
+
.video-details p {
|
276 |
+
font-size: 0.8rem;
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
|
281 |
+
.video-grid {
|
282 |
+
display: flex;
|
283 |
+
flex-wrap: wrap;
|
284 |
+
}
|
285 |
+
|
286 |
+
|
287 |
+
|
288 |
+
.thumbnail img {
|
289 |
+
width: 100%;
|
290 |
+
}
|
291 |
+
|
292 |
+
.video-info h3 {
|
293 |
+
margin: 10px 0;
|
294 |
+
}
|
295 |
+
</style>
|
296 |
+
</head>
|
297 |
+
|
298 |
+
<body>
|
299 |
+
<header>
|
300 |
+
<div class="logo">
|
301 |
+
<i class="fab fa-youtube"></i>
|
302 |
+
<span>HuggingTube</span>
|
303 |
+
</div>
|
304 |
+
<div class="search-bar">
|
305 |
+
<input type="text" placeholder="Search">
|
306 |
+
</div>
|
307 |
+
<div class="user-actions" onclick="toggleVideoUpload()">
|
308 |
+
<i class="fas fa-video" ></i>
|
309 |
+
|
310 |
+
<i class="fas fa-info-circle" onclick="toggleInfo()"></i>
|
311 |
+
</div>
|
312 |
+
|
313 |
+
<script>
|
314 |
+
function toggleVideoUpload() {
|
315 |
+
window.location.href = "upload.html";
|
316 |
+
}
|
317 |
+
|
318 |
+
function toggleInfo() {
|
319 |
+
window.location.href = "about.html";
|
320 |
+
}
|
321 |
+
</script>
|
322 |
+
</header>
|
323 |
+
|
324 |
+
<main>
|
325 |
+
<aside class="sidebar">
|
326 |
+
<div class="sidebar-item">
|
327 |
+
<i class="fas fa-home" onclick="homeInfo()"></i> Home
|
328 |
+
</div>
|
329 |
+
|
330 |
+
<div class="sidebar-item" onclick="toggleVideoUpload()">
|
331 |
+
<i class="fas fa-upload" ></i> Upload
|
332 |
+
</div>
|
333 |
+
|
334 |
+
</aside>
|
335 |
+
|
336 |
+
<section class="content">
|
337 |
+
<div class="video-grid" id="videoGrid">
|
338 |
+
<!-- Dynamic video cards will be inserted here -->
|
339 |
+
</div>
|
340 |
+
</section>
|
341 |
+
</main>
|
342 |
+
|
343 |
+
<nav class="mobile-nav">
|
344 |
+
<div class="mobile-nav-items">
|
345 |
+
<div class="mobile-nav-item">
|
346 |
+
<i class="fas fa-home"></i> Home
|
347 |
+
</div>
|
348 |
+
<div class="mobile-nav-item" onclick="toggleVideoUpload()">
|
349 |
+
<i class="fas fa-upload" ></i> Upload
|
350 |
+
</div>
|
351 |
+
|
352 |
+
</div>
|
353 |
+
</nav>
|
354 |
+
|
355 |
+
<script>
|
356 |
+
async function fetchVideoMetadata() {
|
357 |
+
try {
|
358 |
+
// Clear the 'video_to_watch' key from localStorage on page load
|
359 |
+
localStorage.removeItem('video_to_watch');
|
360 |
+
// Fetch the video-index JSON data
|
361 |
+
const response = await fetch('https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/video-index.json');
|
362 |
+
const videoIndexData = await response.json();
|
363 |
+
// Sort the video index data from latest to oldest
|
364 |
+
videoIndexData.sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp));
|
365 |
+
// Base URLs for metadata and thumbnails
|
366 |
+
const baseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/';
|
367 |
+
const thumbnailBaseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/thumbnails/';
|
368 |
+
// Function to insert a video card in the correct position based on uploadTimestamp
|
369 |
+
const insertVideoCard = (videoCard, videoTimestamp) => {
|
370 |
+
const existingCards = document.querySelectorAll('.video-card');
|
371 |
+
let inserted = false;
|
372 |
+
for (const card of existingCards) {
|
373 |
+
const cardTimestamp = new Date(card.getAttribute('data-timestamp'));
|
374 |
+
if (videoTimestamp > cardTimestamp) {
|
375 |
+
card.parentNode.insertBefore(videoCard, card);
|
376 |
+
inserted = true;
|
377 |
+
break;
|
378 |
+
}
|
379 |
+
}
|
380 |
+
// If no cards are newer, append it to the end
|
381 |
+
if (!inserted) {
|
382 |
+
videoGrid.appendChild(videoCard);
|
383 |
+
}
|
384 |
+
};
|
385 |
+
// Function to encrypt the link
|
386 |
+
const encryptLink = (link, key) => {
|
387 |
+
// Simple XOR encryption for demonstration purposes
|
388 |
+
const encrypted = link.split('').map((char, i) => {
|
389 |
+
return String.fromCharCode(char.charCodeAt(0) ^ key.charCodeAt(i % key.length));
|
390 |
+
}).join('');
|
391 |
+
return btoa(encrypted); // base64 encode
|
392 |
+
};
|
393 |
+
// Loop through each URL in the sorted list and fetch the respective metadata
|
394 |
+
const videoGrid = document.getElementById('videoGrid');
|
395 |
+
for (let i = 0; i < videoIndexData.length; i++) {
|
396 |
+
let videoIndexUrl = videoIndexData[i].url;
|
397 |
+
// Extract only the file name (last part of the URL)
|
398 |
+
let fileName = videoIndexUrl.substring(videoIndexUrl.lastIndexOf('/') + 1);
|
399 |
+
// Create the full URL by appending the file name to the base URL
|
400 |
+
let finalUrl = baseUrl + encodeURIComponent(fileName);
|
401 |
+
try {
|
402 |
+
// Fetch metadata from the properly encoded URL
|
403 |
+
const videoResponse = await fetch(finalUrl);
|
404 |
+
const videoData = await videoResponse.json();
|
405 |
+
// Fix thumbnail URL by using the online location
|
406 |
+
let thumbnailUrl = thumbnailBaseUrl + encodeURIComponent(videoData.thumbnailLocation.substring(videoData.thumbnailLocation.lastIndexOf('/') + 1));
|
407 |
+
// Convert duration from seconds to mm:ss
|
408 |
+
const formatDuration = (duration) => {
|
409 |
+
if (duration === null || duration === undefined) return 'N/A';
|
410 |
+
const minutes = Math.floor(duration / 60);
|
411 |
+
const seconds = duration % 60;
|
412 |
+
return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
413 |
+
};
|
414 |
+
// Function to handle click event and store video index URL in localStorage
|
415 |
+
const handleVideoClick = () => {
|
416 |
+
const encryptedLink = encryptLink(finalUrl, 'JesusIsGod');
|
417 |
+
window.location.href = `video-player.html#${encryptedLink}`;
|
418 |
+
};
|
419 |
+
|
420 |
+
// Create a video card dynamically
|
421 |
+
const videoCard = document.createElement('div');
|
422 |
+
videoCard.classList.add('video-card');
|
423 |
+
videoCard.setAttribute('data-timestamp', new Date(videoData.uploadTimestamp).toISOString());
|
424 |
+
videoCard.innerHTML = `
|
425 |
+
<div class="thumbnail">
|
426 |
+
<img src="${thumbnailUrl}" alt="${videoData.title}" style="cursor: pointer;">
|
427 |
+
<span class="video-duration">${formatDuration(videoData.duration)}</span>
|
428 |
+
</div>
|
429 |
+
<div class="video-info">
|
430 |
+
<h3 style="cursor: pointer;">${videoData.title}</h3>
|
431 |
+
<p style="color: light gray;">${videoData.uploader} ▪ ${new Intl.DateTimeFormat('en-US', { month: 'long', day: 'numeric', year: 'numeric' }).format(new Date(videoData.uploadTimestamp))}</p>
|
432 |
+
</div>
|
433 |
+
`;
|
434 |
+
|
435 |
+
// Check if subtitleLocation has text
|
436 |
+
if (videoData.subtitleLocation && videoData.subtitleLocation.trim() !== "") {
|
437 |
+
videoCard.innerHTML += `
|
438 |
+
<div class="subtitle" title="This video has subtitles in English">
|
439 |
+
<div class="subtitle_content">
|
440 |
+
<img class="subtitle_icon" src="https://cdn.iconscout.com/icon/free/png-512/free-subtitles-icon-download-in-svg-png-gif-file-formats--subtitle-text-translate-basic-multimedia-pack-user-interface-icons-4083807.png?f=webp&w=256">
|
441 |
+
<span class="subtitle_text">Subtitles</span>
|
442 |
+
</div>
|
443 |
+
</div>
|
444 |
+
`;
|
445 |
+
}
|
446 |
+
|
447 |
+
|
448 |
+
// Add event listeners for the thumbnail and title
|
449 |
+
videoCard.querySelector('.thumbnail img').addEventListener('click', handleVideoClick);
|
450 |
+
videoCard.querySelector('.video-info h3').addEventListener('click', handleVideoClick);
|
451 |
+
console.warn = () => {};
|
452 |
+
|
453 |
+
// Insert the video card in the correct position based on uploadTimestamp
|
454 |
+
const videoTimestamp = new Date(videoData.uploadTimestamp);
|
455 |
+
insertVideoCard(videoCard, videoTimestamp);
|
456 |
+
|
457 |
+
// Wait 0.3 seconds before fetching the next URL
|
458 |
+
await new Promise(resolve => setTimeout(resolve, 10));
|
459 |
+
|
460 |
+
} catch (videoError) {
|
461 |
+
;
|
462 |
+
}
|
463 |
+
}
|
464 |
+
} catch (error) {
|
465 |
+
console.error('Error fetching video metadata:', error);
|
466 |
+
}
|
467 |
+
}
|
468 |
+
|
469 |
+
// Call the function on page load
|
470 |
+
window.onload = fetchVideoMetadata;
|
471 |
+
|
472 |
+
</script>
|
473 |
+
|
474 |
+
<style>
|
475 |
+
.subtitle {
|
476 |
+
display: flex;
|
477 |
+
background-color: rgb(0, 72, 85);
|
478 |
+
border-radius: 5px;
|
479 |
+
width: fit-content;
|
480 |
+
padding: 1px 5px;
|
481 |
+
align-items: center;
|
482 |
+
transform-origin: left bottom;
|
483 |
+
transform: scale(80%);
|
484 |
+
}
|
485 |
+
|
486 |
+
.subtitle_icon {
|
487 |
+
width: auto;
|
488 |
+
height: 1em;
|
489 |
+
margin-right: 5px;
|
490 |
+
}
|
491 |
+
|
492 |
+
.subtitle_content {
|
493 |
+
filter: invert(100%);
|
494 |
+
display: flex;
|
495 |
+
align-items: center;
|
496 |
+
}
|
497 |
+
|
498 |
+
.subtitle_text {
|
499 |
+
align-self: center;
|
500 |
+
text-align: center;
|
501 |
+
color: #000000;
|
502 |
+
}
|
503 |
+
</style>
|
504 |
+
|
505 |
+
|
506 |
+
<img scr="https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/thumbnails/From%20Buddha%20to%20Jesus%20%20%23fyp%20%23christian%20%23testimony%20%23gospel%20%23jesusislord%20%23believe%20%23%C9%A2%E1%B4%8F%E1%B4%85%C9%AAs%C9%A2%E1%B4%8F%E1%B4%8F%E1%B4%85%20%23christ%20%23jesusiscalling%20%23christianpost%20%23christianity%20%23bible%20%23biblestudymoments%20(1)-kwne_thumb.jpg"></img>
|
507 |
+
|
508 |
+
</body>
|
509 |
+
|
510 |
+
</html>
|
index3.html
ADDED
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>HuggingTube</title>
|
7 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
:root {
|
10 |
+
--bg-primary: #0a0f18;
|
11 |
+
--bg-secondary: #141e2f;
|
12 |
+
--text-primary: #ffffff;
|
13 |
+
--text-secondary: #adbac7;
|
14 |
+
--accent: #2188ff;
|
15 |
+
}
|
16 |
+
|
17 |
+
* {
|
18 |
+
margin: 0;
|
19 |
+
padding: 0;
|
20 |
+
box-sizing: border-box;
|
21 |
+
}
|
22 |
+
|
23 |
+
body {
|
24 |
+
font-family: Arial, sans-serif;
|
25 |
+
background-color: var(--bg-primary);
|
26 |
+
color: var(--text-primary);
|
27 |
+
}
|
28 |
+
|
29 |
+
header {
|
30 |
+
display: flex;
|
31 |
+
justify-content: space-between;
|
32 |
+
align-items: center;
|
33 |
+
padding: 0.5rem 1rem;
|
34 |
+
background-color: var(--bg-secondary);
|
35 |
+
position: fixed;
|
36 |
+
top: 0;
|
37 |
+
left: 0;
|
38 |
+
right: 0;
|
39 |
+
z-index: 1000;
|
40 |
+
}
|
41 |
+
|
42 |
+
.logo {
|
43 |
+
color: var(--text-primary);
|
44 |
+
font-size: 1.2rem;
|
45 |
+
font-weight: bold;
|
46 |
+
display: flex;
|
47 |
+
align-items: center;
|
48 |
+
}
|
49 |
+
|
50 |
+
.logo i {
|
51 |
+
color: var(--accent);
|
52 |
+
margin-right: 0.5rem;
|
53 |
+
}
|
54 |
+
|
55 |
+
.search-bar {
|
56 |
+
flex-grow: 1;
|
57 |
+
max-width: 600px;
|
58 |
+
margin: 0 1rem;
|
59 |
+
}
|
60 |
+
|
61 |
+
.search-bar input {
|
62 |
+
width: 100%;
|
63 |
+
padding: 0.5rem 1rem;
|
64 |
+
border-radius: 20px;
|
65 |
+
border: 1px solid var(--text-secondary);
|
66 |
+
background-color: var(--bg-primary);
|
67 |
+
color: var(--text-primary);
|
68 |
+
}
|
69 |
+
|
70 |
+
.user-actions i {
|
71 |
+
margin-left: 1rem;
|
72 |
+
cursor: pointer;
|
73 |
+
}
|
74 |
+
|
75 |
+
main {
|
76 |
+
display: flex;
|
77 |
+
margin-top: 56px; /* Header height */
|
78 |
+
}
|
79 |
+
|
80 |
+
.sidebar {
|
81 |
+
width: 240px;
|
82 |
+
padding: 1rem;
|
83 |
+
position: fixed;
|
84 |
+
top: 56px;
|
85 |
+
bottom: 0;
|
86 |
+
overflow-y: auto;
|
87 |
+
background-color: var(--bg-primary);
|
88 |
+
}
|
89 |
+
|
90 |
+
.sidebar-item {
|
91 |
+
display: flex;
|
92 |
+
align-items: center;
|
93 |
+
padding: 0.75rem 1rem;
|
94 |
+
cursor: pointer;
|
95 |
+
border-radius: 10px;
|
96 |
+
}
|
97 |
+
|
98 |
+
.sidebar-item:hover {
|
99 |
+
background-color: var(--bg-secondary);
|
100 |
+
}
|
101 |
+
|
102 |
+
.sidebar-item i {
|
103 |
+
margin-right: 1rem;
|
104 |
+
width: 20px;
|
105 |
+
}
|
106 |
+
|
107 |
+
.content {
|
108 |
+
flex-grow: 1;
|
109 |
+
padding: 1rem;
|
110 |
+
margin-left: 240px;
|
111 |
+
}
|
112 |
+
|
113 |
+
.video-grid {
|
114 |
+
display: grid;
|
115 |
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
116 |
+
gap: 1rem;
|
117 |
+
}
|
118 |
+
|
119 |
+
.video-card {
|
120 |
+
cursor: pointer;
|
121 |
+
}
|
122 |
+
|
123 |
+
.thumbnail {
|
124 |
+
position: relative;
|
125 |
+
width: 100%;
|
126 |
+
height: 0;
|
127 |
+
padding-bottom: 56.25%;
|
128 |
+
background-color: var(--bg-secondary);
|
129 |
+
border-radius: 10px;
|
130 |
+
overflow: hidden;
|
131 |
+
}
|
132 |
+
|
133 |
+
.video-duration {
|
134 |
+
position: absolute;
|
135 |
+
bottom: 5px;
|
136 |
+
right: 5px;
|
137 |
+
background-color: rgba(0, 0, 0, 0.8);
|
138 |
+
padding: 2px 4px;
|
139 |
+
border-radius: 4px;
|
140 |
+
font-size: 0.8rem;
|
141 |
+
}
|
142 |
+
|
143 |
+
.video-info {
|
144 |
+
display: flex;
|
145 |
+
margin-top: 0.5rem;
|
146 |
+
}
|
147 |
+
|
148 |
+
.channel-avatar {
|
149 |
+
width: 36px;
|
150 |
+
height: 36px;
|
151 |
+
border-radius: 50%;
|
152 |
+
background-color: var(--bg-secondary);
|
153 |
+
margin-right: 0.5rem;
|
154 |
+
flex-shrink: 0;
|
155 |
+
}
|
156 |
+
|
157 |
+
.video-details h3 {
|
158 |
+
font-size: 1rem;
|
159 |
+
margin-bottom: 0.25rem;
|
160 |
+
}
|
161 |
+
|
162 |
+
.video-details p {
|
163 |
+
font-size: 0.9rem;
|
164 |
+
color: var(--text-secondary);
|
165 |
+
}
|
166 |
+
|
167 |
+
.mobile-nav {
|
168 |
+
display: none;
|
169 |
+
position: fixed;
|
170 |
+
bottom: 0;
|
171 |
+
left: 0;
|
172 |
+
right: 0;
|
173 |
+
background-color: var(--bg-secondary);
|
174 |
+
padding: 0.5rem;
|
175 |
+
z-index: 1000;
|
176 |
+
}
|
177 |
+
|
178 |
+
.mobile-nav-items {
|
179 |
+
display: flex;
|
180 |
+
justify-content: space-around;
|
181 |
+
}
|
182 |
+
|
183 |
+
.mobile-nav-item {
|
184 |
+
display: flex;
|
185 |
+
flex-direction: column;
|
186 |
+
align-items: center;
|
187 |
+
font-size: 0.8rem;
|
188 |
+
}
|
189 |
+
|
190 |
+
.mobile-nav-item i {
|
191 |
+
font-size: 1.2rem;
|
192 |
+
margin-bottom: 0.25rem;
|
193 |
+
}
|
194 |
+
|
195 |
+
/* Mobile styles */
|
196 |
+
@media (max-width: 768px) {
|
197 |
+
.logo span {
|
198 |
+
display: none;
|
199 |
+
}
|
200 |
+
|
201 |
+
.search-bar {
|
202 |
+
margin: 0 0.5rem;
|
203 |
+
}
|
204 |
+
|
205 |
+
.user-actions i {
|
206 |
+
margin-left: 0.5rem;
|
207 |
+
}
|
208 |
+
|
209 |
+
.sidebar {
|
210 |
+
display: none;
|
211 |
+
}
|
212 |
+
|
213 |
+
.content {
|
214 |
+
margin-left: 0;
|
215 |
+
margin-bottom: 60px; /* Space for mobile nav */
|
216 |
+
}
|
217 |
+
|
218 |
+
.mobile-nav {
|
219 |
+
display: block;
|
220 |
+
}
|
221 |
+
|
222 |
+
.video-grid {
|
223 |
+
grid-template-columns: 1fr;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
/* Small mobile styles */
|
228 |
+
@media (max-width: 480px) {
|
229 |
+
.user-actions {
|
230 |
+
display: none;
|
231 |
+
}
|
232 |
+
|
233 |
+
.search-bar input {
|
234 |
+
font-size: 14px;
|
235 |
+
}
|
236 |
+
|
237 |
+
.video-details h3 {
|
238 |
+
font-size: 0.9rem;
|
239 |
+
}
|
240 |
+
|
241 |
+
.video-details p {
|
242 |
+
font-size: 0.8rem;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
</style>
|
246 |
+
</head>
|
247 |
+
<body>
|
248 |
+
<header>
|
249 |
+
<div class="logo">
|
250 |
+
<i class="fab fa-youtube"></i>
|
251 |
+
<span>HuggingTube</span>
|
252 |
+
</div>
|
253 |
+
<div class="search-bar">
|
254 |
+
<input type="text" placeholder="Search">
|
255 |
+
</div>
|
256 |
+
<div class="user-actions">
|
257 |
+
<i class="fas fa-video"></i>
|
258 |
+
<i class="fas fa-bell"></i>
|
259 |
+
<i class="fas fa-user-circle"></i>
|
260 |
+
</div>
|
261 |
+
</header>
|
262 |
+
|
263 |
+
<main>
|
264 |
+
<aside class="sidebar">
|
265 |
+
<div class="sidebar-item">
|
266 |
+
<i class="fas fa-home"></i>
|
267 |
+
Home
|
268 |
+
</div>
|
269 |
+
<div class="sidebar-item">
|
270 |
+
<i class="fas fa-compass"></i>
|
271 |
+
Explore
|
272 |
+
</div>
|
273 |
+
<div class="sidebar-item">
|
274 |
+
<i class="fas fa-upload"></i>
|
275 |
+
Upload
|
276 |
+
</div>
|
277 |
+
<div class="sidebar-item">
|
278 |
+
<i class="fas fa-photo-video"></i>
|
279 |
+
All videos
|
280 |
+
</div>
|
281 |
+
</aside>
|
282 |
+
|
283 |
+
<section class="content">
|
284 |
+
<div class="video-grid">
|
285 |
+
<!-- Video cards -->
|
286 |
+
<div class="video-card">
|
287 |
+
<div class="thumbnail">
|
288 |
+
<img src="/api/placeholder/250/141" alt="Video thumbnail">
|
289 |
+
<span class="video-duration">10:30</span>
|
290 |
+
</div>
|
291 |
+
<div class="video-info">
|
292 |
+
<div class="channel-avatar"></div>
|
293 |
+
<div class="video-details">
|
294 |
+
<h3>Amazing Video Title That Might Be Long</h3>
|
295 |
+
<p>Channel Name</p>
|
296 |
+
<p>1.2M views • 2 days ago</p>
|
297 |
+
</div>
|
298 |
+
</div>
|
299 |
+
</div>
|
300 |
+
|
301 |
+
<!-- Repeat video cards -->
|
302 |
+
<div class="video-card">
|
303 |
+
<div class="thumbnail">
|
304 |
+
<img src="/api/placeholder/250/141" alt="Video thumbnail">
|
305 |
+
<span class="video-duration">15:45</span>
|
306 |
+
</div>
|
307 |
+
<div class="video-info">
|
308 |
+
<div class="channel-avatar"></div>
|
309 |
+
<div class="video-details">
|
310 |
+
<h3>Another Great Video</h3>
|
311 |
+
<p>Another Channel</p>
|
312 |
+
<p>850K views • 1 week ago</p>
|
313 |
+
</div>
|
314 |
+
</div>
|
315 |
+
</div>
|
316 |
+
|
317 |
+
<div class="video-card">
|
318 |
+
<div class="thumbnail">
|
319 |
+
<img src="/api/placeholder/250/141" alt="Video thumbnail">
|
320 |
+
<span class="video-duration">7:20</span>
|
321 |
+
</div>
|
322 |
+
<div class="video-info">
|
323 |
+
<div class="channel-avatar"></div>
|
324 |
+
<div class="video-details">
|
325 |
+
<h3>Must Watch Tutorial</h3>
|
326 |
+
<p>Tech Channel</p>
|
327 |
+
<p>2M views • 1 month ago</p>
|
328 |
+
</div>
|
329 |
+
</div>
|
330 |
+
</div>
|
331 |
+
|
332 |
+
<div class="video-card">
|
333 |
+
<div class="thumbnail">
|
334 |
+
<img src="/api/placeholder/250/141" alt="Video thumbnail">
|
335 |
+
<span class="video-duration">22:15</span>
|
336 |
+
</div>
|
337 |
+
<div class="video-info">
|
338 |
+
<div class="channel-avatar"></div>
|
339 |
+
<div class="video-details">
|
340 |
+
<h3>Interesting Documentary</h3>
|
341 |
+
<p>Educational Hub</p>
|
342 |
+
<p>500K views • 3 days ago</p>
|
343 |
+
</div>
|
344 |
+
</div>
|
345 |
+
</div>
|
346 |
+
</div>
|
347 |
+
</section>
|
348 |
+
</main>
|
349 |
+
|
350 |
+
<nav class="mobile-nav">
|
351 |
+
<div class="mobile-nav-items">
|
352 |
+
<div class="mobile-nav-item">
|
353 |
+
<i class="fas fa-home"></i>
|
354 |
+
Home
|
355 |
+
</div>
|
356 |
+
<div class="mobile-nav-item">
|
357 |
+
<i class="fas fa-compass"></i>
|
358 |
+
Explore
|
359 |
+
</div>
|
360 |
+
<div class="mobile-nav-item">
|
361 |
+
<i class="fas fa-upload"></i>
|
362 |
+
Upload
|
363 |
+
</div>
|
364 |
+
<div class="mobile-nav-item">
|
365 |
+
<i class="fas fa-photo-video"></i>
|
366 |
+
Library
|
367 |
+
</div>
|
368 |
+
</div>
|
369 |
+
</nav>
|
370 |
+
</body>
|
371 |
+
</html>
|
output.vtt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
WEBVTT
|
2 |
+
|
3 |
+
::cue {
|
4 |
+
color: white; /* Text color */
|
5 |
+
font-family: 'Conturic Gothic', sans-serif; /* Font family */
|
6 |
+
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* Dark outline effect */
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
00:00:00.000 --> 00:00:02.000
|
11 |
+
I have high blood pressure. I am sick.
|
12 |
+
|
13 |
+
00:00:02.000 --> 00:00:05.000
|
14 |
+
And I have to work to get it.
|
15 |
+
|
16 |
+
00:00:05.000 --> 00:00:09.000
|
17 |
+
I have never worked. If I work, I get heat, fever, fever.
|
18 |
+
|
19 |
+
00:00:09.000 --> 00:00:12.560
|
20 |
+
I can't work. I am sick. I get a headache.
|
21 |
+
|
rules.html
ADDED
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Community Guidelines - HuggingTube</title>
|
7 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
:root {
|
10 |
+
--bg-primary: #0a0f18;
|
11 |
+
--bg-secondary: #141e2f;
|
12 |
+
--text-primary: #ffffff;
|
13 |
+
--text-secondary: #adbac7;
|
14 |
+
--accent: #2188ff;
|
15 |
+
--border: #1c2739;
|
16 |
+
--red: #ff4444;
|
17 |
+
--green: #00c851;
|
18 |
+
--yellow: #ffbb33;
|
19 |
+
}
|
20 |
+
|
21 |
+
* {
|
22 |
+
margin: 0;
|
23 |
+
padding: 0;
|
24 |
+
box-sizing: border-box;
|
25 |
+
}
|
26 |
+
|
27 |
+
body {
|
28 |
+
font-family: Arial, sans-serif;
|
29 |
+
background-color: var(--bg-primary);
|
30 |
+
color: var(--text-primary);
|
31 |
+
line-height: 1.6;
|
32 |
+
}
|
33 |
+
|
34 |
+
header {
|
35 |
+
background-color: var(--bg-secondary);
|
36 |
+
padding: 1rem 0;
|
37 |
+
position: sticky;
|
38 |
+
top: 0;
|
39 |
+
z-index: 100;
|
40 |
+
}
|
41 |
+
|
42 |
+
.header-content {
|
43 |
+
display: flex;
|
44 |
+
justify-content: space-between;
|
45 |
+
align-items: center;
|
46 |
+
max-width: 1200px;
|
47 |
+
margin: 0 auto;
|
48 |
+
padding: 0 1rem;
|
49 |
+
}
|
50 |
+
|
51 |
+
.logo {
|
52 |
+
display: flex;
|
53 |
+
align-items: center;
|
54 |
+
font-size: 1.5rem;
|
55 |
+
font-weight: bold;
|
56 |
+
}
|
57 |
+
|
58 |
+
.logo i {
|
59 |
+
color: var(--accent);
|
60 |
+
margin-right: 0.5rem;
|
61 |
+
}
|
62 |
+
|
63 |
+
main {
|
64 |
+
max-width: 1200px;
|
65 |
+
margin: 2rem auto;
|
66 |
+
padding: 0 1rem;
|
67 |
+
}
|
68 |
+
|
69 |
+
.section {
|
70 |
+
background-color: var(--bg-secondary);
|
71 |
+
border-radius: 8px;
|
72 |
+
padding: 2rem;
|
73 |
+
margin-bottom: 2rem;
|
74 |
+
}
|
75 |
+
|
76 |
+
h1 {
|
77 |
+
font-size: 2.5rem;
|
78 |
+
margin-bottom: 1rem;
|
79 |
+
color: var(--accent);
|
80 |
+
}
|
81 |
+
|
82 |
+
h2 {
|
83 |
+
font-size: 1.8rem;
|
84 |
+
margin-bottom: 1rem;
|
85 |
+
color: var(--text-primary);
|
86 |
+
}
|
87 |
+
|
88 |
+
h3 {
|
89 |
+
font-size: 1.4rem;
|
90 |
+
margin: 1.5rem 0 1rem;
|
91 |
+
color: var(--accent);
|
92 |
+
}
|
93 |
+
|
94 |
+
p {
|
95 |
+
margin-bottom: 1rem;
|
96 |
+
color: var(--text-secondary);
|
97 |
+
}
|
98 |
+
|
99 |
+
ul {
|
100 |
+
list-style: none;
|
101 |
+
margin-bottom: 1rem;
|
102 |
+
}
|
103 |
+
|
104 |
+
li {
|
105 |
+
margin-bottom: 0.5rem;
|
106 |
+
padding-left: 1.5rem;
|
107 |
+
position: relative;
|
108 |
+
color: var(--text-secondary);
|
109 |
+
}
|
110 |
+
|
111 |
+
li::before {
|
112 |
+
content: "•";
|
113 |
+
color: var(--accent);
|
114 |
+
position: absolute;
|
115 |
+
left: 0;
|
116 |
+
}
|
117 |
+
|
118 |
+
.rule-category {
|
119 |
+
border-left: 4px solid var(--accent);
|
120 |
+
padding-left: 1rem;
|
121 |
+
margin-bottom: 2rem;
|
122 |
+
}
|
123 |
+
|
124 |
+
.example-box {
|
125 |
+
background-color: var(--bg-primary);
|
126 |
+
border-radius: 4px;
|
127 |
+
padding: 1rem;
|
128 |
+
margin: 1rem 0;
|
129 |
+
}
|
130 |
+
|
131 |
+
.example-label {
|
132 |
+
display: inline-block;
|
133 |
+
padding: 0.25rem 0.5rem;
|
134 |
+
border-radius: 4px;
|
135 |
+
font-size: 0.9rem;
|
136 |
+
margin-bottom: 0.5rem;
|
137 |
+
}
|
138 |
+
|
139 |
+
.allowed {
|
140 |
+
background-color: var(--green);
|
141 |
+
}
|
142 |
+
|
143 |
+
.not-allowed {
|
144 |
+
background-color: var(--red);
|
145 |
+
}
|
146 |
+
|
147 |
+
.status-icon {
|
148 |
+
margin-right: 0.5rem;
|
149 |
+
}
|
150 |
+
|
151 |
+
.appeal-button {
|
152 |
+
display: inline-block;
|
153 |
+
background-color: var(--accent);
|
154 |
+
color: var(--text-primary);
|
155 |
+
padding: 0.75rem 1.5rem;
|
156 |
+
border-radius: 4px;
|
157 |
+
text-decoration: none;
|
158 |
+
margin-top: 1rem;
|
159 |
+
}
|
160 |
+
|
161 |
+
@media (max-width: 768px) {
|
162 |
+
h1 {
|
163 |
+
font-size: 2rem;
|
164 |
+
}
|
165 |
+
|
166 |
+
h2 {
|
167 |
+
font-size: 1.5rem;
|
168 |
+
}
|
169 |
+
|
170 |
+
.section {
|
171 |
+
padding: 1rem;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
</style>
|
175 |
+
</head>
|
176 |
+
<body>
|
177 |
+
<header>
|
178 |
+
<div class="header-content">
|
179 |
+
<div class="logo">
|
180 |
+
<i class="fab fa-youtube"></i>
|
181 |
+
HuggingTube
|
182 |
+
</div>
|
183 |
+
</div>
|
184 |
+
</header>
|
185 |
+
|
186 |
+
<main>
|
187 |
+
<h1>Community Guidelines</h1>
|
188 |
+
|
189 |
+
<section class="section">
|
190 |
+
<h2>Our Commitment</h2>
|
191 |
+
<p>HuggingTube is committed to being a platform where creators can express themselves while maintaining a safe and respectful environment for all users. These guidelines help ensure our community remains a space for creativity, learning, and entertainment.</p>
|
192 |
+
</section>
|
193 |
+
|
194 |
+
<section class="section">
|
195 |
+
<h2>Content Rules</h2>
|
196 |
+
|
197 |
+
|
198 |
+
|
199 |
+
<div class="rule-category">
|
200 |
+
<h3><i class="fas fa-users"></i> Discriminatory Content</h3>
|
201 |
+
<p>We have zero tolerance for discrimination in any form.</p>
|
202 |
+
<ul>
|
203 |
+
<li>No hate speech or content promoting racism</li>
|
204 |
+
<li>No discrimination against any group based on ethnicity, gender, sexuality, etc.</li>
|
205 |
+
<li>No implicit bigotry or coded language designed to discriminate</li>
|
206 |
+
</ul>
|
207 |
+
<div class="example-box">
|
208 |
+
<span class="example-label allowed"><i class="fas fa-check status-icon"></i>Allowed</span>
|
209 |
+
<p>"Celebrating Diversity: Cultural Festival Highlights"</p>
|
210 |
+
</div>
|
211 |
+
<div class="example-box">
|
212 |
+
<span class="example-label not-allowed"><i class="fas fa-times status-icon"></i>Not Allowed</span>
|
213 |
+
<p>"Why [Ethnic Group] Are Ruining Our Country"</p>
|
214 |
+
</div>
|
215 |
+
</div>
|
216 |
+
|
217 |
+
<div class="rule-category">
|
218 |
+
<h3><i class="fas fa-exclamation-triangle"></i> Inappropriate Content</h3>
|
219 |
+
<p>Keep content family-friendly and suitable for all audiences.</p>
|
220 |
+
<ul>
|
221 |
+
<li>No sexual content or suggestive material</li>
|
222 |
+
<li>No excessive violence or graphic content</li>
|
223 |
+
|
224 |
+
<li>No crude humor or offensive references</li>
|
225 |
+
</ul>
|
226 |
+
<div class="example-box">
|
227 |
+
<span class="example-label allowed"><i class="fas fa-check status-icon"></i>Allowed</span>
|
228 |
+
<p>"10 Tips for living in the hood."</p>
|
229 |
+
</div>
|
230 |
+
<div class="example-box">
|
231 |
+
<span class="example-label not-allowed"><i class="fas fa-times status-icon"></i>Not Allowed</span>
|
232 |
+
<p>"Beating the s*** out of my ex."</p>
|
233 |
+
</div>
|
234 |
+
</div>
|
235 |
+
</section>
|
236 |
+
|
237 |
+
<section class="section">
|
238 |
+
<h2>Additional Guidelines</h2>
|
239 |
+
|
240 |
+
<div class="rule-category">
|
241 |
+
<h3><i class="fas fa-user"></i> Username Policy</h3>
|
242 |
+
<p>Choose an appropriate username that doesn't violate our guidelines.</p>
|
243 |
+
<ul>
|
244 |
+
<li>No offensive or discriminatory usernames</li>
|
245 |
+
|
246 |
+
</ul>
|
247 |
+
</div>
|
248 |
+
|
249 |
+
<div class="rule-category">
|
250 |
+
<h3><i class="fas fa-comment"></i> Comment Etiquette</h3>
|
251 |
+
<p>Comments will appear soon, so please follow the guidelines.</p>
|
252 |
+
<ul>
|
253 |
+
<li>Be respectful to creators and other commenters</li>
|
254 |
+
<li>No spamming</li>
|
255 |
+
<li>Keep discussions relevant to the video content</li>
|
256 |
+
</ul>
|
257 |
+
</div>
|
258 |
+
|
259 |
+
<div class="rule-category">
|
260 |
+
<h3><i class="fas fa-exclamation-circle"></i> Content Warnings</h3>
|
261 |
+
<p>Provide appropriate warnings when necessary.</p>
|
262 |
+
<ul>
|
263 |
+
<li>Include content warnings for potentially sensitive material</li>
|
264 |
+
<li>Age-restrict content that may not be suitable for all audiences</li>
|
265 |
+
<li>Clearly label educational content that may contain sensitive topics</li>
|
266 |
+
</ul>
|
267 |
+
</div>
|
268 |
+
<div class="rule-category">
|
269 |
+
<h3><i class="fas fa-pray"></i> Religious Sensitivity</h3>
|
270 |
+
|
271 |
+
<ul>
|
272 |
+
|
273 |
+
<li>Avoid content that deliberately offends religious beliefs without proper arguments behind.</li>
|
274 |
+
<li>Educational, and apologetic content about religion is allowed.</li>
|
275 |
+
</ul>
|
276 |
+
<div class="example-box">
|
277 |
+
<span class="example-label allowed"><i class="fas fa-check status-icon"></i>Allowed</span>
|
278 |
+
<p>"Did Jesus Deny His Divinity by Saying 'My Father is Greater'?"</p>
|
279 |
+
</div>
|
280 |
+
<div class="example-box">
|
281 |
+
<span class="example-label not-allowed"><i class="fas fa-times status-icon"></i>Not Allowed</span>
|
282 |
+
<p>"Why is theism is stupid? - Offending everybody part 1"</p>
|
283 |
+
</div>
|
284 |
+
</div>
|
285 |
+
</section>
|
286 |
+
|
287 |
+
<section class="section">
|
288 |
+
<h2>Enforcement</h2>
|
289 |
+
<p>Our moderation system evaluates all uploaded content across multiple criteria. </p>
|
290 |
+
<p>If your content is flagged:</p>
|
291 |
+
<ul>
|
292 |
+
<li>Your content will be deleted.</li>
|
293 |
+
</ul>
|
294 |
+
<a href="mailto:vericudebuget@gmail.com" class="appeal-button">Appeal a Decision</a>
|
295 |
+
</section>
|
296 |
+
</main>
|
297 |
+
</body>
|
298 |
+
</html>
|
search-results.html
ADDED
File without changes
|
test.html
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>My Website</title>
|
7 |
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
|
8 |
+
</head>
|
9 |
+
<body>
|
10 |
+
<style>
|
11 |
+
body {
|
12 |
+
font-family: 'Montserrat', sans-serif;
|
13 |
+
background-color: #0a0f14;
|
14 |
+
color: #fff;
|
15 |
+
}
|
16 |
+
|
17 |
+
input, button {
|
18 |
+
font-family: 'Montserrat', sans-serif;
|
19 |
+
}
|
20 |
+
|
21 |
+
.shareVideo {
|
22 |
+
width: 500px;
|
23 |
+
padding: 20px;
|
24 |
+
background-color: #0d2233;
|
25 |
+
color: #fff;
|
26 |
+
border-radius: 12px;
|
27 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
28 |
+
}
|
29 |
+
|
30 |
+
.shareVideoHeader {
|
31 |
+
font-size: 1.5rem;
|
32 |
+
font-weight: bold;
|
33 |
+
margin-bottom: 15px;
|
34 |
+
}
|
35 |
+
|
36 |
+
.shareVideoContent {
|
37 |
+
display: flex;
|
38 |
+
flex-direction: column;
|
39 |
+
gap: 20px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.shareVideoActions {
|
43 |
+
display: flex;
|
44 |
+
justify-content: space-between;
|
45 |
+
align-items: center;
|
46 |
+
}
|
47 |
+
|
48 |
+
.urlSection {
|
49 |
+
display: flex;
|
50 |
+
align-items: center;
|
51 |
+
background-color: #0a1e2b;
|
52 |
+
padding: 10px;
|
53 |
+
border-radius: 8px;
|
54 |
+
}
|
55 |
+
|
56 |
+
.urlSection input {
|
57 |
+
width: 100%;
|
58 |
+
padding: 8px;
|
59 |
+
font-size: 1rem;
|
60 |
+
color: #fff;
|
61 |
+
background-color: transparent;
|
62 |
+
border: none;
|
63 |
+
outline: none;
|
64 |
+
}
|
65 |
+
|
66 |
+
.urlSection input::placeholder {
|
67 |
+
color: #88a0b3;
|
68 |
+
}
|
69 |
+
|
70 |
+
.urlSection button {
|
71 |
+
padding: 8px 16px;
|
72 |
+
margin-left: 10px;
|
73 |
+
|
74 |
+
color: #fff;
|
75 |
+
border: none;
|
76 |
+
border-radius: 8px;
|
77 |
+
cursor: pointer;
|
78 |
+
transition: background-color 0.3s ease;
|
79 |
+
}
|
80 |
+
|
81 |
+
.urlSection button:hover {
|
82 |
+
background-color: #0073e6;
|
83 |
+
}
|
84 |
+
|
85 |
+
.shareOptions {
|
86 |
+
display: flex;
|
87 |
+
gap: 15px;
|
88 |
+
}
|
89 |
+
|
90 |
+
.shareOption {
|
91 |
+
background-color: #1b2f40;
|
92 |
+
padding: 10px 15px;
|
93 |
+
border-radius: 8px;
|
94 |
+
cursor: pointer;
|
95 |
+
transition: background-color 0.3s ease;
|
96 |
+
}
|
97 |
+
|
98 |
+
.shareOption:hover {
|
99 |
+
background-color: #233a4e;
|
100 |
+
}
|
101 |
+
|
102 |
+
.shareOption img {
|
103 |
+
width: 24px;
|
104 |
+
height: 24px;
|
105 |
+
margin-right: 10px;
|
106 |
+
}
|
107 |
+
|
108 |
+
.shareOption span {
|
109 |
+
font-size: 1rem;
|
110 |
+
color: #fff;
|
111 |
+
}
|
112 |
+
|
113 |
+
.copyButton {
|
114 |
+
background-color: rgb(0, 72, 85);
|
115 |
+
}
|
116 |
+
</style>
|
117 |
+
|
118 |
+
<div class="shareVideo">
|
119 |
+
<div class="shareVideoHeader">Share this video!</div>
|
120 |
+
<div class="shareVideoContent">
|
121 |
+
<!-- URL Copy Section -->
|
122 |
+
<div class="urlSection">
|
123 |
+
<input id="urlInput" type="text" readonly />
|
124 |
+
<button onclick="copyURL()" class="copyButton">Copy</button>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
<p id="message" class="message"></p>
|
128 |
+
</div>
|
129 |
+
|
130 |
+
<script>
|
131 |
+
// Function to get the current page URL and set it as the input value
|
132 |
+
const getCurrentURL = () => {
|
133 |
+
const currentURL = window.location.href;
|
134 |
+
document.getElementById("urlInput").value = currentURL;
|
135 |
+
};
|
136 |
+
|
137 |
+
// Call the function to set the input value
|
138 |
+
getCurrentURL();
|
139 |
+
|
140 |
+
// Function to copy the input value to the clipboard
|
141 |
+
const copyURL = async () => {
|
142 |
+
try {
|
143 |
+
await navigator.clipboard.writeText(document.getElementById("urlInput").value);
|
144 |
+
} catch (error) {
|
145 |
+
console.log("Error copying URL:", error);
|
146 |
+
}
|
147 |
+
|
148 |
+
const message = document.getElementById('message');
|
149 |
+
message.textContent = "URL copied to clipboard!";
|
150 |
+
message.className = "message";
|
151 |
+
message.classList.remove("fade-out"); // Remove any existing fade-out class
|
152 |
+
message.classList.remove("fade-in"); // Remove any existing fade-in class
|
153 |
+
|
154 |
+
// Add fade-in class if needed
|
155 |
+
message.classList.add("fade-in");
|
156 |
+
message.style.display = 'block'; // show the message
|
157 |
+
|
158 |
+
// Add fade-out class to trigger transition
|
159 |
+
setTimeout(() => {
|
160 |
+
message.classList.add("fade-out");
|
161 |
+
}, 0); // wait 0 milliseconds before adding fade-out class
|
162 |
+
|
163 |
+
// Remove the message after 4 seconds
|
164 |
+
setTimeout(() => {
|
165 |
+
message.style.display = 'none'; // hide the message
|
166 |
+
}, 3000);
|
167 |
+
};
|
168 |
+
</script>
|
169 |
+
<style> </style>
|
170 |
+
|
171 |
+
|
172 |
+
|
173 |
+
</div>
|
174 |
+
</body>
|
175 |
+
</html>
|
test.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
from groq import Groq
|
4 |
+
|
5 |
+
client = Groq(
|
6 |
+
api_key="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"
|
7 |
+
)
|
8 |
+
|
9 |
+
chat_completion = client.chat.completions.create(
|
10 |
+
messages=[
|
11 |
+
{
|
12 |
+
"role": "user",
|
13 |
+
"content": "Explain the importance of fast language models",
|
14 |
+
}
|
15 |
+
],
|
16 |
+
model="llama3-8b-8192",
|
17 |
+
)
|
18 |
+
|
19 |
+
print(chat_completion.choices[0].message.content)
|
upload.html
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Upload Video - HuggingTube</title>
|
7 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
8 |
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
|
9 |
+
<style>
|
10 |
+
:root {
|
11 |
+
--bg-primary: #0a0f18;
|
12 |
+
--bg-secondary: #141e2f;
|
13 |
+
--text-primary: #ffffff;
|
14 |
+
--text-secondary: #adbac7;
|
15 |
+
--accent: #2188ff;
|
16 |
+
--border: #1c2739;
|
17 |
+
--error: #ff4444;
|
18 |
+
--success: #00c851;
|
19 |
+
}
|
20 |
+
|
21 |
+
* {
|
22 |
+
margin: 0;
|
23 |
+
padding: 0;
|
24 |
+
box-sizing: border-box;
|
25 |
+
}
|
26 |
+
|
27 |
+
html, body {
|
28 |
+
height: 100%;
|
29 |
+
}
|
30 |
+
|
31 |
+
body {
|
32 |
+
font-family: 'Montserrat', sans-serif;
|
33 |
+
background-color: var(--bg-primary);
|
34 |
+
color: var(--text-primary);
|
35 |
+
line-height: 1.6;
|
36 |
+
}
|
37 |
+
|
38 |
+
header {
|
39 |
+
display: flex;
|
40 |
+
justify-content: space-between;
|
41 |
+
align-items: center;
|
42 |
+
padding: 0.5rem 1rem;
|
43 |
+
background-color: var(--bg-secondary);
|
44 |
+
position: fixed;
|
45 |
+
top: 0;
|
46 |
+
left: 0;
|
47 |
+
right: 0;
|
48 |
+
z-index: 1000;
|
49 |
+
}
|
50 |
+
|
51 |
+
.logo {
|
52 |
+
color: var(--text-primary);
|
53 |
+
font-size: 1.2rem;
|
54 |
+
font-weight: bold;
|
55 |
+
display: flex;
|
56 |
+
align-items: center;
|
57 |
+
}
|
58 |
+
|
59 |
+
.logo i {
|
60 |
+
color: var(--accent);
|
61 |
+
margin-right: 0.5rem;
|
62 |
+
}
|
63 |
+
|
64 |
+
main {
|
65 |
+
height: 100%;
|
66 |
+
padding-top: 60px; /* Adjust this value based on your header height */
|
67 |
+
}
|
68 |
+
|
69 |
+
.upload-iframe {
|
70 |
+
width: 100%;
|
71 |
+
height: 100%;
|
72 |
+
position: fixed;
|
73 |
+
border: none;
|
74 |
+
|
75 |
+
}
|
76 |
+
|
77 |
+
</style>
|
78 |
+
</head>
|
79 |
+
<body>
|
80 |
+
<div> <iframe src="https://vericudebuget-server-data.hf.space" class="upload-iframe" width="100%" height="100%"></iframe></div>
|
81 |
+
<header>
|
82 |
+
<div class="logo" onclick="window.location.href='index.html'">
|
83 |
+
<i class="fab fa-youtube"></i>
|
84 |
+
<a href="index.html" style="color: white; text-decoration: none; ::after { text-decoration: underline; }">HuggingTube</a>
|
85 |
+
</div>
|
86 |
+
|
87 |
+
<div style="position: absolute; right: 20px; top: 10px;">
|
88 |
+
<a href="rules.html" target="_blank" style="color: white; text-decoration: none;">Rules</a>
|
89 |
+
</div>
|
90 |
+
</header>
|
91 |
+
<script>
|
92 |
+
document.querySelector('iframe').addEventListener('load', event => {
|
93 |
+
event.target.contentWindow.history.pushState(null, '', '/');
|
94 |
+
event.target.contentWindow.addEventListener('popstate', event => {
|
95 |
+
event.target.history.pushState(null, '', '/');
|
96 |
+
});
|
97 |
+
});
|
98 |
+
</script>
|
99 |
+
<main>
|
100 |
+
|
101 |
+
</main>
|
102 |
+
</body>
|
103 |
+
</html>
|
video-player copy.html
ADDED
@@ -0,0 +1,464 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>HuggingTube</title>
|
7 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
8 |
+
<link href="https://vjs.zencdn.net/8.16.1/video-js.css" rel="stylesheet" />
|
9 |
+
|
10 |
+
<style> :root {
|
11 |
+
--bg-primary: #0a0f18;
|
12 |
+
--bg-secondary: #141e2f;
|
13 |
+
--text-primary: #ffffff;
|
14 |
+
--text-secondary: #adbac7;
|
15 |
+
--accent: #2188ff;
|
16 |
+
}
|
17 |
+
|
18 |
+
* {
|
19 |
+
margin: 0;
|
20 |
+
padding: 0;
|
21 |
+
box-sizing: border-box;
|
22 |
+
}
|
23 |
+
|
24 |
+
body {
|
25 |
+
font-family: Arial, sans-serif;
|
26 |
+
background-color: var(--bg-primary);
|
27 |
+
color: var(--text-primary);
|
28 |
+
}
|
29 |
+
|
30 |
+
header {
|
31 |
+
display: flex;
|
32 |
+
justify-content: space-between;
|
33 |
+
align-items: center;
|
34 |
+
padding: 0.5rem 1rem;
|
35 |
+
background-color: var(--bg-secondary);
|
36 |
+
position: fixed;
|
37 |
+
top: 0;
|
38 |
+
left: 0;
|
39 |
+
right: 0;
|
40 |
+
z-index: 1000;
|
41 |
+
}
|
42 |
+
|
43 |
+
.logo {
|
44 |
+
color: var(--text-primary);
|
45 |
+
font-size: 1.2rem;
|
46 |
+
font-weight: bold;
|
47 |
+
display: flex;
|
48 |
+
align-items: center;
|
49 |
+
}
|
50 |
+
|
51 |
+
.logo i {
|
52 |
+
color: var(--accent);
|
53 |
+
margin-right: 0.5rem;
|
54 |
+
}
|
55 |
+
|
56 |
+
.search-bar {
|
57 |
+
flex-grow: 1;
|
58 |
+
max-width: 600px;
|
59 |
+
margin: 0 1rem;
|
60 |
+
}
|
61 |
+
|
62 |
+
.search-bar input {
|
63 |
+
width: 100%;
|
64 |
+
padding: 0.5rem 1rem;
|
65 |
+
border-radius: 20px;
|
66 |
+
border: 1px solid var(--text-secondary);
|
67 |
+
background-color: var(--bg-primary);
|
68 |
+
color: var(--text-primary);
|
69 |
+
}
|
70 |
+
|
71 |
+
.user-actions i {
|
72 |
+
margin-left: 1rem;
|
73 |
+
cursor: pointer;
|
74 |
+
}
|
75 |
+
|
76 |
+
main {
|
77 |
+
margin-top: 56px;
|
78 |
+
display: flex;
|
79 |
+
padding: 1rem;
|
80 |
+
}
|
81 |
+
|
82 |
+
.video-container {
|
83 |
+
flex: 1;
|
84 |
+
margin-right: 1rem;
|
85 |
+
}
|
86 |
+
|
87 |
+
.video-player {
|
88 |
+
position: relative;
|
89 |
+
width: 100%;
|
90 |
+
|
91 |
+
background-color: black;
|
92 |
+
margin-bottom: 1rem;
|
93 |
+
}
|
94 |
+
|
95 |
+
.video-player img {
|
96 |
+
position: absolute;
|
97 |
+
width: 100%;
|
98 |
+
height: 100%;
|
99 |
+
object-fit: cover;
|
100 |
+
}
|
101 |
+
|
102 |
+
.video-info {
|
103 |
+
margin-bottom: 1rem;
|
104 |
+
}
|
105 |
+
|
106 |
+
.video-title {
|
107 |
+
font-size: 1.5rem;
|
108 |
+
margin-bottom: 0.5rem;
|
109 |
+
}
|
110 |
+
|
111 |
+
.video-stats {
|
112 |
+
display: flex;
|
113 |
+
justify-content: space-between;
|
114 |
+
align-items: center;
|
115 |
+
padding-bottom: 1rem;
|
116 |
+
border-bottom: 1px solid var(--bg-secondary);
|
117 |
+
}
|
118 |
+
|
119 |
+
.view-count {
|
120 |
+
color: var(--text-secondary);
|
121 |
+
}
|
122 |
+
|
123 |
+
.video-actions {
|
124 |
+
display: flex;
|
125 |
+
gap: 1rem;
|
126 |
+
}
|
127 |
+
|
128 |
+
.action-button {
|
129 |
+
display: flex;
|
130 |
+
align-items: center;
|
131 |
+
gap: 0.5rem;
|
132 |
+
background: none;
|
133 |
+
border: none;
|
134 |
+
color: var(--text-primary);
|
135 |
+
cursor: pointer;
|
136 |
+
}
|
137 |
+
|
138 |
+
.channel-info {
|
139 |
+
display: flex;
|
140 |
+
align-items: center;
|
141 |
+
padding-bottom: 1rem;
|
142 |
+
border-bottom: 1px solid var(--bg-secondary);
|
143 |
+
}
|
144 |
+
|
145 |
+
.channel-avatar {
|
146 |
+
width: 48px;
|
147 |
+
height: 48px;
|
148 |
+
border-radius: 50%;
|
149 |
+
background-color: var(--bg-secondary);
|
150 |
+
margin-right: 1rem;
|
151 |
+
}
|
152 |
+
|
153 |
+
.channel-details {
|
154 |
+
display: grid;
|
155 |
+
align-items: center;
|
156 |
+
}
|
157 |
+
|
158 |
+
.channel-name {
|
159 |
+
font-weight: bold;
|
160 |
+
}
|
161 |
+
|
162 |
+
.subscriber-count {
|
163 |
+
color: var(--text-secondary);
|
164 |
+
font-size: 0.9rem;
|
165 |
+
margin-bottom: 0.5rem;
|
166 |
+
}
|
167 |
+
|
168 |
+
.subscribe-button {
|
169 |
+
background-color: var(--accent);
|
170 |
+
color: var(--text-primary);
|
171 |
+
border: none;
|
172 |
+
padding: 0.5rem 1rem;
|
173 |
+
border-radius: 20px;
|
174 |
+
cursor: pointer;
|
175 |
+
font-weight: bold;
|
176 |
+
}
|
177 |
+
|
178 |
+
.video-description {
|
179 |
+
margin-top: 1rem;
|
180 |
+
color: var(--text-secondary);
|
181 |
+
white-space: pre-line;
|
182 |
+
}
|
183 |
+
|
184 |
+
.recommendations {
|
185 |
+
width: 400px;
|
186 |
+
}
|
187 |
+
|
188 |
+
.recommendation {
|
189 |
+
display: flex;
|
190 |
+
margin-bottom: 0.5rem;
|
191 |
+
cursor: pointer;
|
192 |
+
}
|
193 |
+
|
194 |
+
.recommendation-thumbnail {
|
195 |
+
width: 160px;
|
196 |
+
height: 90px;
|
197 |
+
background-color: var(--bg-secondary);
|
198 |
+
margin-right: 0.5rem;
|
199 |
+
flex-shrink: 0;
|
200 |
+
}
|
201 |
+
|
202 |
+
.recommendation-info h3 {
|
203 |
+
font-size: 0.9rem;
|
204 |
+
margin-bottom: 0.25rem;
|
205 |
+
}
|
206 |
+
|
207 |
+
.recommendation-info p {
|
208 |
+
font-size: 0.8rem;
|
209 |
+
color: var(--text-secondary);
|
210 |
+
}
|
211 |
+
|
212 |
+
.comments-section {
|
213 |
+
margin-top: 1rem;
|
214 |
+
}
|
215 |
+
|
216 |
+
.comments-header {
|
217 |
+
display: flex;
|
218 |
+
align-items: center;
|
219 |
+
margin-bottom: 1rem;
|
220 |
+
}
|
221 |
+
|
222 |
+
.comment-count {
|
223 |
+
margin-right: 1rem;
|
224 |
+
}
|
225 |
+
|
226 |
+
.sort-button {
|
227 |
+
display: flex;
|
228 |
+
align-items: center;
|
229 |
+
background: none;
|
230 |
+
border: none;
|
231 |
+
color: var(--text-primary);
|
232 |
+
cursor: pointer;
|
233 |
+
}
|
234 |
+
|
235 |
+
.comment {
|
236 |
+
display: flex;
|
237 |
+
margin-bottom: 1rem;
|
238 |
+
}
|
239 |
+
|
240 |
+
.comment-avatar {
|
241 |
+
width: 40px;
|
242 |
+
height: 40px;
|
243 |
+
border-radius: 50%;
|
244 |
+
background-color: var(--bg-secondary);
|
245 |
+
margin-right: 1rem;
|
246 |
+
}
|
247 |
+
|
248 |
+
.comment-content {
|
249 |
+
flex: 1;
|
250 |
+
}
|
251 |
+
|
252 |
+
.comment-header {
|
253 |
+
display: flex;
|
254 |
+
align-items: center;
|
255 |
+
margin-bottom: 0.25rem;
|
256 |
+
}
|
257 |
+
|
258 |
+
.comment-author {
|
259 |
+
font-weight: bold;
|
260 |
+
margin-right: 0.5rem;
|
261 |
+
}
|
262 |
+
|
263 |
+
.comment-timestamp {
|
264 |
+
color: var(--text-secondary);
|
265 |
+
font-size: 0.9rem;
|
266 |
+
}
|
267 |
+
|
268 |
+
@media (max-width: 1200px) {
|
269 |
+
.recommendations {
|
270 |
+
width: 300px;
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
@media (max-width: 1000px) {
|
275 |
+
main {
|
276 |
+
flex-direction: column;
|
277 |
+
}
|
278 |
+
|
279 |
+
.video-container {
|
280 |
+
margin-right: 0;
|
281 |
+
margin-bottom: 1rem;
|
282 |
+
}
|
283 |
+
|
284 |
+
.recommendations {
|
285 |
+
width: 100%;
|
286 |
+
}
|
287 |
+
|
288 |
+
.recommendation {
|
289 |
+
width: 100%;
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
@media (max-width: 768px) {
|
294 |
+
.logo span {
|
295 |
+
display: none;
|
296 |
+
}
|
297 |
+
|
298 |
+
.user-actions {
|
299 |
+
display: none;
|
300 |
+
}
|
301 |
+
|
302 |
+
.video-stats {
|
303 |
+
flex-direction: column;
|
304 |
+
align-items: flex-start;
|
305 |
+
}
|
306 |
+
|
307 |
+
.video-actions {
|
308 |
+
margin-top: 0.5rem;
|
309 |
+
}
|
310 |
+
|
311 |
+
.recommendation-thumbnail {
|
312 |
+
width: 120px;
|
313 |
+
height: 68px;
|
314 |
+
}
|
315 |
+
}</style>
|
316 |
+
</head>
|
317 |
+
<body>
|
318 |
+
<header>
|
319 |
+
<div class="logo">
|
320 |
+
<i class="fab fa-youtube"></i>
|
321 |
+
<a href="index.html" style="color: white; text-decoration: none;">HuggingTube</a>
|
322 |
+
</div>
|
323 |
+
<div class="search-bar">
|
324 |
+
<input type="text" placeholder="Search">
|
325 |
+
</div>
|
326 |
+
<div class="user-actions">
|
327 |
+
<i class="fas fa-video"></i>
|
328 |
+
<i class="fas fa-bell"></i>
|
329 |
+
<i class="fas fa-user-circle"></i>
|
330 |
+
</div>
|
331 |
+
</header>
|
332 |
+
|
333 |
+
<main>
|
334 |
+
<div class="video-container">
|
335 |
+
<video
|
336 |
+
id="my-video"
|
337 |
+
class="video-js"
|
338 |
+
controls
|
339 |
+
preload="auto"
|
340 |
+
width="640"
|
341 |
+
height="264"
|
342 |
+
data-setup="{}"
|
343 |
+
>
|
344 |
+
<track src="output.vtt" kind="subtitles" srclang="en" label="English" default>
|
345 |
+
<source id="video-troll" src="" type="video/mp4" />
|
346 |
+
<p class="vjs-no-js">
|
347 |
+
To view this video please enable JavaScript, and consider upgrading to a
|
348 |
+
web browser that
|
349 |
+
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
|
350 |
+
</p>
|
351 |
+
</video>
|
352 |
+
</div>
|
353 |
+
|
354 |
+
<div class="video-info">
|
355 |
+
<h1 class="video-title" id="video-title">Loading...</h1>
|
356 |
+
<div class="video-stats">
|
357 |
+
<span class="view-count" id="view-count">Loading...</span>
|
358 |
+
<div class="video-actions">
|
359 |
+
<button class="action-button">
|
360 |
+
<i class="fas fa-share"></i> Share
|
361 |
+
</button>
|
362 |
+
<button class="action-button" id="download-button">
|
363 |
+
<i class="fas fa-download"></i> Download
|
364 |
+
</button>
|
365 |
+
</div>
|
366 |
+
</div>
|
367 |
+
</div>
|
368 |
+
|
369 |
+
<div class="channel-info">
|
370 |
+
<div class="channel-avatar"></div>
|
371 |
+
<div class="channel-details">
|
372 |
+
<span class="channel-name" id="channel-name">Loading...</span>
|
373 |
+
</div>
|
374 |
+
</div>
|
375 |
+
|
376 |
+
<div class="video-description" id="video-description">
|
377 |
+
Loading description...
|
378 |
+
</div>
|
379 |
+
</main>
|
380 |
+
|
381 |
+
<script src="https://vjs.zencdn.net/8.16.1/video.min.js"></script>
|
382 |
+
<script>
|
383 |
+
document.addEventListener("DOMContentLoaded", function () {
|
384 |
+
const jsonUrl = localStorage.getItem("video_to_watch");
|
385 |
+
|
386 |
+
if (jsonUrl) {
|
387 |
+
fetch(jsonUrl)
|
388 |
+
.then(response => {
|
389 |
+
if (!response.ok) {
|
390 |
+
throw new Error(`HTTP error! status: ${response.status}`);
|
391 |
+
}
|
392 |
+
return response.json();
|
393 |
+
})
|
394 |
+
.then(data => {
|
395 |
+
document.getElementById("video-title").innerText = data.title;
|
396 |
+
const date = new Date(data.uploadTimestamp);
|
397 |
+
document.getElementById("view-count").innerText = `Uploaded on ${date.toLocaleString('en-US', { month: 'long' })} ${date.getDate()}, ${date.getFullYear()} at ${date.toLocaleTimeString()}`;
|
398 |
+
document.getElementById("channel-name").innerText = data.uploader;
|
399 |
+
document.getElementById("video-description").innerText = data.description;
|
400 |
+
|
401 |
+
document.title = data.title + " - HuggingTube";
|
402 |
+
|
403 |
+
const baseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/resolve/main/';
|
404 |
+
const videoElement = document.getElementById("video-troll");
|
405 |
+
if (videoElement) {
|
406 |
+
const fileLocation = data.fileLocation.split('/').pop();
|
407 |
+
const videoUrl = `${baseUrl}videos/${encodeURIComponent(fileLocation)}?download=true`;
|
408 |
+
|
409 |
+
// Determine the file extension and set the type accordingly
|
410 |
+
const fileExtension = fileLocation.split('.').pop().toLowerCase();
|
411 |
+
let videoType = '';
|
412 |
+
|
413 |
+
switch (fileExtension) {
|
414 |
+
case 'mp4':
|
415 |
+
videoType = 'video/mp4';
|
416 |
+
break;
|
417 |
+
case 'webm':
|
418 |
+
videoType = 'video/webm';
|
419 |
+
break;
|
420 |
+
case 'ogg':
|
421 |
+
videoType = 'video/ogg';
|
422 |
+
break;
|
423 |
+
default:
|
424 |
+
console.error("Unsupported video format:", fileExtension);
|
425 |
+
return; // Exit if the format is unsupported
|
426 |
+
}
|
427 |
+
|
428 |
+
console.log("Video URL:", videoUrl);
|
429 |
+
console.log("Video Type:", videoType);
|
430 |
+
|
431 |
+
// Set the source using an object
|
432 |
+
videoElement.src = videoUrl;
|
433 |
+
videoElement.setAttribute('type', videoType);
|
434 |
+
videoElement.load(); // Ensure the video element reloads the new source
|
435 |
+
}
|
436 |
+
})
|
437 |
+
.catch(error => {
|
438 |
+
console.error("Error fetching or parsing the JSON data:", error);
|
439 |
+
});
|
440 |
+
} else {
|
441 |
+
console.error("No JSON file link found in localStorage");
|
442 |
+
}
|
443 |
+
|
444 |
+
document.getElementById("download-button").addEventListener("click", function() {
|
445 |
+
const videoElement = document.getElementById("video-troll");
|
446 |
+
const videoUrl = videoElement.src;
|
447 |
+
const fileName = videoUrl.split('/').pop().split('?')[0];
|
448 |
+
|
449 |
+
// Create a link element dynamically
|
450 |
+
const link = document.createElement('a');
|
451 |
+
link.href = videoUrl;
|
452 |
+
link.setAttribute('download', fileName);
|
453 |
+
link.style.display = 'none';
|
454 |
+
|
455 |
+
// Add the link to the DOM and simulate a click
|
456 |
+
document.body.appendChild(link);
|
457 |
+
link.click();
|
458 |
+
document.body.removeChild(link); // Remove the link after click
|
459 |
+
});
|
460 |
+
});
|
461 |
+
|
462 |
+
</script>
|
463 |
+
</body>
|
464 |
+
</html>
|
video-player.html
ADDED
@@ -0,0 +1,1096 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title></title>
|
7 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
8 |
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
|
9 |
+
<style>
|
10 |
+
:root {
|
11 |
+
--bg-primary: #0a0f18;
|
12 |
+
--bg-secondary: #141e2f;
|
13 |
+
--text-primary: #ffffff;
|
14 |
+
--text-secondary: #adbac7;
|
15 |
+
--accent: #2188ff;
|
16 |
+
}
|
17 |
+
|
18 |
+
* {
|
19 |
+
margin: 0;
|
20 |
+
padding: 0;
|
21 |
+
box-sizing: border-box;
|
22 |
+
}
|
23 |
+
|
24 |
+
body {
|
25 |
+
|
26 |
+
background-color: var(--bg-primary);
|
27 |
+
color: var(--text-primary);
|
28 |
+
}
|
29 |
+
|
30 |
+
body {
|
31 |
+
font-family: 'Montserrat', sans-serif;
|
32 |
+
}
|
33 |
+
|
34 |
+
header {
|
35 |
+
display: flex;
|
36 |
+
justify-content: space-between;
|
37 |
+
align-items: center;
|
38 |
+
padding: 0.5rem 1rem;
|
39 |
+
background-color: var(--bg-secondary);
|
40 |
+
position: fixed;
|
41 |
+
top: 0;
|
42 |
+
left: 0;
|
43 |
+
right: 0;
|
44 |
+
z-index: 1000;
|
45 |
+
}
|
46 |
+
|
47 |
+
.logo {
|
48 |
+
color: var(--text-primary);
|
49 |
+
font-size: 1.2rem;
|
50 |
+
font-weight: bold;
|
51 |
+
display: flex;
|
52 |
+
align-items: center;
|
53 |
+
}
|
54 |
+
|
55 |
+
.logo i {
|
56 |
+
color: var(--accent);
|
57 |
+
margin-right: 0.5rem;
|
58 |
+
}
|
59 |
+
|
60 |
+
.search-bar {
|
61 |
+
flex-grow: 1;
|
62 |
+
max-width: 600px;
|
63 |
+
margin: 0 1rem;
|
64 |
+
}
|
65 |
+
|
66 |
+
.search-bar input {
|
67 |
+
width: 100%;
|
68 |
+
padding: 0.5rem 1rem;
|
69 |
+
border-radius: 20px;
|
70 |
+
border: 1px solid var(--text-secondary);
|
71 |
+
background-color: var(--bg-primary);
|
72 |
+
color: var(--text-primary);
|
73 |
+
}
|
74 |
+
|
75 |
+
.user-actions i {
|
76 |
+
margin-left: 1rem;
|
77 |
+
cursor: pointer;
|
78 |
+
}
|
79 |
+
|
80 |
+
main {
|
81 |
+
margin-top: 56px;
|
82 |
+
display: flex;
|
83 |
+
padding: 1rem;
|
84 |
+
}
|
85 |
+
|
86 |
+
.video-container {
|
87 |
+
flex: 1;
|
88 |
+
margin-right: 1rem;
|
89 |
+
}
|
90 |
+
|
91 |
+
.video-player {
|
92 |
+
position: relative;
|
93 |
+
width: 100%;
|
94 |
+
|
95 |
+
background-color: black;
|
96 |
+
margin-bottom: 1rem;
|
97 |
+
}
|
98 |
+
|
99 |
+
.video-player img {
|
100 |
+
position: absolute;
|
101 |
+
width: 100%;
|
102 |
+
height: 100%;
|
103 |
+
object-fit: cover;
|
104 |
+
}
|
105 |
+
|
106 |
+
.video-info {
|
107 |
+
margin-bottom: 1rem;
|
108 |
+
}
|
109 |
+
|
110 |
+
.video-title {
|
111 |
+
font-size: 1.5rem;
|
112 |
+
margin-bottom: 0.5rem;
|
113 |
+
}
|
114 |
+
|
115 |
+
.video-stats {
|
116 |
+
display: flex;
|
117 |
+
justify-content: space-between;
|
118 |
+
align-items: center;
|
119 |
+
padding-bottom: 1rem;
|
120 |
+
border-bottom: 1px solid var(--bg-secondary);
|
121 |
+
}
|
122 |
+
|
123 |
+
.view-count {
|
124 |
+
color: var(--text-secondary);
|
125 |
+
}
|
126 |
+
|
127 |
+
.video-actions {
|
128 |
+
display: flex;
|
129 |
+
gap: 1rem;
|
130 |
+
}
|
131 |
+
|
132 |
+
.action-button {
|
133 |
+
display: flex;
|
134 |
+
align-items: center;
|
135 |
+
gap: 0.5rem;
|
136 |
+
background: none;
|
137 |
+
border: none;
|
138 |
+
color: var(--text-primary);
|
139 |
+
cursor: pointer;
|
140 |
+
}
|
141 |
+
|
142 |
+
.channel-info {
|
143 |
+
display: flex;
|
144 |
+
align-items: center;
|
145 |
+
padding-bottom: 1rem;
|
146 |
+
border-bottom: 1px solid var(--bg-secondary);
|
147 |
+
}
|
148 |
+
|
149 |
+
.channel-avatar {
|
150 |
+
width: 48px;
|
151 |
+
height: 48px;
|
152 |
+
border-radius: 50%;
|
153 |
+
background-color: var(--bg-secondary);
|
154 |
+
margin-right: 1rem;
|
155 |
+
}
|
156 |
+
|
157 |
+
.channel-details {
|
158 |
+
display: grid;
|
159 |
+
align-items: center;
|
160 |
+
}
|
161 |
+
|
162 |
+
.channel-name {
|
163 |
+
font-weight: bold;
|
164 |
+
}
|
165 |
+
|
166 |
+
.subscriber-count {
|
167 |
+
color: var(--text-secondary);
|
168 |
+
font-size: 0.9rem;
|
169 |
+
margin-bottom: 0.5rem;
|
170 |
+
}
|
171 |
+
|
172 |
+
.subscribe-button {
|
173 |
+
background-color: var(--accent);
|
174 |
+
color: var(--text-primary);
|
175 |
+
border: none;
|
176 |
+
padding: 0.5rem 1rem;
|
177 |
+
border-radius: 20px;
|
178 |
+
cursor: pointer;
|
179 |
+
font-weight: bold;
|
180 |
+
}
|
181 |
+
|
182 |
+
.video-description {
|
183 |
+
margin-top: 1rem;
|
184 |
+
color: var(--text-secondary);
|
185 |
+
white-space: pre-line;
|
186 |
+
}
|
187 |
+
|
188 |
+
.recommendations {
|
189 |
+
width: 400px;
|
190 |
+
}
|
191 |
+
|
192 |
+
.recommendation {
|
193 |
+
display: flex;
|
194 |
+
margin-bottom: 0.5rem;
|
195 |
+
cursor: pointer;
|
196 |
+
}
|
197 |
+
|
198 |
+
.recommendation-thumbnail {
|
199 |
+
width: 160px;
|
200 |
+
height: 90px;
|
201 |
+
background-color: var(--bg-secondary);
|
202 |
+
margin-right: 0.5rem;
|
203 |
+
flex-shrink: 0;
|
204 |
+
}
|
205 |
+
|
206 |
+
.recommendation-info h3 {
|
207 |
+
font-size: 0.9rem;
|
208 |
+
margin-bottom: 0.25rem;
|
209 |
+
}
|
210 |
+
|
211 |
+
.recommendation-info p {
|
212 |
+
font-size: 0.8rem;
|
213 |
+
color: var(--text-secondary);
|
214 |
+
}
|
215 |
+
|
216 |
+
.comments-section {
|
217 |
+
margin-top: 1rem;
|
218 |
+
}
|
219 |
+
|
220 |
+
.comments-header {
|
221 |
+
display: flex;
|
222 |
+
align-items: center;
|
223 |
+
margin-bottom: 1rem;
|
224 |
+
}
|
225 |
+
|
226 |
+
.comment-count {
|
227 |
+
margin-right: 1rem;
|
228 |
+
}
|
229 |
+
|
230 |
+
.sort-button {
|
231 |
+
display: flex;
|
232 |
+
align-items: center;
|
233 |
+
background: none;
|
234 |
+
border: none;
|
235 |
+
color: var(--text-primary);
|
236 |
+
cursor: pointer;
|
237 |
+
}
|
238 |
+
|
239 |
+
.comment {
|
240 |
+
display: flex;
|
241 |
+
margin-bottom: 1rem;
|
242 |
+
}
|
243 |
+
|
244 |
+
.comment-avatar {
|
245 |
+
width: 40px;
|
246 |
+
height: 40px;
|
247 |
+
border-radius: 50%;
|
248 |
+
background-color: var(--bg-secondary);
|
249 |
+
margin-right: 1rem;
|
250 |
+
}
|
251 |
+
|
252 |
+
.comment-content {
|
253 |
+
flex: 1;
|
254 |
+
}
|
255 |
+
|
256 |
+
.comment-header {
|
257 |
+
display: flex;
|
258 |
+
align-items: center;
|
259 |
+
margin-bottom: 0.25rem;
|
260 |
+
}
|
261 |
+
|
262 |
+
.comment-author {
|
263 |
+
font-weight: bold;
|
264 |
+
margin-right: 0.5rem;
|
265 |
+
}
|
266 |
+
|
267 |
+
.comment-timestamp {
|
268 |
+
color: var(--text-secondary);
|
269 |
+
font-size: 0.9rem;
|
270 |
+
}
|
271 |
+
|
272 |
+
@media (max-width: 1200px) {
|
273 |
+
.recommendations {
|
274 |
+
width: 300px;
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
@media (max-width: 1000px) {
|
279 |
+
main {
|
280 |
+
flex-direction: column;
|
281 |
+
}
|
282 |
+
|
283 |
+
.video-container {
|
284 |
+
margin-right: 0;
|
285 |
+
margin-bottom: 1rem;
|
286 |
+
}
|
287 |
+
|
288 |
+
.recommendations {
|
289 |
+
width: 100%;
|
290 |
+
}
|
291 |
+
|
292 |
+
.recommendation {
|
293 |
+
width: 100%;
|
294 |
+
}
|
295 |
+
}
|
296 |
+
|
297 |
+
@media (max-width: 768px) {
|
298 |
+
.logo span {
|
299 |
+
display: none;
|
300 |
+
}
|
301 |
+
|
302 |
+
.user-actions {
|
303 |
+
display: none;
|
304 |
+
}
|
305 |
+
|
306 |
+
.video-stats {
|
307 |
+
flex-direction: column;
|
308 |
+
align-items: flex-start;
|
309 |
+
}
|
310 |
+
|
311 |
+
.video-actions {
|
312 |
+
margin-top: 0.5rem;
|
313 |
+
}
|
314 |
+
|
315 |
+
.recommendation-thumbnail {
|
316 |
+
width: 120px;
|
317 |
+
height: 68px;
|
318 |
+
}
|
319 |
+
|
320 |
+
|
321 |
+
}
|
322 |
+
|
323 |
+
video::-webkit-media-text-track-display {
|
324 |
+
font-size: 2vw;
|
325 |
+
}
|
326 |
+
|
327 |
+
video {max-height: 80vh;
|
328 |
+
pointer-events:visible;}
|
329 |
+
|
330 |
+
input, button {
|
331 |
+
font-family: 'Montserrat', sans-serif;
|
332 |
+
}
|
333 |
+
|
334 |
+
.shareVideo {
|
335 |
+
width: 500px;
|
336 |
+
padding: 20px;
|
337 |
+
background-color: #0d2233;
|
338 |
+
color: #fff;
|
339 |
+
border-radius: 12px;
|
340 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
341 |
+
}
|
342 |
+
|
343 |
+
.shareVideoHeader {
|
344 |
+
font-size: 1.5rem;
|
345 |
+
font-weight: bold;
|
346 |
+
margin-bottom: 15px;
|
347 |
+
}
|
348 |
+
|
349 |
+
.shareVideoContent {
|
350 |
+
display: flex;
|
351 |
+
flex-direction: column;
|
352 |
+
gap: 20px;
|
353 |
+
}
|
354 |
+
|
355 |
+
.shareVideoActions {
|
356 |
+
display: flex;
|
357 |
+
justify-content: space-between;
|
358 |
+
align-items: center;
|
359 |
+
}
|
360 |
+
|
361 |
+
.urlSection {
|
362 |
+
display: flex;
|
363 |
+
align-items: center;
|
364 |
+
background-color: #0a1e2b;
|
365 |
+
padding: 10px;
|
366 |
+
border-radius: 8px;
|
367 |
+
}
|
368 |
+
|
369 |
+
.urlSection input {
|
370 |
+
width: 100%;
|
371 |
+
padding: 8px;
|
372 |
+
font-size: 1rem;
|
373 |
+
color: #fff;
|
374 |
+
background-color: transparent;
|
375 |
+
border: none;
|
376 |
+
outline: none;
|
377 |
+
}
|
378 |
+
|
379 |
+
.urlSection input::placeholder {
|
380 |
+
color: #88a0b3;
|
381 |
+
}
|
382 |
+
|
383 |
+
.urlSection button {
|
384 |
+
padding: 8px 16px;
|
385 |
+
margin-left: 10px;
|
386 |
+
|
387 |
+
color: #fff;
|
388 |
+
border: none;
|
389 |
+
border-radius: 8px;
|
390 |
+
cursor: pointer;
|
391 |
+
transition: background-color 0.3s ease;
|
392 |
+
}
|
393 |
+
|
394 |
+
.urlSection button:hover {
|
395 |
+
background-color: #0073e6;
|
396 |
+
}
|
397 |
+
|
398 |
+
.shareOptions {
|
399 |
+
display: flex;
|
400 |
+
gap: 15px;
|
401 |
+
}
|
402 |
+
|
403 |
+
.shareOption {
|
404 |
+
background-color: #1b2f40;
|
405 |
+
padding: 10px 15px;
|
406 |
+
border-radius: 8px;
|
407 |
+
cursor: pointer;
|
408 |
+
transition: background-color 0.3s ease;
|
409 |
+
}
|
410 |
+
|
411 |
+
.shareOption:hover {
|
412 |
+
background-color: #233a4e;
|
413 |
+
}
|
414 |
+
|
415 |
+
.shareOption img {
|
416 |
+
width: 24px;
|
417 |
+
height: 24px;
|
418 |
+
margin-right: 10px;
|
419 |
+
}
|
420 |
+
|
421 |
+
.shareOption span {
|
422 |
+
font-size: 1rem;
|
423 |
+
color: #fff;
|
424 |
+
}
|
425 |
+
|
426 |
+
.copyButton {
|
427 |
+
background-color: rgb(0, 72, 85);
|
428 |
+
}
|
429 |
+
|
430 |
+
.closeButton {
|
431 |
+
color: rgb(255, 255, 255);
|
432 |
+
right: 10px;
|
433 |
+
top: 3px;
|
434 |
+
position: absolute;
|
435 |
+
transition: all 0.3s ease;
|
436 |
+
user-select: none;
|
437 |
+
}
|
438 |
+
|
439 |
+
.closeButton:hover {
|
440 |
+
color: rgb(255, 0, 0);
|
441 |
+
}
|
442 |
+
|
443 |
+
|
444 |
+
</style>
|
445 |
+
</head>
|
446 |
+
<body>
|
447 |
+
<header>
|
448 |
+
<div class="logo">
|
449 |
+
<i class="fab fa-youtube"></i>
|
450 |
+
<a href="index.html" style="color: white; text-decoration: none; ::after { text-decoration: underline; }">HuggingTube</a>
|
451 |
+
</div>
|
452 |
+
<div class="search-bar">
|
453 |
+
<input type="text" placeholder="Search">
|
454 |
+
</div>
|
455 |
+
<div class="user-actions">
|
456 |
+
<i class="fas fa-video"></i>
|
457 |
+
<i class="fas fa-bell"></i>
|
458 |
+
<i class="fas fa-user-circle"></i>
|
459 |
+
</div>
|
460 |
+
</header>
|
461 |
+
|
462 |
+
<main>
|
463 |
+
<div class="video-container">
|
464 |
+
<div class="video-player">
|
465 |
+
<style> #video-element { width: 100%; height: 100%;} </style>
|
466 |
+
<video id="video-element" controls>
|
467 |
+
<track src="" kind="subtitles" srclang="en" label="English" default>
|
468 |
+
</video>
|
469 |
+
</div>
|
470 |
+
|
471 |
+
|
472 |
+
|
473 |
+
<script>document.addEventListener("DOMContentLoaded", function () {
|
474 |
+
// Function to decrypt the link
|
475 |
+
const decryptLink = (encryptedLink, key) => {
|
476 |
+
try {
|
477 |
+
// Decode base64
|
478 |
+
const decoded = atob(encryptedLink);
|
479 |
+
// XOR decrypt
|
480 |
+
const decrypted = decoded.split('').map((char, i) => {
|
481 |
+
return String.fromCharCode(char.charCodeAt(0) ^ key.charCodeAt(i % key.length));
|
482 |
+
}).join('');
|
483 |
+
return decrypted;
|
484 |
+
} catch (error) {
|
485 |
+
console.error("Decryption error:", error);
|
486 |
+
return null;
|
487 |
+
}
|
488 |
+
};
|
489 |
+
|
490 |
+
// Get the URL fragment after the first '#'
|
491 |
+
const urlHash = window.location.hash;
|
492 |
+
if (!urlHash) {
|
493 |
+
console.error("No hash found in the URL");
|
494 |
+
window.location.href = "index.html";
|
495 |
+
return;
|
496 |
+
}
|
497 |
+
|
498 |
+
const encryptedLink = urlHash.substring(1); // Remove the '#' and get the rest
|
499 |
+
if (!encryptedLink) {
|
500 |
+
console.error("No encrypted link found in the URL");
|
501 |
+
return;
|
502 |
+
}
|
503 |
+
|
504 |
+
// Decrypt the encrypted part of the URL
|
505 |
+
const jsonUrl = decryptLink(encryptedLink, 'JesusIsGod');
|
506 |
+
if (!jsonUrl) {
|
507 |
+
console.error("Failed to decrypt URL");
|
508 |
+
return;
|
509 |
+
}
|
510 |
+
|
511 |
+
// Store the decrypted URL
|
512 |
+
localStorage.setItem("video_to_watch", jsonUrl);
|
513 |
+
|
514 |
+
// Fetch the JSON data from the decrypted URL
|
515 |
+
fetch(jsonUrl)
|
516 |
+
.then(response => {
|
517 |
+
if (!response.ok) {
|
518 |
+
throw new Error(`HTTP error! status: ${response.status}`);
|
519 |
+
}
|
520 |
+
return response.json();
|
521 |
+
})
|
522 |
+
.then(data => {
|
523 |
+
|
524 |
+
|
525 |
+
|
526 |
+
// Update the page with the scraped JSON data
|
527 |
+
document.getElementById("video-title").innerText = data.title;
|
528 |
+
const date = new Date(data.uploadTimestamp);
|
529 |
+
document.getElementById("view-count").innerText = `Uploaded on ${date.toLocaleString('en-US', { month: 'long' })} ${date.getDate()}, ${date.getFullYear()} at ${date.toLocaleTimeString()}`;
|
530 |
+
|
531 |
+
document.getElementById("channel-name").innerText = data.uploader;
|
532 |
+
document.getElementById("video-description").innerText = data.description;
|
533 |
+
|
534 |
+
// Set the document title
|
535 |
+
document.title = data.title + " - HuggingTube";
|
536 |
+
|
537 |
+
// Define base URLs for global resources
|
538 |
+
const videoBaseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/resolve/main/';
|
539 |
+
const subtitleBaseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/';
|
540 |
+
|
541 |
+
// Update the video source
|
542 |
+
const videoElement = document.getElementById("video-element");
|
543 |
+
if (videoElement) {
|
544 |
+
const videoUrl = `${videoBaseUrl}${data.fileLocation}`;
|
545 |
+
const subtitleUrl = data.subtitleLocation ? `${subtitleBaseUrl}${data.subtitleLocation}` : '';
|
546 |
+
|
547 |
+
|
548 |
+
|
549 |
+
videoElement.src = videoUrl;
|
550 |
+
|
551 |
+
// Handle subtitles
|
552 |
+
if (subtitleUrl) {
|
553 |
+
fetch(subtitleUrl)
|
554 |
+
.then(response => {
|
555 |
+
if (!response.ok) {
|
556 |
+
throw new Error(`Failed to fetch subtitles: ${response.statusText}`);
|
557 |
+
}
|
558 |
+
return response.text();
|
559 |
+
})
|
560 |
+
.then(subtitleText => {
|
561 |
+
const blob = new Blob([subtitleText], { type: 'text/vtt' });
|
562 |
+
const blobUrl = URL.createObjectURL(blob);
|
563 |
+
|
564 |
+
const trackElement = videoElement.querySelector('track');
|
565 |
+
trackElement.src = blobUrl;
|
566 |
+
trackElement.default = true;
|
567 |
+
trackElement.srclang = "en";
|
568 |
+
trackElement.label = "English";
|
569 |
+
|
570 |
+
console.log("Subtitles successfully loaded.");
|
571 |
+
})
|
572 |
+
.catch(error => {
|
573 |
+
console.error("Error fetching or loading subtitles:", error);
|
574 |
+
});
|
575 |
+
}
|
576 |
+
|
577 |
+
// Add video event listeners
|
578 |
+
videoElement.addEventListener('error', function(e) {
|
579 |
+
console.error("Video error:", e);
|
580 |
+
});
|
581 |
+
|
582 |
+
videoElement.addEventListener('loadedmetadata', function() {
|
583 |
+
console.log("Video metadata loaded successfully");
|
584 |
+
});
|
585 |
+
} else {
|
586 |
+
console.error("Video element not found in the DOM");
|
587 |
+
}
|
588 |
+
})
|
589 |
+
.catch(error => {
|
590 |
+
console.error("Error fetching or parsing the JSON data:", error);
|
591 |
+
});
|
592 |
+
|
593 |
+
// Download functionality
|
594 |
+
document.getElementById("download-button").addEventListener("click", function() {
|
595 |
+
const videoElement = document.getElementById("video-element");
|
596 |
+
const videoUrl = videoElement.src;
|
597 |
+
const fileName = videoUrl.split('/').pop().split('?')[0];
|
598 |
+
console.log("Downloading video:", fileName);
|
599 |
+
|
600 |
+
const link = document.createElement('a');
|
601 |
+
link.href = videoUrl;
|
602 |
+
link.setAttribute('download', fileName);
|
603 |
+
link.style.display = 'none';
|
604 |
+
document.body.appendChild(link);
|
605 |
+
link.click();
|
606 |
+
document.body.removeChild(link);
|
607 |
+
});
|
608 |
+
|
609 |
+
// Video playback control
|
610 |
+
let videoElement = document.getElementById("video-element");
|
611 |
+
let pausePlayVideoTimeout = null;
|
612 |
+
let spacePressed = false;
|
613 |
+
|
614 |
+
function pausePlayVideo(event) {
|
615 |
+
if (event.code === 'Space' && !spacePressed) {
|
616 |
+
spacePressed = true;
|
617 |
+
if (pausePlayVideoTimeout === null) {
|
618 |
+
pausePlayVideoTimeout = setTimeout(function() {
|
619 |
+
pausePlayVideoTimeout = null;
|
620 |
+
}, 100);
|
621 |
+
videoElement.paused ? videoElement.play() : videoElement.pause();
|
622 |
+
}
|
623 |
+
}
|
624 |
+
}
|
625 |
+
|
626 |
+
function resetSpacePressed(event) {
|
627 |
+
if (event.code === 'Space') {
|
628 |
+
spacePressed = false;
|
629 |
+
}
|
630 |
+
}
|
631 |
+
|
632 |
+
// Event listeners
|
633 |
+
document.addEventListener('keydown', pausePlayVideo);
|
634 |
+
document.addEventListener('keyup', resetSpacePressed);
|
635 |
+
|
636 |
+
// Prevent default behaviors
|
637 |
+
window.addEventListener("keydown", function(e) {
|
638 |
+
if ((e.key === " " || e.key === "ArrowUp" || e.key === "ArrowDown" || "Tab") && e.target === document.body) {
|
639 |
+
e.preventDefault();
|
640 |
+
}
|
641 |
+
});
|
642 |
+
|
643 |
+
window.addEventListener("focus", function(e) {
|
644 |
+
if (e.target === document.body) {
|
645 |
+
document.activeElement.blur();
|
646 |
+
}
|
647 |
+
}, true);
|
648 |
+
});
|
649 |
+
</script>
|
650 |
+
|
651 |
+
<div class="video-info">
|
652 |
+
<h1 class="video-title" id="video-title">Loading...</h1>
|
653 |
+
<div class="video-stats">
|
654 |
+
<span class="view-count" id="view-count">Loading...</span>
|
655 |
+
<!-- Share Video Container -->
|
656 |
+
<div class="shareVideo" id="shareVideoContainer" style="display: none;">
|
657 |
+
<div class="shareVideoHeader">
|
658 |
+
<div>Share this video! <div class="closeButton" onclick="closeShareVideo()">×</div> </div>
|
659 |
+
|
660 |
+
</div>
|
661 |
+
<div class="shareVideoContent">
|
662 |
+
<!-- URL Copy Section -->
|
663 |
+
<div class="urlSection">
|
664 |
+
<input id="urlInput" type="text" readonly />
|
665 |
+
<button onclick="copyURL()" class="copyButton">Copy</button>
|
666 |
+
</div>
|
667 |
+
</div>
|
668 |
+
<p id="message" class="message"></p>
|
669 |
+
</div>
|
670 |
+
|
671 |
+
<!-- HTML Elements -->
|
672 |
+
<div class="video-actions">
|
673 |
+
|
674 |
+
<button class="action-button" id="download-button">
|
675 |
+
<i class="fas fa-download"></i> Download
|
676 |
+
</button>
|
677 |
+
</div>
|
678 |
+
|
679 |
+
|
680 |
+
|
681 |
+
|
682 |
+
|
683 |
+
|
684 |
+
|
685 |
+
</div>
|
686 |
+
</div>
|
687 |
+
|
688 |
+
|
689 |
+
|
690 |
+
<div class="video-page-container">
|
691 |
+
<div class="main-content">
|
692 |
+
<div class="channel-info">
|
693 |
+
<div class="channel-avatar" style="align-items: center;"></div>
|
694 |
+
<div class="channel-details">
|
695 |
+
<span class="channel-name" id="channel-name">Loading...</span>
|
696 |
+
</div>
|
697 |
+
</div>
|
698 |
+
|
699 |
+
<div class="video-description" id="video-description">
|
700 |
+
Loading description...
|
701 |
+
</div>
|
702 |
+
</div>
|
703 |
+
</div>
|
704 |
+
</div>
|
705 |
+
|
706 |
+
<aside class="recommendations">
|
707 |
+
<div class="recommendation-skeleton">
|
708 |
+
<div class="thumbnail-skeleton"></div>
|
709 |
+
<div class="info-skeleton">
|
710 |
+
<div class="title-skeleton"></div>
|
711 |
+
<div class="meta-skeleton"></div>
|
712 |
+
</div>
|
713 |
+
</div>
|
714 |
+
</aside>
|
715 |
+
</div>
|
716 |
+
|
717 |
+
<script>
|
718 |
+
async function fetchVideoMetadata() {
|
719 |
+
try {
|
720 |
+
const currentVideoUrl = localStorage.getItem("video_to_watch");
|
721 |
+
if (!currentVideoUrl) {
|
722 |
+
console.error("No current video URL found");
|
723 |
+
return;
|
724 |
+
}
|
725 |
+
|
726 |
+
const currentVideoResponse = await fetch(currentVideoUrl);
|
727 |
+
const currentVideo = await currentVideoResponse.json();
|
728 |
+
|
729 |
+
const response = await fetch('https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/video-index.json');
|
730 |
+
const videoIndexData = await response.json();
|
731 |
+
|
732 |
+
const baseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/metadata/';
|
733 |
+
const thumbnailBaseUrl = 'https://huggingface.co/spaces/vericudebuget/ok4231/raw/main/thumbnails/';
|
734 |
+
|
735 |
+
const calculateRelevanceScore = (videoData, currentVideo) => {
|
736 |
+
let score = 0;
|
737 |
+
if (videoData.uploader === currentVideo.uploader) score += 5;
|
738 |
+
|
739 |
+
const currentWords = currentVideo.title.toLowerCase().split(' ');
|
740 |
+
const videoWords = videoData.title.toLowerCase().split(' ');
|
741 |
+
const commonWords = currentWords.filter(word => videoWords.includes(word));
|
742 |
+
score += commonWords.length;
|
743 |
+
|
744 |
+
const currentDesc = currentVideo.description.toLowerCase().split(' ');
|
745 |
+
const videoDesc = videoData.description.toLowerCase().split(' ');
|
746 |
+
const commonDesc = currentDesc.filter(word => videoDesc.includes(word));
|
747 |
+
score += commonDesc.length * 0.5;
|
748 |
+
|
749 |
+
const timeDiff = Math.abs(new Date(videoData.uploadTimestamp) - new Date(currentVideo.uploadTimestamp));
|
750 |
+
const daysDiff = timeDiff / (1000 * 60 * 60 * 24);
|
751 |
+
score += Math.max(0, 2 - (daysDiff / 30));
|
752 |
+
|
753 |
+
return score;
|
754 |
+
};
|
755 |
+
|
756 |
+
const encryptLink = (link, key) => {
|
757 |
+
const encrypted = link.split('').map((char, i) => {
|
758 |
+
return String.fromCharCode(char.charCodeAt(0) ^ key.charCodeAt(i % key.length));
|
759 |
+
}).join('');
|
760 |
+
return btoa(encrypted);
|
761 |
+
};
|
762 |
+
|
763 |
+
const formatDuration = (duration) => {
|
764 |
+
if (duration === null || duration === undefined) return 'N/A';
|
765 |
+
const minutes = Math.floor(duration / 60);
|
766 |
+
const seconds = duration % 60;
|
767 |
+
return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
768 |
+
};
|
769 |
+
|
770 |
+
const recommendationsContainer = document.querySelector('.recommendations');
|
771 |
+
recommendationsContainer.innerHTML = '';
|
772 |
+
|
773 |
+
// Store recommendations for sorting
|
774 |
+
let recommendations = [];
|
775 |
+
|
776 |
+
// Process videos and store them
|
777 |
+
for (let videoIndex of videoIndexData) {
|
778 |
+
let fileName = videoIndex.url.substring(videoIndex.url.lastIndexOf('/') + 1);
|
779 |
+
let finalUrl = baseUrl + encodeURIComponent(fileName);
|
780 |
+
|
781 |
+
try {
|
782 |
+
const videoResponse = await fetch(finalUrl);
|
783 |
+
const videoData = await videoResponse.json();
|
784 |
+
|
785 |
+
if (finalUrl === currentVideoUrl) continue;
|
786 |
+
|
787 |
+
const relevanceScore = calculateRelevanceScore(videoData, currentVideo);
|
788 |
+
const thumbnailUrl = thumbnailBaseUrl + encodeURIComponent(
|
789 |
+
videoData.thumbnailLocation.substring(videoData.thumbnailLocation.lastIndexOf('/') + 1)
|
790 |
+
);
|
791 |
+
|
792 |
+
recommendations.push({
|
793 |
+
...videoData,
|
794 |
+
relevanceScore,
|
795 |
+
finalUrl,
|
796 |
+
thumbnailUrl
|
797 |
+
});
|
798 |
+
|
799 |
+
// Sort recommendations by relevance score
|
800 |
+
recommendations.sort((a, b) => b.relevanceScore - a.relevanceScore);
|
801 |
+
|
802 |
+
// Refresh the entire recommendations list
|
803 |
+
recommendationsContainer.innerHTML = '';
|
804 |
+
recommendations.forEach(video => {
|
805 |
+
const recommendationElement = document.createElement('div');
|
806 |
+
recommendationElement.classList.add('recommendation');
|
807 |
+
recommendationElement.innerHTML = `
|
808 |
+
<div class="thumbnail-container">
|
809 |
+
<img
|
810 |
+
src="${video.thumbnailUrl}"
|
811 |
+
alt="${video.title}"
|
812 |
+
class="thumbnail-image"
|
813 |
+
loading="lazy"
|
814 |
+
>
|
815 |
+
<span class="duration-overlay">${formatDuration(video.duration)}</span>
|
816 |
+
</div>
|
817 |
+
<div class="recommendation-info">
|
818 |
+
<h3 class="video-title-recommendation">${video.title}</h3>
|
819 |
+
<p class="uploader">${video.uploader}</p>
|
820 |
+
<p class="upload-date">${new Intl.DateTimeFormat('en-US', {
|
821 |
+
month: 'long',
|
822 |
+
day: 'numeric',
|
823 |
+
year: 'numeric'
|
824 |
+
}).format(new Date(video.uploadTimestamp))}</p>
|
825 |
+
</div>
|
826 |
+
`;
|
827 |
+
|
828 |
+
recommendationElement.addEventListener('click', () => {
|
829 |
+
const encryptedLink = encryptLink(video.finalUrl, 'JesusIsGod');
|
830 |
+
window.location.href = `video-player.html#${encryptedLink}`;
|
831 |
+
setTimeout(() => window.location.reload(), 30);
|
832 |
+
});
|
833 |
+
|
834 |
+
recommendationsContainer.appendChild(recommendationElement);
|
835 |
+
});
|
836 |
+
} catch (error) {
|
837 |
+
console.error(`Error fetching video metadata for ${fileName}:`, error);
|
838 |
+
}
|
839 |
+
}
|
840 |
+
|
841 |
+
} catch (error) {
|
842 |
+
console.error('Error fetching video metadata:', error);
|
843 |
+
}
|
844 |
+
}
|
845 |
+
|
846 |
+
// Call the function on page load
|
847 |
+
window.onload = fetchVideoMetadata;
|
848 |
+
</script>
|
849 |
+
|
850 |
+
<style>
|
851 |
+
/* Layout containers */
|
852 |
+
.video-page-container {
|
853 |
+
display: flex;
|
854 |
+
gap: 24px;
|
855 |
+
max-width: 1800px;
|
856 |
+
margin: 0 auto;
|
857 |
+
padding: 16px;
|
858 |
+
padding-bottom: 50px;
|
859 |
+
overflow: hidden;
|
860 |
+
}
|
861 |
+
|
862 |
+
.main-content {
|
863 |
+
flex: 1;
|
864 |
+
min-width: 0;
|
865 |
+
display: flex;
|
866 |
+
flex-direction: column;
|
867 |
+
}
|
868 |
+
|
869 |
+
.recommendations {
|
870 |
+
width: 400px;
|
871 |
+
flex-shrink: 0;
|
872 |
+
height: 100vh;
|
873 |
+
overflow-y: scroll;
|
874 |
+
padding: 0 8px;
|
875 |
+
scrollbar-width: none; /* Firefox */
|
876 |
+
-ms-overflow-style: none; /* IE and Edge */
|
877 |
+
}
|
878 |
+
|
879 |
+
/* Hide scrollbar for Chrome, Safari and Opera */
|
880 |
+
.recommendations::-webkit-scrollbar {
|
881 |
+
display: none;
|
882 |
+
}
|
883 |
+
|
884 |
+
/* Recommendation styles */
|
885 |
+
.recommendation {
|
886 |
+
display: flex;
|
887 |
+
gap: 12px;
|
888 |
+
cursor: pointer;
|
889 |
+
transition: background-color 0.2s;
|
890 |
+
padding: 8px;
|
891 |
+
border-radius: 8px;
|
892 |
+
margin-bottom: 8px;
|
893 |
+
}
|
894 |
+
|
895 |
+
.recommendation:hover {
|
896 |
+
background-color: rgba(0, 0, 0, 0.05);
|
897 |
+
}
|
898 |
+
|
899 |
+
.thumbnail-container {
|
900 |
+
position: relative;
|
901 |
+
width: 160px;
|
902 |
+
height: 90px;
|
903 |
+
overflow: hidden;
|
904 |
+
border-radius: 8px;
|
905 |
+
flex-shrink: 0;
|
906 |
+
}
|
907 |
+
|
908 |
+
.thumbnail-image {
|
909 |
+
width: 100%;
|
910 |
+
height: 100%;
|
911 |
+
object-fit: cover;
|
912 |
+
}
|
913 |
+
|
914 |
+
.duration-overlay {
|
915 |
+
position: absolute;
|
916 |
+
top: 4px;
|
917 |
+
right: 4px;
|
918 |
+
background-color: rgba(0, 0, 0, 0.8);
|
919 |
+
color: white;
|
920 |
+
padding: 2px 4px;
|
921 |
+
border-radius: 4px;
|
922 |
+
font-size: 12px;
|
923 |
+
font-weight: 500;
|
924 |
+
}
|
925 |
+
|
926 |
+
.recommendation-info {
|
927 |
+
flex: 1;
|
928 |
+
min-width: 0;
|
929 |
+
}
|
930 |
+
|
931 |
+
.video-title-recommendation {
|
932 |
+
font-size: 14px;
|
933 |
+
font-weight: 500;
|
934 |
+
margin: 0 0 4px 0;
|
935 |
+
display: -webkit-box;
|
936 |
+
-webkit-line-clamp: 2;
|
937 |
+
-webkit-box-orient: vertical;
|
938 |
+
overflow: hidden;
|
939 |
+
}
|
940 |
+
|
941 |
+
.uploader {
|
942 |
+
font-size: 12px;
|
943 |
+
color: #606060;
|
944 |
+
margin: 0 0 2px 0;
|
945 |
+
}
|
946 |
+
|
947 |
+
.upload-date {
|
948 |
+
font-size: 12px;
|
949 |
+
color: #606060;
|
950 |
+
margin: 0;
|
951 |
+
}
|
952 |
+
|
953 |
+
/* Loading skeleton styles */
|
954 |
+
.recommendation-skeleton {
|
955 |
+
display: flex;
|
956 |
+
gap: 12px;
|
957 |
+
padding: 8px;
|
958 |
+
}
|
959 |
+
|
960 |
+
.thumbnail-skeleton {
|
961 |
+
width: 160px;
|
962 |
+
height: 90px;
|
963 |
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
964 |
+
background-size: 200% 100%;
|
965 |
+
animation: loading 1.5s infinite;
|
966 |
+
border-radius: 8px;
|
967 |
+
}
|
968 |
+
|
969 |
+
.info-skeleton {
|
970 |
+
flex: 1;
|
971 |
+
}
|
972 |
+
|
973 |
+
.title-skeleton {
|
974 |
+
height: 16px;
|
975 |
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
976 |
+
background-size: 200% 100%;
|
977 |
+
animation: loading 1.5s infinite;
|
978 |
+
margin-bottom: 8px;
|
979 |
+
border-radius: 4px;
|
980 |
+
}
|
981 |
+
|
982 |
+
.meta-skeleton {
|
983 |
+
height: 12px;
|
984 |
+
width: 60%;
|
985 |
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
986 |
+
background-size: 200% 100%;
|
987 |
+
animation: loading 1.5s infinite;
|
988 |
+
border-radius: 4px;
|
989 |
+
}
|
990 |
+
|
991 |
+
@keyframes loading {
|
992 |
+
0% { background-position: 200% 0; }
|
993 |
+
100% { background-position: -200% 0; }
|
994 |
+
}
|
995 |
+
|
996 |
+
/* Mobile styles (YouTube-like) */
|
997 |
+
@media (max-width: 1020px) {
|
998 |
+
.video-page-container {
|
999 |
+
flex-direction: column;
|
1000 |
+
height: auto;
|
1001 |
+
overflow: visible;
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
.recommendations {
|
1005 |
+
width: 100%;
|
1006 |
+
height: auto;
|
1007 |
+
padding: 0;
|
1008 |
+
overflow-y: visible;
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
.recommendation {
|
1012 |
+
padding: 12px 0;
|
1013 |
+
margin: 0;
|
1014 |
+
border-radius: 0;
|
1015 |
+
border-bottom: 1px solid #e5e5e5;
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
.thumbnail-container {
|
1019 |
+
width: 140px;
|
1020 |
+
height: 80px;
|
1021 |
+
}
|
1022 |
+
|
1023 |
+
.video-title-recommendation {
|
1024 |
+
font-size: 16px;
|
1025 |
+
-webkit-line-clamp: 2;
|
1026 |
+
}
|
1027 |
+
|
1028 |
+
.uploader, .upload-date {
|
1029 |
+
font-size: 14px;
|
1030 |
+
}
|
1031 |
+
}
|
1032 |
+
|
1033 |
+
/* Mobile styles (smaller screens) */
|
1034 |
+
@media (max-width: 640px) {
|
1035 |
+
.video-page-container {
|
1036 |
+
padding: 0;
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
.recommendation {
|
1040 |
+
padding: 8px;
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
.thumbnail-container {
|
1044 |
+
width: 120px;
|
1045 |
+
height: 68px;
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
.video-title-recommendation {
|
1049 |
+
font-size: 14px;
|
1050 |
+
}
|
1051 |
+
|
1052 |
+
.uploader, .upload-date {
|
1053 |
+
font-size: 12px;
|
1054 |
+
}
|
1055 |
+
}
|
1056 |
+
</style>
|
1057 |
+
<style>
|
1058 |
+
.subtitle {
|
1059 |
+
display: flex;
|
1060 |
+
background-color: rgb(0, 72, 85);
|
1061 |
+
border-radius: 5px;
|
1062 |
+
width: fit-content;
|
1063 |
+
padding: 1px 5px;
|
1064 |
+
align-items: center;
|
1065 |
+
transform-origin: left bottom;
|
1066 |
+
transform: scale(80%);
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
.subtitle_icon {
|
1070 |
+
width: auto;
|
1071 |
+
height: 1em;
|
1072 |
+
margin-right: 5px;
|
1073 |
+
}
|
1074 |
+
|
1075 |
+
.subtitle_content {
|
1076 |
+
filter: invert(100%);
|
1077 |
+
display: flex;
|
1078 |
+
align-items: center;
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
.subtitle_text {
|
1082 |
+
align-self: center;
|
1083 |
+
text-align: center;
|
1084 |
+
color: #000000;
|
1085 |
+
}
|
1086 |
+
</style>
|
1087 |
+
<script>window.onpopstate = function(event) {
|
1088 |
+
location.reload();
|
1089 |
+
};
|
1090 |
+
</script>
|
1091 |
+
|
1092 |
+
|
1093 |
+
</aside>
|
1094 |
+
</main>
|
1095 |
+
</body>
|
1096 |
+
</html>
|