youtube

I have been an avid Youtube video watcher since I was like a teen, this means almost half my life has had a certain amount of youtube watching on it. When I was in college I started to learn all about cyber privacy and software freedom. As such I created a program to watch Youtube videos locally, a program where no tracking occurs and your CPU is not wasted on pointless nonsense.

This project is about to break the 5 years old barrier.

Frontend for Youtube Cuck project.
The frontpage of the Youtube Cuck service. You can see 9 thumbnails for videos and for each, their channels and number of views. Links for playlists, shorts, continuing, history, listing subscriptions, downloads, adding new channels and refreshing the content are all present.

At first I created the project in Flask and there was no separation between frontend and backend, there was no ORM, there was no MySQL, only sqlite.

At some point it was also not only docker compose friendly, it was also kubernetes and helm friendly! And for some time I did run it in microk8s in my server but since I only have one node anyway I decided to just fall back to the good old docker compose.

Over the years it changed a lot, today it’s FastAPI with MySQL via sqlalchemy and alembic for migrations, it’s split into 3 microservices, 1 backend, 1 frontend and one nginx server essentially serving as a reverse proxy for the other microservices and serving files on certain endpoints. yt-dlp is used for downloading the videos and obtaining some video information like the size and duration. FastAPI is obviously using Jinja templates that have been derived from the original ones from Flask as both use this same notation.

Searching for recipes in Youtube Cuck project.
The image displays using the search function, in the Youtube Cuck platform, for looking up recipes. In this case we are ordering by oldest to newest and only kept videos.

There’s a very detailed Makefile that contains the most important commands that one could need. I use them a lot, especially when developing, for linting and formatting.

As for the UI, we have a display for the video items that are clickable and take you to the video page. Recently I also added filtration and sorting to this page, now one can search even videos that are no longer downloaded but that have previously been in the system.

In the video page we have keyboard shortcuts, similar to the ones one would use on Youtube itself, +10secs, -10secs, Sound up, Sound down, pause with K, etc…

The subscription list is a managed file that the backend modifies. The Add New Channel modal also now shows a preview of the most recent videos from a channel as well as a small description about it. This is an improvement where before the system was only checking if the channel existed and it also only allowed channel UIDs and now you can use @s and everything.

In the Repository I have also setup a bunch of workflows, the required ones are the ones that matter most, those are the ones I use to create Pull Requests before merging changes to main. I use this system because it allows the repo to keep all the files formatted and in shape, and, of course, up to a certain usage the workflow usage is free in Github so I encourage anyone to run workflows on their projects.

The truth is wanted to setup automated deployments in my machine from the github merges to master but I didn’t want to do polling and I also didn’t want my machine to be abused so at the moment I still have to write one line and click enter before the code is actually deployed…

Youtube, however, has been more and more antagonistic towards this type of software. The truth is, over the years, I’ve had to adapt my code multiple times to try to circumvent the restrictions.
The first time a change was needed I simply added a list of user-agents and changed yt-dlp to choose one at random when doing the downloads. This actually worked for quite a long time!

But as you know in the later years Youtube has been really hammering down so I now also need to run my software behind a VPN and even with this, I need to keep changing IPs everyday and to keep yt-dlp as updated as possible, if an update comes out and the system does not have it is likely that it will run into errors.

Youtube Cuck is a youtube replacement for the people that want to remove Google’s 4 eyes from their computer but still want to watch Youtube Videos.

⭐ Stars: Loading… 🍴 Forks: Loading…