Jump to content

Basic YouTube URLs


Recommended Posts

There are many different YouTube URL formats and they often include information about playlists, referrers, etc. A few examples:

 

http://www.youtube.com/embed/T6DJcgm3wNY?rel=0

http://m.youtube.com/#/watch?v=T6DJcgm3wNY&feature=player_embedded&desktop_uri=%2Fwatch%3Fv%3DT6DJcgm3wNY%26feature%3Dplayer_embedded

 

However, when I want to share a YouTube URL with someone I only want the basic URL that points directly to the video. In this case:

 


 

Here's a workflow that takes any* YouTube URL and copies the basic URL to the clipboard.

 

alfred-youtube-basic-url.png

 

Download: basic-youtube-url.alfredworkflow

 

It might not cover every possible URL format, but so far I haven’t come across one that doesn’t work.

 

Link to comment

I was going to suggest it returned the short URL, but since you’re manipulating the string, and not using the API, that would take some work.

 

I would suggest however, that instead of having the user post the URL into Alfred, you’d just get it from the clipboard via pbpaste (you’re already using pbcopy anyway, so why not).

Link to comment

I would suggest however, that instead of having the user post the URL into Alfred, you’d just get it from the clipboard via pbpaste (you’re already using pbcopy anyway, so why not).

 

Thanks, great idea! I updated the workflow.

Link to comment
  • 2 weeks later...

Maybe it's just me, but what about an option that takes the URL from the current safari tab?

 

That’s a pain to support. To implement it on one browser, you should support others, and then you have to add a configuration option to let the person pick the browser, or do some applescript to detect which browser is the frontmost window. I’ve implemented that in PinAdd, and I can tell you that for such a simple workflow, more than two thirds of your code would be just for the browser support.

If you feel like it, though, I’ve put together a small list of how to do it for some of them.

Link to comment
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...