function generateHtml() { if ( document.querySelector("#episode_name").value && document.querySelector("#castopod").value && document.querySelector("#peertube").value && document.querySelector("#youtube").value && document.querySelector("#castopod-player-visible").value && document.querySelector("#peertube-player-visible").value && document.querySelector("#audio-links-visible").value && document.querySelector("#video-links-visible").value ) { let castopod_url; let peertube_id; try { castopod_url = document .querySelector("#castopod").value; const regex = /^https:\/\/podcast\.internet-czas-dzialac\.pl\/@icd\/episodes\//; if (!regex.test(castopod_url)) { throw new Error("Incorrect Castopod URL format! Please paste the correct URL."); } } catch (error) { alert(error); } try { peertube_id = document .querySelector("#peertube") .value.split("/w/")[1]; if (!peertube_id) { throw new Error("Incorrect PeerTube URL format! Please paste the correct URL."); } } catch (error) { alert(error); } let html = ""; if (document.querySelector("#castopod-player-visible").checked) { html += `