faissaloo / SponSkrub

Strip advertisements from downloaded YouTube videos
GNU General Public License v3.0
178 stars 7 forks source link

Doesn't work anymore with optional categories #36

Closed JeFi2 closed 3 years ago

JeFi2 commented 3 years ago

Optional categories don't work anymore:

$ sponskrub -include-intros -include-outros -include-interactions -include-selfpromo -include-nonmusic dz4ifEZhR7g /home/user/test.opus /home/user/test2.opus Downloading video sponsor data Couldn't connect to the Sponsorblock API Nothing to be done.

$ sponskrub dz4ifEZhR7g /home/user/test.opus /home/user/test2.opus
Downloading video sponsor data Surgically removing the shilling... [libopus @ 0x5610d1a9c940] No bit rate set. Defaulting to 96000 bps. size= 51767kB time=01:19:51.95 bitrate= 88.5kbits/s speed= 110x
Done!

Maybe this is because they added an additional "preview" category some time ago.

Dreikasehoch commented 3 years ago

Since the sponskrub fork recommended for use with the popular yt-dlp project has all the of optional categories enabled by default, it's now completely broken as well.

CoordSpace commented 3 years ago

This issue broke my WIP automated yt-dlp docker container, thankfully I found this issue before ripping my entire docker network stack apart.

So after adding a bunch of writefln() print statements around core areas where the application interacts with the API, the issue seems to stem from whitespace in the categories list of the API request.

Right now the application generates urls such as http://sponsor.ajay.app/api/skipSegments?videoID=y8XvQNt26KI&categories=["sponsor", "intro"] which seems to cause a URL using bad/illegal format or missing URL error in std.net.curl. I'm not familiar with dlang but I guess it's an issue stemming from a lack of URL-encoding of strings before making the API requests.

After removing the spaces following the commas in each .join(", ") within the following lines, things seem to be working again. https://github.com/faissaloo/SponSkrub/blob/3077602bff10463e5e87af2c8eb95ed285d21336/src/sponskrub/sponsorblock.d#L54 & https://github.com/faissaloo/SponSkrub/blob/3077602bff10463e5e87af2c8eb95ed285d21336/src/sponskrub/sponsorblock.d#L64

faissaloo commented 3 years ago

Should be fixed in master, I'll try and do a release later today. Let me know if there are any further issues.