Inspiration
Youtube in today's world has become an integral part of our lives . Literally , everything can be found on youtube these days from education to entertainment , from food recipes to dance moves and what not . It will not be wrong to say that youtube has become such a boon for the society . But as awesome youtube is , there is something very unawesome about it . And that are the advertisements . Some years back advertisements were fine as their occurrence in a video were fairly bearable . But now , literally every youtube video has a minimum of 2 advertisements and that's the low count . Advertisements nowadays appear almost at every beginning and middle of the video , which at times becomes so infuriating , annoying and unbearing . Being forced to watch an advertisement at the beginning of every video is not right and correct . Therefore , my team decided to build something to hack our way out of this AD-verse situation . So the idea that generated , is a small sneaky yet superb shell script that gathers the video urls about a search query using curl . Then it passes this data to a dynamic menu program like rofi which prints the results of the search query . Now we can select any video from the given menu . The video is played through mpv players as they support network streaming . Also to note that mpv player under the hood uses youtube-dl program which fetches the video directly from the source . Thus no advertisements get displayed and we enjoy our youtube videos without any ad distraction . Since we are playing only videos we search for , this script also saves us from the wasting our time by clicking any other unrelated video which would have got recommended to us in youtube site.
What it does
The name of the script is RofiYoutube , which combines rofi - a menu launcher and youtube - that is basically youtube . The script automates the youtube for us by bringing the videos without ads for watching through mpv player . Now you can watch video without interruptions and getting bothered by ads .
How we built it
The script was a simple shell script made using the shell script language along with some other utilities like curl - for fetching html , rofi - as a menu prompt , jq - a json parser for cmd , sed - a stream editor for manipulating data , gawk - a programming language best used for text processing and mpv - which supports network stream through youtube-dl .
Challenges we ran into
The biggest challenge was to figure out a way to parse the data from youtube search query . I found many examples from the internet , which really confused us . Using the jq library was good option as it parsed the important data nicely into a readable json format , which really helped me in the long run .
Accomplishments that we're proud of
Making and actually finishing this project is such a big achievement in itself for us . At first it did seem we would never be able to do this , but as time went , the project started to shape into the way we wanted it to be .
What we learned
We learnt a lot of new things developing this project . First and foremost , everything is achievable through command line tools . It seems odd , but we can almost automate everything with command line tools . Secondly we learnt how to use jq json parser tool , sed editor and gawk for word processing.
What's next for RofiYoutube
I wish to add more functionality to RofiYoutube , such as user login , gathering user's liked videos , playlists and history etc . Moreover i also want to add thumbnails of videos , so that users can visualize the videos more clearly .
Log in or sign up for Devpost to join the conversation.