Hello,
If you use the code below along with Allow CORS extension, you will be able to stream any Skillcapped video for free. This works as of October 2023.
Remember to trim the URL like this:
/browse/course/zclxzmzcqk/yzxbkhhjw6
to:
/browse/course/zclxzmzcqk
Hopefully this saves everyone a bit of cash.
If you use the code below along with Allow CORS extension, you will be able to stream any Skillcapped video for free. This works as of October 2023.
Remember to trim the URL like this:
/browse/course/zclxzmzcqk/yzxbkhhjw6
to:
/browse/course/zclxzmzcqk
Hopefully this saves everyone a bit of cash.
HTML:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SkillUncapped</title>
</head>
<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>
<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;
if (Hls.isSupported()) {
var hlsjsConfig = {
"maxBufferSize": 0,
"maxBufferLength": 30,
"startPosition": 0
}
hls = new Hls(hlsjsConfig);
hls.on(Hls.Events.MANIFEST_PARSED, function () {
video.play();
});
}
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 final part...");
let last = 0;
let jump = true;
for (let i=300;i<=1000; i++) {
if (i==1000) {
alert("error finding 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 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);
}
</script>
</body>
</html>