Giter Club home page Giter Club logo

castblock-legacy's Introduction

โš ๏ธ Notice
This project has been deprecated in favor of numerous forks
https://github.com/erdnaxeli/castblock Easiest upgrade due to Dockerfile
https://github.com/willemstuursma/castblock-php PHP port
https://github.com/chromecast-sponsorblock/chromecast-sponsorblock

CastBlock

A small utility to skip integrated ads on youtube when played on chromecasts

Installation

Arch Linux

aurman -S castblock-git

Any Distro via Docker

x86 and ARM Docker images are available from DockerHub as stephen304/castblock:latest

docker pull stephen304/castblock:latest
docker run --network="host" stephen304/castblock

From Source

  • Install the prerequisites:
    • go-chromecast
    • jq - sudo apt-get install jq
    • bc - sudo apt-get install bc
    • cmp
    • timeout
  • Put castblock in /usr/bin/
  • Put castblock.service in /usr/lib/systemd/system/

Usage

Run castblock while on the same LAN as chromecast devices.

Alternatively, enable and start castblock.service to run in the background. Ensure castblock exists in /usr/bin/ and castblock.service exists in /usr/lib/systemd/system/ as above, then run:

  1. sudo systemctl start castblock
  2. Check the service has started by running sudo systemctl status castblock
  3. And finally, in order to run at boot, type sudo systemctl enable castblock

It should automatically detect all chromecasts on the LAN, keep track of what's playing, and automatically skip sponsors using the SponsorBlock API.

Known Issues

  • May not work with smart TV youtube apps that support cast - dedicated chromecast device required
  • May not detect all chromecasts, does not rescan. If your chromecast is now shown, try re-running
  • Start of skipping is based on polling and may miss the starting split second of a segment
  • Segments shorter than 5 seconds are ignored - seeking on chromecast always causes buffering making skipping super short segments have questionable value
  • Segments less than 10 seconds after a previous segment may play partially or fully due to the post skip timeout which prevents double skipping
  • Script may not cleanly exit / may leave running threads/processes. Fight me. Or make a pull request. Your choice.

Contributing

I welcome all suggestions / code for the above issues as well as other discussion on how to improve the script. Feel free to open an issue or PR with any contributions.

castblock-legacy's People

Contributors

maxjw avatar stephen304 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

castblock-legacy's Issues

Docker support?

This project seems absolutely amazing, love what you've created here. Would be fantastic to have an official docker image to pull!

High CPU Usage

Hi, I was wondering if it was normal that it uses almost half the cpu of my machine. jq seems to be the culprit.

Does not rescan for chromecasts

If a CC is not detected when the script is started, it will never be detected. We need a periodic rescan to update the list of chromecasts. Extra care should be taken to not lose track of the threads for each chromecast if necessary

Re-implementing in PHP

Hi,

I am running castblock on my Raspberry Pi B which works nicely.

I noticed various issues such as high CPU usage that could be solved with a proper (non looping) re-implementation in a higher level programming language.

I have the skills to create such an implementation in PHP. However, I don't have muck skills in docker or linux tooling.

I was wondering if you would take a PR for such an implementation. If so, I will set aside some time to create one.

Skips on netflix

I'm fairly certain I can reproduce this, I suspect related to not clearing out segments when switching content.

Allow configuring parameters

Potential config options:

  • type of segment to skip (sponsor/intro/self promotion/etc)
  • minimum segment length (default is 5sec i think)
  • polling interval (performance reasons)

Syntax error: "(" unexpected

blu@netguard:~/castblock/castblock-master $ sh /usr/bin/castblock
/usr/bin/castblock: 10: /usr/bin/castblock: Syntax error: "(" unexpected

Suppress table when run as service

Either detect when run in a terminal or have a quiet flag? Maybe use a single line output format so systemd status can be more useful when debugging

Constant writing to disk

There appears to be a constant stream of data being written to the disk at all times when castblock is running, this is on an Arm system booted off an SD card.

There are no casts running.
Kernel CPU usage is constant 100% when castblock is running
my /tmp mount is tmpfs

Does castblock work with casts to Youtube app from Samsung smart TV?

I have a Samsung Smart TV with Youtube app installed. I installed castblock on my raspberry pi through Docker following the guide on another issue posted here. However, when I cast something from the Youtube app on my android phone to the Youtube app on the Samsung Smart TV, I can still see ads, thus indicating that castblock might not work.

So I ask: is it supposed to work or castblock only works with a chromecast (which I don't own) inserted?

If it should work with the Youtube Samsung app as well, is there a way to check that castblock is running smoothly? When I start the docker container on the raspberry pi I do not get any errors.

Does Crash every 10 minutes

Currently I am using Docker 20.10.0 and the latest version of castblock.
Every 10 minutes the container crashes.
This causes that castblock is not able to block the ads until the container restarts.
Also it would be clever to implement a healthcheck
image

Suggestion: Docker image for ARM architecture (Raspberry Pi)?

I'm trying to use this great implementation on my Raspberry Pi alongside Pi-Hole, which I imagine many people would like to do as well. If you could create a Docker image that works with Raspberry Pi, or another installation method that isn't AUR or Docker specific, that would be much appreciated ๐Ÿ‘

Details: When I try to run "docker run --network="host" stephen304/castblock", I get the error "standard_init_linux.go:211: exec user process caused "exec format error", which I have searched is an architecture mismatch issue I think?

Variable polling rate for playback status

Currently idle chromecasts are polled at the same frequency as playing chromecasts. Maybe this is moot if we use go-chromecast watch, but it may help reduce cpu usage of the script.

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.