Commit cb821f01 authored by Tomáš Hübelbauer's avatar Tomáš Hübelbauer

Add playlist URL generator tool

parent 23afeac4
# YouTube Playlist URL
**[Here's a tool for you!!](**
YouTube, for some reason, make it super hard in the UI to get a URL that leads
to a playlist without also containing a cursor video.
<!DOCTYPE html>
<meta charset="utf8" />
<title>YouTube Playlist URL</title>
window.addEventListener('load', () => {
const urlInput = document.getElementById('urlInput');
const urlCode = document.getElementById('urlCode');
const urlA = document.getElementById('urlA');
function go() {
try {
let url = new URL(urlInput.value);
url = '' + url.searchParams.get('list');
urlCode.textContent = url;
urlA.href = url;
} catch (error) {
urlCode.textContent = error;
urlA.href = null;
urlInput.addEventListener('input', go);
urlInput.addEventListener('change', go);
body { font-family: sans-serif; text-align: center; }
input { width: 90%; }
a { font-weight: bold; }
<h1>YouTube Playlist URL</h1>
<p>Past a YouTube video URL with playlist attached. E.g. <a href=""><code></code></a></p>
<input id="urlInput" value="" />
<p>Here's your shiny playlist-only URL:</p>
<a id="urlA"><code id="urlCode"></code></a>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment