From d5b52131748c0d6237e72932a8c019990b526bdc Mon Sep 17 00:00:00 2001
From: Boof <97455552+hexahigh@users.noreply.github.com>
Date: Fri, 9 Jun 2023 10:12:29 +0200
Subject: [PATCH] a
---
.../old movies and videos/karius/index.html | 6 +-
.../old movies and videos/karius/torrent.js | 69 +++++++++++++++++++
2 files changed, 72 insertions(+), 3 deletions(-)
create mode 100644 other/nostalgia/old movies and videos/karius/torrent.js
diff --git a/other/nostalgia/old movies and videos/karius/index.html b/other/nostalgia/old movies and videos/karius/index.html
index 947f0de..ee8788a 100644
--- a/other/nostalgia/old movies and videos/karius/index.html
+++ b/other/nostalgia/old movies and videos/karius/index.html
@@ -12,9 +12,9 @@
diff --git a/other/nostalgia/old movies and videos/karius/torrent.js b/other/nostalgia/old movies and videos/karius/torrent.js
new file mode 100644
index 0000000..e5e29e0
--- /dev/null
+++ b/other/nostalgia/old movies and videos/karius/torrent.js
@@ -0,0 +1,69 @@
+const client = new WebTorrent()
+
+const magnetUri = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent'
+
+function mp4Vid() {
+ client.add(magnetUri, (torrent) => {
+ // Find the video file in the torrent's files
+ const videoFile = torrent.files.find((file) => file.name.endsWith('.mp4'));
+
+ // Create a blob URL from the video file
+ videoFile.getBlobURL((err, url) => {
+ if (err) throw err;
+
+ // Set the blob URL as the source for the video element
+ const source = document.getElementById('source1');
+ source.src = url;
+ source.type = "video/mp4";
+
+ // Load and play the video
+ const video = document.getElementById('video');
+ video.load();
+ video.play();
+ });
+ });
+}
+
+function webmVid() {
+ client.add(magnetUri, (torrent) => {
+ // Find the video file in the torrent's files
+ const videoFile = torrent.files.find((file) => file.name.endsWith('.webm'));
+
+ // Create a blob URL from the video file
+ videoFile.getBlobURL((err, url) => {
+ if (err) throw err;
+
+ // Set the blob URL as the source for the video element
+ const source = document.getElementById('source2');
+ source.src = url;
+ source.type = "video/webm";
+
+ // Load and play the video
+ const video = document.getElementById('video');
+ video.load();
+ video.play();
+ });
+ });
+}
+
+function oggVid() {
+ client.add(magnetUri, (torrent) => {
+ // Find the video file in the torrent's files
+ const videoFile = torrent.files.find((file) => file.name.endsWith('.ogv'));
+
+ // Create a blob URL from the video file
+ videoFile.getBlobURL((err, url) => {
+ if (err) throw err;
+
+ // Set the blob URL as the source for the video element
+ const source = document.getElementById('source3');
+ source.src = url;
+ source.type = "video/ogg";
+
+ // Load and play the video
+ const video = document.getElementById('video');
+ video.load();
+ video.play();
+ });
+ });
+}
\ No newline at end of file