YouTube Design Changes and my peaceful life
Around a week ago YouTube switched my homepage to their new design with very big video previews which is suitable for tablets or smartphones but totally unusable on desktop with reasonable huge screen.
So I searched a way how to disable it, but as almost always there was none. In the end I used “Feedback” function and described how unusable it is on desktop and now (at the time of writing this post) I have older homepage design.
While YouTube was playing tricks on me I decided to play tricks on YouTube. My first idea was to change the user interface with some UserScript but that failed. The second idea was to simply discard web browser and use YouTube Viewer, to be exact its GTK version to browse and watch videos.
The other big hurdle of YouTube is that videos often do missing or are simply blocked, audio muted, cut and so on. Due to this I decided to create a little video cache. This cache also helps me to get better video quality out of youtube-dl and YouTube-viewer.
Another things is that my machine does not like modern software which supports playing YouTube videos such as MPV (restarts? GPU) or VLC (does not work at all whatever I set in settings) I went for simpler Mplayer which works fine to my surprise.
The goal was to get videos with 1080p or lower with fps 30 or lower. I was unable to set this special condition directly in YouTube Viewer. I decided to create little “proxy” script which will be called from YouTube Viewer with video URL and video title (I am truly lazy here).
Little script #
Since youtube-dl is written in Python I also decided to use Python and use youtube-dl python API to call it instead of cli. In this way the script has full control over youtube-dl configuration and I could play.
The biggest hurdle is that youtube-dl does not provide final filename for downloaded video. The only way to get the final filename which is used the script has to parse (with regular expression to have some fun) the debug output of youtube-dl to snatch the real filename in which the file exists or will exist in file system.
In the end I just called mplayer with video filename and title which was provided in argument.
The script is still not up to the standard and only works thanks to luck, use with a caution. You can download it here
I have to thank YouTube for providing me with this oportunity, without I am afraid I would be still mostly locked in YouTube interface, not wanting to go out.