This shortcut uses a quick-and-dirty method of isolating the playlist ID from a YouTube URL by splitting around the URL parameters and leaving off anything after.
If no ID is found it will pop up an alert, but otherwise this works seamlessly in the background/inside another shortcut using Run Shortcut.