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.

  • stoy@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    1 year ago

    Or, you could just remove the “si” parameter from the link manually…

    • theherk@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Yes, there are many things one could do manually that could otherwise be done with automation, but here we are… in an automation community.

  • brbposting@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 months ago

    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:

    • Handle original and shorts URLs
    • Return cleaned original URL & Piped.video URL
    • Bonus: handle multiple URLs simultaneously

    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:

    1. Takes a URL, such as example URL 1 or example URL 2.
    2. Removes the identifier at the end, as seen in Example identifier one.
    3. Returns Example output URL 1 and Example output URL 2.

    Example URL 1:

    https://youtube.com/shorts/hJClg5QBBcA?si=ULI0ulElvw2Z1ooe
    

    Example URL 2:

    https://youtube.com/watch?v=hJClg5QBBcA?si=ULI0ulElvw2Z1ooe
    

    Example identifier 1:

    ?si=ULI0ulElvw2Z1ooe
    

    Example output URL 1:

    https://youtube.com/watch?v=hJClg5QBBcA
    

    Example output URL 2:

    https://piped.video/watch?v=hJClg5QBBcA
    

    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.