Первоначальный источник https://vk.com/video-71893149_636242344
у меня есть эта функция, но не работает
потому что у видео есть ключ "extra". любая помощь
function findServer(video){
const crazycloud = ['13-2','14-2','15-2','16-2','17-2','20-2','13-1','14-1','15-1','16-1','17-1','20-1','13-3','16-3','17-3','20-3','13-4','16-4','13-5','13-6'];
const daxab = ['11-1','11-2','11-3','11-4','12-1','12-4','12-5','19-1','19-2','21-1','21-2','25-1','25-2','27-1','27-2','29-1','36-1','36-2','38-1','38-2','38-3','43-1','45-1','46-1','47-1','48-1','49-1','49-2','49-3','49-4','49-5','49-6','49-7','50-1','51-1','52-1','53-1','54-1','55-1','56-1','57-1','58-1','59-1','60-1'];
crazycloud.forEach(el=>{
let server = '//psv' + el + '.crazycloud.ru/videos/';
console.log(server + video );
let xhr = new XMLHttpRequest();
xhr.open('GET',server + video, true);
if (xhr.status === 200) {
return server + video
}
});
daxab.forEach(el=>{
let server = 'http://psv' + el + '.daxab.com/videos/';
console.log(server + video );
let xhr = new XMLHttpRequest();
xhr.open('GET',server + video, true);
if (xhr.status === 200) {
return server + video
}
});
return 'not found'
}
console.log( findServer('-71893149/636242344/720.mp4') );
фактическое видео - https://psv20-3.crazycloud.ru/videos/-71893149/636242344/720.mp4?extra=iY2osxqXIhW8XJNARw0gRg
или же https://psv27-1.daxab.com/videos/-71893149/636242344/720.mp4?extra=iY2osxqXIhW8XJNARw0gRg
return server + video- написано в цикле, результат никуда не возвращается. По ссылкамhttps://psv20-3.crazycloud.ru/videos/-71893149/636242344/720.mp4?extra=iY2osxqXIhW8XJNARw0gRgничего нет. – Stepan Kasyanenko Sep 20 '19 at 07:09