Files
camila/test_proxy.js
T

18 lines
549 B
JavaScript

const axios = require('axios');
async function test() {
try {
const res = await axios.get('https://api.allorigins.win/raw?url=' + encodeURIComponent('https://www.youtube.com/watch?v=0g7qSGQIoxw'));
const html = res.data;
const match = html.match(/"captionTracks":(\[.*?\])/);
if (match) {
console.log("ACHOU CAPTIONS!");
console.log(match[1].substring(0, 500));
} else {
console.log("NÃO ACHOU CAPTIONS NO HTML PROXY");
}
} catch (err) {
console.error("Erro no proxy:", err.message);
}
}
test();