function getCastopodURL() { let castopod_url; 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. Example: https://podcast.internet-czas-dzialac.pl/@icd/episodes/icd-weekend-6-stara-myszka-mickey-nowy-prezes-uodo-i-sony-psujace-sylwestra" ); } } catch (error) { alert(error); } return castopod_url; } function getPeertubeID() { let peertube_id; try { const regex = /^https:\/\/video\.internet-czas-dzialac\.pl\/w\/[a-zA-Z0-9]{22,}$/; peertube_id = document.querySelector("#peertube").value.split("/w/")[1]; if ( !regex.test(document.querySelector("#peertube").value) || !peertube_id ) { throw new Error( "Incorrect PeerTube URL format! Please paste the correct URL. Example: https://video.internet-czas-dzialac.pl/w/nTgqnY7FJLQzNYfD9xtcSy" ); } } catch (error) { alert(error); } return peertube_id; } function makeCastopodPlayer(castopod_url) { return /* HTML */ `