Python — Play YouTube Videos on VLC with Just 1 Click

Python — Play YouTube Videos on VLC with Just 1 Click

How to play YouTube videos in VLC with just one click using a ‘.exe’ file written in Python.

Now you can watch that Butter in VLC at your comfort.Now you can watch that Butter in VLC at your comfort.

All you have to do is just copy the link.

That’s it — the code will do the rest. You can check out the code and additional info here. You can also check out the article in which I went through each and every step of the code.

By streaming them in VLC, you can maximize the volume compared to YouTube. Also, many people (like me) are comfortable with VLC controls whereas YouTube has limited controls.

Way of Working :

The script looks for the clipboard actions. After checking certain conditions such as:

Current active window → active window can be Chrome or Edge

Incorrect URL → should be a “Youtube” video

The script then executes a command-line tool provided by VLC which allows VLC to stream videos. It auto-copy-pastes the required commands and plays the video in VLC.

Actual Process :

To play YT videos in VLC, without this script, you can follow these steps.

  • Go to YouTube --> Copy video url --> Open VLC --> Open network streamable file --> Paste url --> Then watch the video

Why do all this when you can have a completely automated script that does most of the manual work with just a couple of keystrokes? 👌

Simplified to :

(With just a few lines of code)

  • Go to YouTube --> Add "-vlc" to URL and copy it --> Run the exe provided(or you can first run the exe first, then copy the URL)

  • That’s it. You can watch it already.

You can change the code so you don’t even have to add “-vlc” to the URL, just the copy will do. But I added the extra text to prevent VLC from playing each and every time I copy the link.

Example: Even If you copy the link just to share it on another platform, the code will run and play the video in VLC

But the source code file can always be updated according to your needs. You can check it out here.

If you have any queries, you can comment them down below or ping me at , I’ll get back to you shortly.

Thank you for reading. Hope you liked it.

PS: This is my first post ever, so feel free to throw all those suggestions at me. I’ll catch ’em all. This script might not be something great but I was happy that I was finally able to apply something of my knowledge and make a real-world task simpler and efficient.