Getting YouTube video title with shortcuts

Hi All!

In the past if I provided a YouTube URL to Shortcuts and used something like the following to get the page title (which is also the video name) so I could feed it in to Things 3:

However, in the last couple of weeks it has started returning ‘YouTube’ instead of the video name. Opening the URL in safari is fine and the page title is the video name.

Any ideas? Any workarounds. I mainly could in Python so I’m sure I could use Pythonista but seems a bit overkill.

Any input would be greatly received. Thanks.

If you look at the HTML it is returning (use rich text to HTML), you can see how much of the content is being generated and rendered on the fly, and therein lies the issue. If you look through the HTML, you can see where the real title is encoded in several places. Choose one and parse the HTML content (e.g. regex match) for the title.

Thanks! That got me started. I was able to pull together the following that extracted the title from the “on-the-fly” data of the page for anyone else interested.

Appreciate your gentle nudge in the right direction.