dataDiv.innerHTML+=`<div style="display: flex; gap: 12px;"><img src="/static/loading.gif" width="25" height="25" /> Loading could take up to 30 seconds.</div>`;
fetch(`api/v4/youtube/${vid}`)
fetch(`api/v4/youtube/${vid}?stream`)
.then((response)=>{
if (response.status===410||response.status===404){
dataDiv.innerHTML=`<span style="color: red;">API version is not supported - this should never happen</span>`;
@@ -63,45 +104,82 @@ function finish(vid1) {
dataDiv.innerHTML=`<span style="color: red;">You have been rate limited - please slow down</span>`;
i.querySelector(".result").innerHTML='<span class="white">Error</span><br />A connection error occured while receiving data. Please try again; if it persists, contact me (details are at the bottom of "How do I use this?") and provide console output and a way to reproduce if possible.';
dataDiv.innerHTML='<span class="red" style="background-color: #FFFFFF;">An error occurred, check your internet connection</span>';
dataDiv.innerHTML='<span class="red" style="background-color: #fff;">An error occurred, check your internet connection</span>';
throw (e);
})
.finally(()=>{
@@ -120,6 +198,6 @@ function finishWrpa(data) {
returnfinish(data);
}catch (err){
console.error(err)
dataDiv.innerHTML="<span class='red'>This should be unreachable. Please report this issue and provide a way to reproduce.</span>";
dataDiv.innerHTML="<span class='red'>An unknown error occured. Please report this. If possible, provide console output and a way of reproducing.</span>";