daretogo / filtertube

Small project that uses a MySQL database to collect requests from users for YouTube videos via a JS bookmarklet and then an approval and downloader to integrate with media setup.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

filtertube

what?

This project's main file filtertube.py is a Flask application that sets up an listening endpoint to receive inbound POST with details about a user and the YouTube video that they want. The user's request is written to a SQL database in a "Pending" state where one of the views in the app is to list out all the pending requests for an admin to approve/deny. The approval/denial only changes the 'status' of that request to "Approved" which is what the separate downloader.py watches for. The downloader finds approved requests and then actually downloads them to a local user folder, and after downloading there's a mechanism to copy them to another folder which for me is where my media is served to my users.

why?

YouTube's parental control offerings suck. YouTube restricted mode has content I don't want my kids seeing, and YouTube kids is leaky and not age appropriate for some of my older ones. So... I wanted per-video veto power over what my kids watch. My kids have permission to come into my office and use a computer to browse YouTube, skimming content, but not full on watching it. Instead when they find a video they'd like to watch, they click a little bookmarklet button "Request Video Kidname" which uses some JS to gather the YouTube video link and the kids name and sends it to the Flask filtertube app.

Then I as a parent get to at my leisure review the videos. Any that I approve, are automatically downloaded and placed into a media folder that is available on my kids Plex accounts.

misc thoughts

  • I like using the database as the intermediary between jobs, and I like using a separate request collecting and approving system from the downloading system. This would allow for quick replacement of the downloading system if YouTube-DL became broken.

  • I think there's a good chance I'll add a "approved channels" job that would look for videos in "Pending" state that are from particular channels that I trust and go ahead and auto-approve those.

  • today filtertube got channel white listing and a user facing listing function. I think these are pretty necessary features. The channel white listing is cool because it's another way we use the "status" as our control loop. We have a function that checks Pending status requests agains the always_allow_channels table and if it matches we just flip the status over to Approved. Then everything normal picks up from there like any other approved request.

  • I think in the future a browser plugin is really the way to make the requesting feature work better. Something that could inject itself into the Youtube.com pages and stop the videos from playing after 15-30 seconds (enough to get a preview, but not watch) and add a "reqeust" button onto the page. That would make the requesting expireince much better.

About

Small project that uses a MySQL database to collect requests from users for YouTube videos via a JS bookmarklet and then an approval and downloader to integrate with media setup.


Languages

Language:Python 66.2%Language:HTML 33.8%