this post was submitted on 19 Sep 2023
28 points (96.7% liked)

Bash

686 readers
1 users here now

Talk about the Bash Shell and Bash scripting

founded 4 years ago
MODERATORS
 

This will remove all sponsors, download subtitles and view it when you are watching a video. Modify and Share this all over if you like! Edit: Give credits to this community or Lemmy in general if you are posting this or a modified form (please do share) of this elsewhere. Some popularity would do Lemmy good.

Few requirements:

  1. You should be using Linux to run it.
  2. Create a folder named yt-dlp in Videos folder or else change the location in the script below.
  3. You should have yt-dlp not youtube-dl on your system. You can do this by sudo apt install yt-dlp or use your distro's package installer.
  4. Save this file with any name in your home folder (or whichever folder you are you most comfortable with and give it execution permissions by chmod +x name

Debian Pastebin Thanks to folds at debian for making a tor network friendly pastebin. I have noticed that sometimes scripts get corrupted here, so best copy this from pastebin: https://paste.debian.net/1293211/

edit: deleted the codeblock as it was not rendering properly https://i.imgur.com/1lrTcdT.png

You can get the updated code here https://paste.debian.net/1293211/ Just paste it on to your notepad and give it execution permissions.

#edit 1: The program can be improved, if you guys feel like an improvement is needed, copy the entire program modify the parts you think can be made better and paste it in the comments or paste the pastebin link in the comments. I realize there are applications which are gui for yt-dlp but I felt they lacked many options. You can go on the man page, and learn and add attributes to make this script better so that it better suits your needs.

#man page aka github page: yt-dlp

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 5 points 11 months ago (2 children)

Fun.

Question though... How does the sponsor block work?

[–] [email protected] 3 points 11 months ago

@[email protected] seems to be right, but if you want to know generally, people like me and you basically mark some stuff in the youtube video (we mark when the sponsorship plug starts and when it ends) and then we upload it. That's it. It's update in the database (I think) and anyone using sponsor block application will not see it. It's quite nice actually, some guy with a hindu name (I think an indian) developed it.

haha... just saw the link the good captain posted it's Ajay! the guys name

[–] [email protected] 1 points 11 months ago* (last edited 11 months ago)

There exists sponsorblock API that can return sponsor timestamps when you input it a video ID. You could then trim those sections away.

If you want to implement: https://wiki.sponsor.ajay.app/w/API_Docs

[–] [email protected] 4 points 11 months ago
[–] [email protected] 1 points 11 months ago (1 children)

I think Lemmy broke your code block. The dollar signs aren't rendering

[–] [email protected] 1 points 11 months ago

I should not have pasted it I think

I mean, I should have just included the debian pastebin link, but yeah https://paste.debian.net/1293211/ here's it anyway. This is an updated one.