Giter Site home page Giter Site logo

ctube's Introduction

CTube

A simple self-hosted front-end for YouTube, powered by youtube-dl.

Features

  • Searches
  • Channel video lists
  • Likes, dislikes, view count, uploader, upload date, description and tags
  • Comments sorted by date
  • Related entries for video being watched, based on video tags and title
  • Global "recommendations" on homepage, based on commonly watched tags frecency
  • Dims thumbnails for already watched videos
  • Reactive layout taking maximum advantage of any window size
  • Doesn't have a light theme
  • Currently uses YouTube's embedded player
  • Uses a stupid amount of iframes to minimize javascript usage and speed up page rendering while youtube-dl responses are loading

Installation

Requires Python 3.6+ and pip. There might be two pip commands on your system, check pip3 --version and pip --version to determine which one is available and corresponds to Python 3.

Make sure ~/.local/bin is in your PATH (add export PATH="$HOME/.local/bin:$PATH" to /etc/profile).

  1. Clone the repository: git clone https://github.com/mirukana/ctube
  2. Enter the cloned repository: cd ctube
  3. Install the python requirements: pip3 install --user -Ur requirements.txt
  4. Launch the server: ./run.sh
  5. Visit some youtube-like URLs, e.g. http://localhost:8000/results?search_query=example+search

The server binds to localhost on port 8000 by default, see ./run.sh --help for options.

Updating

  1. Go to the cloned repository and update the source code: git pull
  2. Update the python requirements: pip3 install --user -Ur requirements.txt

youtube-dl and youtube-comment-downloader, part of the python requirements, need to be frequently kept up-to-date to fix new issues with YouTube.

Stored data

Recommendation system data such as last watched video dates, tag frequencies and such are stored in ~/.local/share/ctube.

If you make your server accessible outside of your local machine (e.g. with ./run.sh --host 0.0.0.0), be aware that any connecting client will share the same set of data.

Embedded player ads

If your browser doesn't support uBlock or similar but can run GreaseMonkey scripts (e.g. pre-2.0 qutebrowser), you can use a script like below to clean up what remains on the embedded YouTube player:

// ==UserScript==
// @name         Youtube Cleaner
// @namespace    youtube_cleaner
// @version      0.1
// @match        *://www.youtube-nocookie.com/*
// @run-at       document-end
// ==/UserScript==

var style         = document.createElement("style");
style.type        = "text/css"
style.id          = "youtube-cleaner"
style.textContent = `
.video-ads, .ytp-pause-overlay {
    display: none !important;
}
`

document.getElementsByTagName("head")[0].appendChild(style)

ctube's People

Contributors

amir16yp avatar mirukana avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.