when I click stream it says "invalid url"
can u please share the code?Quote:
tinkering around with the html codes a little bit with ChatGPT and I manage to add a working download button, just ask ChatGPT bruh
1.add the extension, and enable it I guess.Quote:
Still confused on this, anyone that can guide through pictures or something? :D Thanks
I tried to mess with chatgpt and all it did was adding a download button but it's not actually working.Quote:
tinkering around with the html codes a little bit with ChatGPT and I manage to add a working download button, just ask ChatGPT bruh
Quote:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SkillUncapped</title>
</head>
<body>
<label>url: </label>
<input onkeyup="if (event.key =='Enter') stream()" style="width: 300px;" id="url" placeholder="https://www.skill-capped.com/lol/commentaries/p1qcnwqt75" />
<button style="width: 80px;" onclick="stream()">Stream</button>
<button style="width: 120px;" onclick="download()">Download</button>
<label style="display: block;" id="status"></label>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<video style="display: block; margin-top: 10px;" height="720" width="1280" id="video" controls autoplay crossorigin="anonymous" />
<script>
var hls = null;
var videoSourceUrls = [];
if (Hls.isSupported()) {
var hlsjsConfig = {
"maxBufferSize": 0,
"maxBufferLength": 30,
"startPosition": 0
}
hls = new Hls(hlsjsConfig);
hls.on(Hls.Events.MANIFEST_PARSED, function () {
video.play();
videoSourceUrls = getVideoSourceUrls(hls.url);
});
}
const rgx = /([a-z0-9]{10})(:?\/|$)/g;
async function stream() {
if (hls == null) {
alert("HLS not supported, please use a modern browser such as Chrome");
return;
}
const rawUrl = document.getElementById("url").value;
let ids = [];
let match = null;
while (match = rgx.exec(rawUrl)) {
ids.push(match[1]);
}
if (ids.length < 1) {
alert("Invalid URL");
return;
}
const videoId = rawUrl.includes("browse3") ? ids[0] : ids[ids.length - 1];
let statusLabel = document.getElementById("status");
console.log(`Video ID is ${videoId}`);
console.log("Looking for the final part...");
let last = 0;
let jump = true;
for (let i = 300; i <= 1000; i++) {
if (i == 1000) {
alert("Error finding the last part");
return;
}
if (i == 0) i = 1;
const url = `https://d13z5uuzt1wkbz.cloudfront.net/${videoId}/HIDDEN4500-${String(i).padStart(5, "0")}.ts`;
console.log(`Testing ${url}`);
statusLabel.innerText = `Looking for the final part; Testing ${i}...`;
try {
const resp = await fetch(url, {method: 'HEAD'});
if (resp.status === 403) {
if (i >= 50 && i % 50 == 0 && jump) {
last = i;
jump = true;
i -= 51;
continue;
}
break;
}
last = i;
jump = false;
} catch(e) {
alert("Fetch failed, please install a Cross-Origin disabler extension for your browser or check your internet connectivity.");
return;
}
}
statusLabel.innerText = "";
let data = "#EXTM3U\n#EXT-X-PLAYLIST-TYPE:VOD\n#EXT-X-TARGETDURATION:10";
for (let i = 0; i <= last; i++) {
data += `#EXTINF:10,\nhttps://d13z5uuzt1wkbz.cloudfront.net/${videoId}/HIDDEN4500-${String(i).padStart(5, "0")}.ts\n`
}
console.log(data);
hls.loadSource(
"data:application/x-mpegURL;base64," + btoa(data)
);
hls.attachMedia(video);
videoSourceUrls = [];
for (let i = 0; i <= last; i++) {
videoSourceUrls.push(`https://d13z5uuzt1wkbz.cloudfront.net/${videoId}/HIDDEN4500-${String(i).padStart(5, "0")}.ts`);
}
}
async function download() {
if (videoSourceUrls.length === 0) {
alert("No video source available to download. Please start streaming first.");
return;
}
const a = document.createElement("a");
a.style.display = "none";
const blob = await downloadVideoSegments();
const url = URL.createObjectURL(blob);
a.href = url;
a.download = "video.ts";
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
}
async function downloadVideoSegments() {
const response = await Promise.all(videoSourceUrls.map((url) => fetch(url)));
const segments = await Promise.all(response.map((res) => res.arrayBuffer()));
return new Blob(segments, { type: "video/mp2t" });
}
</script>
</body>
</html>
how do you do this?Quote:
I tried using ChatGPT to download the video. Here is the code:
can you give more info about this?Quote:
use jdownloader, you can download videos straight from the web...
any videos, any sources, even netflix vids lol