faissaloo / SponSkrub

Strip advertisements from downloaded YouTube videos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows executable

shakeyourbunny opened this issue · comments

Hello,

could you perhaps provide Windows (64 Bit maybe) executables in your releases?

Thank you!

I have no intention of specifically supporting Wangblows, please see: #2

That's a shame since this is the only available SponsorBlock CLI tool as of my knowledge... I can help you test it and create a package for Scoop if you change your mind and do a cross-compiled releases for Windows.

@shakeyourbunny In the meantime, you can use WSL. If you set-up WSL and put the Linux binaries on PATH, it should be simply callable from Windows by prefixing the command with wsl, like wsl sponskrub ...

WSL is only usable, if you allow the Microsoft Store on Windows, which I totally nuked from Windows 10. In addition, this is no solution for people of Windows 8.1 which is still in active update state.

Note that my only reason for using Windows is games (and video processing), otherwise I use exclusively Linux too.

Guess I'll have to write my own Python version of this (weekend work..) and integrate this in my own Youtube archiving script, but I think that the author is not very professional about his opinion.

WSL is only usable, if you allow the Microsoft Store on Windows

Not really, you can still install packaged distributions.

Guess I'll have to write my own Python version of this (weekend work..)

If you do, please publish it! Python is the best choice for this type of project.

If you remove the Microsoft Store, you also lose the ability to install .appx packages, as the whole installer infrastructure for that is (permamently) removed; so no WSL.

Besides that, WSL is just a Trojan horse of Microsoft.

@shakeyourbunny

Note that my only reason for using Windows is games (and video processing), otherwise I use exclusively Linux too.

For video editing, Kdenlive is plenty good for most things. Alot of games are now available through Steam Proton, Lutris and PlayOnLinux, realistically tho Wangblows is so harmful to your computing that games shouldn't even be part of the equation for you unless you just enjoy being bossed around by a company that's in bed with glows.

Guess I'll have to write my own Python version of this (weekend work..) and integrate this in my own Youtube archiving script,

You could just compile and patch it yourself (if needed) but if you wanna do the heavy lifting of writing your own implementation go for it.

I think that the author is not very professional about his opinion.

This is intentional, Wangblows is an operating system deserving of mockery and professionalism is not in my vision for this project.

@JanPokorny 'glows' is internet slang for police officers, security agencies and the secret services, similar terms include 'feds' and 'spooks'. The term is a more polite spin on a term I can't use on GitHub originally coined by a paranoid schizophrenic genius programmer named Terry A. Davis who is no longer alive.

@shakeyourbunny Hacked this together in half an hour, it works very well. Python really is a beautiful language when all you're writing is glue code 😆

VIDEO_ID = "oPOhKULOL4o"
CATEGORIES = ["sponsor", "intro", "outro", "interaction", "selfpromo", "music_offtopic"]
FILE = "video.mp4"

import requests
import json
from moviepy.editor import *

cut_times = [
    x["segment"]
    for x
    in requests.get(url="https://sponsor.ajay.app/api/skipSegments", params={
        "videoID": VIDEO_ID,
        "categories": json.dumps(CATEGORIES)
    }).json()
]
cut_times.sort(key=lambda x: -x[0]) # start cutting from the end

clip = VideoFileClip(FILE, audio_buffersize=20000000)

last_cut = float("inf")
for cut_time in cut_times:
    stop = min(cut_time[1], last_cut) # don't accidentally cut something twice if segments overlap
    last_cut = start = cut_time[0]
    print(f"{start}-{stop}")
    clip = clip.cutout(start, stop)

clip.write_videofile("cut-"+FILE)

(it re-encodes the video, which is yucky -- using https://kkroening.github.io/ffmpeg-python/ might be better -- but the basic idea is that re-implementing this whole repo in a high-level language should be a breeze)