Advertisement
mel2000

Create YT Link from URLs List

Feb 14th, 2025 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Create YT Playlist Link from URLs List</title>
  6. <script type="text/javascript">
  7. function replaceFunction() {
  8. var output = document.getElementById("urlList").value;
  9. if (output != "") {
  10. output = output.replaceAll("https://www.youtube.com/watch?v=", ""); // isolate ID strings
  11. output = output.replace(/\s+/g, ","); // substitute space(s) for comma
  12. output = document.querySelector('input[name="URLtype"]:checked').value + output;
  13. document.getElementById("output").innerHTML = output;
  14. }
  15. }
  16. </script>
  17. <script type="text/javascript">
  18. function resetFunction() {
  19. document.getElementById("urlList").value=null;
  20. document.getElementById("output").innerHTML=null;
  21. document.getElementById("Mobile").checked = true;
  22. }
  23. </script>
  24. </head>
  25.  
  26. <body>
  27. <h2>Create YT Playlist Link from URLs List</h2>
  28. <textarea rows='7' cols='50' id='urlList'></textarea><br><br>
  29. Select a YouTube device:<br>
  30. <input type="radio" id="Mobile" name="URLtype" value="https://m.youtube.com/watch_videos?video_ids=" checked>Mobile: https://m.youtube.com/watch_videos?video_ids=</input><br>
  31. <input type="radio" id="PC" name="URLtype" value="https://www.youtube.com/watch_videos?video_ids=">PC: https://www.youtube.com/watch_videos?video_ids=</input><br><br>
  32. <input type='button' value='Create' onclick='replaceFunction()'/>&nbsp;&nbsp;<input type="button" value="Reset" onClick='resetFunction()'/>
  33. <br><br>
  34. <div id="output"></div>
  35.  
  36. </body>
  37. </html>
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement