When you copy the URL for sharing in YouTube, it adds a query parameter now, so=blah
, for tracking the source. This removes that. It could of course be smarter and stop at either the end or the next parameter, but since I haven’t seen any extras, I just remove everything after.
This is great, thanks! I was about to build one of these. Now I’ll have to make a more complex one :-)
Ideas for my more complex version:
Use case:
Someone posts a YouTube URL and a YouTube shorts URL in a Lemmy comment, both with the tracking parameter. I copy the comment to clipboard and run the shortcut. My clipboard is populated with a clean YouTube URL, the second clean YouTube URL (instead of the initial shorts syntax), and a piped.video mirror of each link. It may prepend a comment like “Hey, Google snuck some trackers onto your links, so I used a little script on my phone to remove them for us:”
Tap to see the instructions a language model couldn’t follow when I tried the other day :)
Create an iOS shortcut that performs the following actions:
example URL 1
orexample URL 2
.Example identifier one
.Example output URL 1
andExample output URL 2
.Example URL 1:
Example URL 2:
Example identifier 1:
?si=ULI0ulElvw2Z1ooe
Example output URL 1:
Example output URL 2:
At the end of the day, the shortcut must be able to automatically identify and subsequently handle either one regular YouTube URL or one YouTube shorts URL at a time. It must be able to strip the unique identifier found at the end of the provided URL. It must return a regular YouTube URL and a Piped mirror.