diff --git a/script.js b/script.js index 8bc98d5..f99177a 100644 --- a/script.js +++ b/script.js @@ -3,11 +3,7 @@ function generateHtml() { 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 + document.querySelector("#youtube").value ) { let castopod_url; let peertube_id; @@ -16,19 +12,20 @@ function generateHtml() { .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."); + 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); } 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 (!peertube_id) { - throw new Error("Incorrect PeerTube URL format! Please paste the correct URL."); + + 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); @@ -154,7 +151,7 @@ function generateHtml() { html += `
diff --git a/style.css b/style.css index 5760b6e..bac636c 100644 --- a/style.css +++ b/style.css @@ -85,6 +85,7 @@ button { } .preview { + width: 700px; padding: 1rem; border: 1px solid #5e636e; }