Code Monkey home page Code Monkey logo

sponsoryeet's Introduction

logo

sponsoryeet

screenshot

Automatically yeets sponsors away from the chromecast.

Like https://github.com/stephen304/castblock but not CPU hungry bash hack depending on an endless amount of supply chain attacks waiting to happen (aka. an average go project).

Dependencies

  • C++ compiler
  • OpenSSL or GnuTLS (only runtime, not to compile)

Has a simple HTTP implementation, mdns implementation and uses c++11 regexes for parsing the json, so no more deps.

Also uses a simple protobuf implementation to avoid the protoc/libproto mess.

It looks up a suitable SSL implementation when running, so e. g. if you cross compile for a raspberry pi you only need it available on the raspberry pi.

Building

Either just run make, or use cmake (probably better if you're not using a proper operating system).

Usage

Run "sponsoryeet" (from a terminal).

It will automatically discover any chromecast on your network (better than any other chromecast app I've seen, including Chrome), connect, wait for youtube to start playing and download a list of segments to skip, and skip them when they occur.

You can also pause/resume the video by applying pressure to your spacebar, and quit by pressing q or escape.

If you launch it with -v or --verbose it will print a lot of debug output.

Ad-block

If you launch it with -a or --adblock it will try to skip ads.

It will try to do so by stopping the video, and re-open it at one second past where it was.

I have Premium so I haven't been able to test it, but it should work in theory. I implemented it because youtube bugs out sometimes and shows me ads anyways, but it happens intermittently so I can't really test it.

Why

Because the other solutions are either written in fucking crystal for no good reason (why not just APL or REXX if you want to make it a pain for people to use your code, and it just uses go-chromecast for the heavy lifting anyways) and wants me to download a full distro in a docker container, are uglier hacks in PHP, or are huge ugly resource intensive nodejs hacks with a metric shit-ton of dependencies.

In short, the alternatives are huge, ugly, resource heavy cludges.

sponsoryeet's People

Contributors

sandsmark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sponsoryeet's Issues

Build issues

Hi @sandsmark.

Thoroughly enjoyed your README.md and wanna get this working as-is. Current build issues:

M1 Pro macOS 12.5.1

# vanilla make
mkdir -p build
make ..             # kills my terminal altogether w/o any build artifacts

# cmake
λ cd build

λ cmake ..
-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/lance/git/sponsoryeet/build

λ cmake --build .
[ 33%] Building CXX object CMakeFiles/sponsoryeet.dir/main.cc.o
In file included from /Users/lance/git/sponsoryeet/main.cc:21:
/Users/lance/git/sponsoryeet/connection.h:58:49: error: use of undeclared identifier 'TCP_USER_TIMEOUT'
        int ret = ::setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout, sizeof timeout);
                                                ^
In file included from /Users/lance/git/sponsoryeet/main.cc:25:
In file included from /Users/lance/git/sponsoryeet/chromecast.h:5:
In file included from /Users/lance/git/sponsoryeet/castchannel.h:3:
/Users/lance/git/sponsoryeet/ec_protobuf.h:33:10: fatal error: 'byteswap.h' file not found
#include <byteswap.h>
         ^~~~~~~~~~~~
2 errors generated.
gmake[2]: *** [CMakeFiles/sponsoryeet.dir/build.make:76: CMakeFiles/sponsoryeet.dir/main.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/sponsoryeet.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Intel NUC Fedora 35

# make
$ make
g++ -MD -MP -Wall -Wextra -pedantic -std=c++17 -fPIC -g -Wno-variadic-macros -o main.o -c main.cc
g++ -MD -MP -Wall -Wextra -pedantic -std=c++17 -fPIC -g -Wno-variadic-macros -o ssl.o -c ssl.cc
g++ -o sponsoryeet main.o ssl.o -ldl -Wall -Wextra -pedantic -std=c++17 -fPIC -g -Wno-variadic-macros
$ sudo make install
[sudo] password for lance:
install -D -m755 sponsoryeet /usr/bin/sponsoryeet
$ sponsoryeet
Failed to find any valid openssl (last error: (null)
)

# cmake
$ cmake ..
-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lance/git/sponsoryeet/build
$ cmake --build .
[ 33%] Building CXX object CMakeFiles/sponsoryeet.dir/main.cc.o
[ 66%] Building CXX object CMakeFiles/sponsoryeet.dir/ssl.cc.o
[100%] Linking CXX executable sponsoryeet
[100%] Built target sponsoryeet
./sponsoryeet
Failed to find any valid openssl (last error: (null)
)
$ openssl version
OpenSSL 1.1.1q  FIPS 5 Jul 2022

Appreciate your help 🙏

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.