If you look at news.ycombinator.com at least once a day, you will occasionally see the life guide articles. Many are good and help you to look at something from a different angle. When I was working on my internet video problem, it also developed into a life guide because I made mistakes (due to my habit as a programmer). It's not really bad now and as you get older you automatically stop trying out new things. If you don't quite understand what I mean, please read all of Terry Pratchett's books. They will help you with my thought processes.
People with a good self-confidence (I'm just touching my own nose) tend to make life unnecessarily difficult for themselves. People work for hours on hundreds of good ideas and at some point they lose sight of their goal. It gets more and more complex and at some point you have written your own framework in Python. Why? Fuck! Because I can do it easily! That is really stupid. You finish diagrams, a flowchart, you sort, brainstorm, discuss and wander deeper and deeper into the forest of your own intelligence (or your own special knowledge) until you come to your grandmother's house, where the reality wolf is waiting for you. You are incredibly creative and have a thousand brilliant ideas? I assure you 999 of them suck.
Actually, I only need one piece of software that fulfills all my wishes. Why should I do all the work for myself and reinvent the wheel when I don't have the time anyway? Then rather (first) use a ready-made solution and implement it into your own project. I had decided to use the MPlayer first, because I had already used it before. But I had to find out that it was replaced by the mvp. Both are open source and can be installed with a simple
sudo apt-get $software_name on a Linux Mint system. Since my browser was written in Python, I only had to tell it what to do when opening a video link. That shouldn't be so difficult.
If you haven't downloaded the Alligator yet or don't want to, a short explanation how I built the project. So far the browser consists of only two files, the
config.py and the
alligator.py. In the first file I will include everything that should be managed by the user himself. I want to keep it as simple as possible, so that nobody gets a headache or has to study computer science before. I hate complicated software that can't be explained by itself. In the second is the actual programming code. So we tell the config file to use the mpv player.
videoPlayer = 'mpv '
Even if programmers like to present themselves as magicians, there is nothing special about it. It's like riding a bike, once you understand it, it's pretty easy. Now we have to provide all the rest in the second file (alligator.py) . Also here there are not many lines of source code. Altogether we say: *If a user clicks on a link with the right mouse button open a small menu. A menu item should read Open with Videoplayer. When this is pressed, the program reads the link and combines it into a single command with the string (which starts our mediaplayer) in the
config.py file. The command is executed from the terminal. In Linux you can start software from the terminal.
def contextMenuEvent(self, event): [...] openVideo = (config.videoPlayer) if url.isValid(): [...] openVideo = menu.addAction("Open with Videoplayer") else: [...] openVideo = "" [...] elif action == openVideo: os.system(config.videoPlayer + url.toString())