Can I Fode A Youtube Video Into The Console

I was wondering if I can Code a program that pulls a video from the internet such as Youtube
Example:If the user enters 1 video 1 plays but if user enter 2 video 2 plays.
How would you code this?If possible.
*Code not Fode(Stupid Error)
Last edited on
While absolutely possible (and there exists a Python script to download videos off of Youtube), this isn't a simple project and will require way more than just the standard library.

EDIT: The absolute simplest way would be to find a function in your OS's API that launches the default browser with a given URL, then pass it the URL of the embedded version of the Youtube video player (which looks like youtube.com/embed/<ID>). This might seem a bit cheaty, however, in which case...

The next simplest way to do it would be to write a wrapper around a browser engine such as Webkit, or using a GUI toolkit's web view widget. This would take considerably more work, but the end result would potentially look much cleaner, at the bare minimalist level appearing as just a window border around the Youtube video player.

However, if you want just the video and to use your own player, that becomes even harder. You'll need to download the video, decode it, and play it, which ends up adding a requirement of 1-3 additional libraries. Additionally (and this is the hard part) you'll need to figure out a way to get the video itself out of a Youtube page, and it's in Google best interest to make this awkward.

If you wanted to embed videos directly in the console, I know of only one terminal emulator that lets you do that. Otherwise, that is not what the console was meant to be used for, philosophically speaking.

-Albatross
Last edited on
Topic archived. No new replies allowed.