deno gcp-europe-west3
tcp/443
deno gcp-europe-west2
tcp/443
Open service 2600:1901:0:6d85:::443 · stream.leandrodasilva.dev
2026-01-26 00:41
HTTP/1.1 200 OK
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
content-length: 4514
date: Mon, 26 Jan 2026 00:41:43 GMT
connection: close
via: http/1.1 edgeproxy-h
server: deno/gcp-europe-west3
Page title: DEMO: download parcial de vídeo
<!DOCTYPE html>
<html lang="pt_br">
<head>
<meta charset="UTF-8">
<style>
html, body {
width: 100vw;
height: 100vh;
font-family: sans-serif;
font-size: 16px;
}
body {
margin: 0;
padding: 0;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: start;
align-items: center;
}
button#download {
margin-top: 20px;
padding: 10px;
border: 1px solid #000;
background: #809fef;
cursor: pointer;
}
button#download:hover {
background: #6c8de7;
}
button#download:active {
background: #5a7bd0;
}
button#download:focus {
outline: none;
}
button#download:disabled {
background: #ccc;
cursor: not-allowed;
}
span#download-progress {
margin-top: 10px;
font-size: 12px;
}
</style>
<title>DEMO: download parcial de vídeo</title>
<script type="text/javascript">
function onLoad() {
var sec = parseInt(document.location.search.substr(1));
if (!isNaN(sec))
mainPlayer.currentTime = sec;
}
</script>
</head>
<body>
<h1>DEMO: download parcial de vídeo</h1>
<video
id="mainPlayer"
controls
autoplay
width="640"
height="360"
onloadedmetadata="onLoad()"
>
<source src="/video/Big Buck Bunny Demo.mp4" />
</video >
<h2>Pular reprodução</h2>
<ul>
<li><a href="/?60">Pular para 1:00</a></li>
<li><a href="/?120">Pular para 2:00</a></li>
</ul>
<button id="download" type="button">Download</button>
<span id="download-progress"></span>
<script>
const btnDownload = document.querySelector('#download');
const downloadProgress = document.querySelector('#download-progress');
if (btnDownload) {
btnDownload.addEventListener("click", async (event) => {
event.preventDefault();
btnDownload.disabled = true;
const headRequest = await fetch('/video/Big Buck Bunny Demo.mp4', {
method: 'HEAD'
});
const contentLength = headRequest.headers.get('content-length');
const contentRange = headRequest.headers.get('content-range');
const contentType = headRequest.headers.get('content-type');
const totalSize = parseInt(contentLength || contentRange.split('/')[1]);
console.log('Total size:', totalSize);
const chunckParts = 10;
const chunckSize = Math.ceil(totalSize / chunckParts);
console.log('Chunck size:', chunckSize);
const chunckRequests = [];
const failedRequests = [];
for (let i = 0; i < chunckParts; i++) {
const start = i * chunckSize;
let end = start + chunckSize - 1;
if (end >= totalSize)
end = totalSize - 1;
console.log('Chunck', i, 'start:', start, 'end:', end);
const request = fetch('/video/Big Buck Bunny Demo.mp4', {
headers: {
'Range': `bytes=${start}-${end}`
}
}).then(resp => {
const percent = Math.round((start / totalSize) * 100);
downloadProgress.innerHTML = `Baixando ${percent}%`;
return resp;
}).catch(err => {
console.error(err);
failedRequests.push(i);
})
chunckRequests.push(request);
}
let chunckResponses = await Promise.all(chunckRequests);
if (failedRequests.length > 0) {
for (const failedRequest of failedRequests) {
chunckResponses[failedRequest] = await chunckRequests[failedRequest];
}
}
downloadProgress.innerHTML = 'Juntando partes...';
const chunckBlobs = await Promise.all(
chunckResponses.map(response => response.blob())
);
downloadProgress.innerHTML = 'Criando arquivo...';
const blob = new Blob(chunckBlobs, { type: contentType });
if (blob.size !== totalSize) {
downloadProgress.innerHTML = 'Erro: tamanho do arquivo incorreto';
return;
Open service 34.120.54.55:443 · stream.leandrodasilva.dev
2026-01-26 00:41
HTTP/1.1 200 OK
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
content-length: 4514
date: Mon, 26 Jan 2026 00:41:43 GMT
connection: close
via: http/1.1 edgeproxy-h
server: deno/gcp-europe-west2
Page title: DEMO: download parcial de vídeo
<!DOCTYPE html>
<html lang="pt_br">
<head>
<meta charset="UTF-8">
<style>
html, body {
width: 100vw;
height: 100vh;
font-family: sans-serif;
font-size: 16px;
}
body {
margin: 0;
padding: 0;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: start;
align-items: center;
}
button#download {
margin-top: 20px;
padding: 10px;
border: 1px solid #000;
background: #809fef;
cursor: pointer;
}
button#download:hover {
background: #6c8de7;
}
button#download:active {
background: #5a7bd0;
}
button#download:focus {
outline: none;
}
button#download:disabled {
background: #ccc;
cursor: not-allowed;
}
span#download-progress {
margin-top: 10px;
font-size: 12px;
}
</style>
<title>DEMO: download parcial de vídeo</title>
<script type="text/javascript">
function onLoad() {
var sec = parseInt(document.location.search.substr(1));
if (!isNaN(sec))
mainPlayer.currentTime = sec;
}
</script>
</head>
<body>
<h1>DEMO: download parcial de vídeo</h1>
<video
id="mainPlayer"
controls
autoplay
width="640"
height="360"
onloadedmetadata="onLoad()"
>
<source src="/video/Big Buck Bunny Demo.mp4" />
</video >
<h2>Pular reprodução</h2>
<ul>
<li><a href="/?60">Pular para 1:00</a></li>
<li><a href="/?120">Pular para 2:00</a></li>
</ul>
<button id="download" type="button">Download</button>
<span id="download-progress"></span>
<script>
const btnDownload = document.querySelector('#download');
const downloadProgress = document.querySelector('#download-progress');
if (btnDownload) {
btnDownload.addEventListener("click", async (event) => {
event.preventDefault();
btnDownload.disabled = true;
const headRequest = await fetch('/video/Big Buck Bunny Demo.mp4', {
method: 'HEAD'
});
const contentLength = headRequest.headers.get('content-length');
const contentRange = headRequest.headers.get('content-range');
const contentType = headRequest.headers.get('content-type');
const totalSize = parseInt(contentLength || contentRange.split('/')[1]);
console.log('Total size:', totalSize);
const chunckParts = 10;
const chunckSize = Math.ceil(totalSize / chunckParts);
console.log('Chunck size:', chunckSize);
const chunckRequests = [];
const failedRequests = [];
for (let i = 0; i < chunckParts; i++) {
const start = i * chunckSize;
let end = start + chunckSize - 1;
if (end >= totalSize)
end = totalSize - 1;
console.log('Chunck', i, 'start:', start, 'end:', end);
const request = fetch('/video/Big Buck Bunny Demo.mp4', {
headers: {
'Range': `bytes=${start}-${end}`
}
}).then(resp => {
const percent = Math.round((start / totalSize) * 100);
downloadProgress.innerHTML = `Baixando ${percent}%`;
return resp;
}).catch(err => {
console.error(err);
failedRequests.push(i);
})
chunckRequests.push(request);
}
let chunckResponses = await Promise.all(chunckRequests);
if (failedRequests.length > 0) {
for (const failedRequest of failedRequests) {
chunckResponses[failedRequest] = await chunckRequests[failedRequest];
}
}
downloadProgress.innerHTML = 'Juntando partes...';
const chunckBlobs = await Promise.all(
chunckResponses.map(response => response.blob())
);
downloadProgress.innerHTML = 'Criando arquivo...';
const blob = new Blob(chunckBlobs, { type: contentType });
if (blob.size !== totalSize) {
downloadProgress.innerHTML = 'Erro: tamanho do arquivo incorreto';
return;
Open service 34.120.54.55:80 · stream.leandrodasilva.dev
2026-01-26 00:41
HTTP/1.1 307 Temporary Redirect Cache-Control: private Location: https://stream.leandrodasilva.dev:443/ Content-Length: 0 Date: Mon, 26 Jan 2026 00:42:12 GMT Content-Type: text/html; charset=UTF-8 Connection: close
Open service 2600:1901:0:6d85:::80 · stream.leandrodasilva.dev
2026-01-26 00:41
HTTP/1.1 307 Temporary Redirect Cache-Control: private Location: https://stream.leandrodasilva.dev:443/ Content-Length: 0 Date: Mon, 26 Jan 2026 00:42:12 GMT Content-Type: text/html; charset=UTF-8 Connection: close