Jump to content

Sub-Killer Plugin - remove unwanted subs (Samsung Friendly)


Cheesegeezer

Recommended Posts

Cheesegeezer

Cheesey Productions brings you SUB-KILLER for Emby

 

Remove those unwanted subtitle languages

Removes Graphical subtitles by default & can extract text based subtitles as an option

 

image.jpeg.e962bd9a5febef5a0b7a470f6a6c23e5.jpeg

 

Available from the plugin store

A huge shout out to @rbjtech @FrostByte and @Dickydodah!for all their help with this. https://twemoji.maxcdn.com/2/72x72/1f44d.png

Please read the wiki page available that will help you get set up. - currently under construction

SUB-KILLER WIKI PAGE

This plugin is destructive as it removes physical subtitle files from your media containers

PLEASE USE A TEST LIBRARY FIRST

Config Page

image.thumb.png.d176539b7d46977b5b8a99414d4e0ea2.png

 

image.thumb.png.69c24dc2f92907031f2a38792533427a.png

Edited by Cheesegeezer
  • Like 9
  • Thanks 2
Link to comment
Share on other sites

Cheesegeezer

Hey peeps

So i think we are at the stage for release.

Please set up a test library (create a new library and throw in some copies of some TV or Movie files) and then do a library scan and see if you get the desired results.

I think it's working well from our testing.  Requires 4.7.7.0 Emby Server

Version 1.0.0.0 is available in the plugin catalogue under Metadata Section.

Enjoy

image.thumb.png.9054ade731dbd3173c5f026087ef2c8a.png

  • Like 1
Link to comment
Share on other sites

Dickydodah!

Hi, I've been testing this for some while now and it works a treat but I have noticed a few failures and seen this in the logs.

2022-10-05 12:40:07.173 Info SubKiller: PROCESSING OF  Labor Day  HAS STARTED
2022-10-05 12:40:07.173 Info SubKiller: Item FilePath = M:\TV Shows\The Rookie\Season 05 - The Rookie\The Rookie - S05E02 - Labor Day.mkv 
2022-10-05 12:40:07.173 Debug SubKiller: total No of Streams = 4
2022-10-05 12:40:07.173 Debug SubKiller: total No of Subtitles = 2
2022-10-05 12:40:07.173 Debug SubKiller: Subtitle Start Index = 2
2022-10-05 12:40:07.173 Debug SubKiller: Subtitle Display Lang = English, Embedded Title = , Language = eng, Index = 2, is Forced=False, isTextBased = True
2022-10-05 12:40:07.173 Debug SubKiller: Subtitle Display Lang = English, Embedded Title = SDH, Language = eng, Index = 3, is Forced=False, isTextBased = True
2022-10-05 12:40:07.173 Info SubKiller: Languages selected = [eng]
2022-10-05 12:40:07.173 Debug SubKiller: Stored Lang:eng - Stored Title: - Index:0 - Forced:False
2022-10-05 12:40:07.173 Debug SubKiller: Stored Lang:eng - Stored Title:SDH - Index:1 - Forced:False
2022-10-05 12:40:07.173 Info SubKiller: Extracting Subtitles to File
2022-10-05 12:40:07.174 Error SubKiller: ***** ERROR ***** UNABLE TO PERFORM SUBTITLE PROCESSING IN MAIN METHOD
2022-10-05 12:40:07.175 Error SubKiller: System.NullReferenceException: Object reference not set to an instance of an object.
   at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.ExtractSubtitles(BaseItem item)
   at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.MatchSubtitles(BaseItem item)
   at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.Execute(CancellationToken cancellationToken, IProgress`1 progress)

Link to comment
Share on other sites

Cheesegeezer

@Dickydodah!

Are the files Read-Only for some reason... this sometimes happens with MKV's

check the file properties, if they are read only, i will handle this in the code.(i must have missed it on sub killer) lol :D  Dang i also need to do the Linux Mod too!!

image.png.80ff8835202c2d81b9129dcf01e9ea42.png

 

Link to comment
Share on other sites

Dickydodah!

@Cheesegeezer They are not read only. This is not the only file that has this issue and the common thing seems to be that they only have 2 english subs so no foreign ones to delete. If you recall there is also a problem when there are no subs of the chosen language to extract, all the foreign subs are left embedded. Just to make it even more weird if I have the forced only switch on and there are three english subs in the file (along with other languages) The two unwanted english subs are left embeded.

Link to comment
Share on other sites

Cheesegeezer

ok cheers i'll take a look when i get a chance fella

  • Like 1
Link to comment
Share on other sites

Dickydodah!

@Cheesegeezer An example of nothing happening if there are no subs of the chosen language. Not a real problem in this file as there is only one french sub but could be if there were loads. This one doesn't kick out an error so I'm guessing its something to do with the way SubKiller is assesing the file.

I thought you might like a look when you get some time 😄

2022-10-05 12:56:45.876 Info SubKiller: PROCESSING OF  The Greater Good  HAS STARTED
2022-10-05 12:56:45.876 Info SubKiller: Item FilePath = M:\TV Shows\Power Book II - Ghost\Season 02 - Power Book II - Ghost\Power Book II - Ghost - S02E03 - The Greater Good.mkv 
2022-10-05 12:56:45.877 Debug SubKiller: total No of Streams = 3
2022-10-05 12:56:45.877 Debug SubKiller: total No of Subtitles = 1
2022-10-05 12:56:45.877 Debug SubKiller: Subtitle Start Index = 2
2022-10-05 12:56:45.877 Debug SubKiller: Subtitle Display Lang = French, Embedded Title = French, Language = fre, Index = 2, is Forced=False, isTextBased = True
2022-10-05 12:56:45.877 Info SubKiller: Languages selected = [eng]
2022-10-05 12:56:45.877 Info SubKiller: PROCESSING OF The Greater Good HAS COMPLETED
2022-10-05 12:56:45.877 Debug SubKiller: SubKiller processing for The Greater Good and took 0 milliseconds
2022-10-05 12:56:45.877 Debug SubKiller: Id -3715461 - The Greater Good has already been added to the processed List

Link to comment
Share on other sites

Cheesegeezer
55 minutes ago, Dickydodah! said:

@Cheesegeezer An example of nothing happening if there are no subs of the chosen language. Not a real problem in this file as there is only one french sub but could be if there were loads. This one doesn't kick out an error so I'm guessing its something to do with the way SubKiller is assesing the file.

I thought you might like a look when you get some time 😄

2022-10-05 12:56:45.876 Info SubKiller: PROCESSING OF  The Greater Good  HAS STARTED
2022-10-05 12:56:45.876 Info SubKiller: Item FilePath = M:\TV Shows\Power Book II - Ghost\Season 02 - Power Book II - Ghost\Power Book II - Ghost - S02E03 - The Greater Good.mkv 
2022-10-05 12:56:45.877 Debug SubKiller: total No of Streams = 3
2022-10-05 12:56:45.877 Debug SubKiller: total No of Subtitles = 1
2022-10-05 12:56:45.877 Debug SubKiller: Subtitle Start Index = 2
2022-10-05 12:56:45.877 Debug SubKiller: Subtitle Display Lang = French, Embedded Title = French, Language = fre, Index = 2, is Forced=False, isTextBased = True
2022-10-05 12:56:45.877 Info SubKiller: Languages selected = [eng]
2022-10-05 12:56:45.877 Info SubKiller: PROCESSING OF The Greater Good HAS COMPLETED
2022-10-05 12:56:45.877 Debug SubKiller: SubKiller processing for The Greater Good and took 0 milliseconds
2022-10-05 12:56:45.877 Debug SubKiller: Id -3715461 - The Greater Good has already been added to the processed List

Yep I forgot to handle it not finding the selected language(s).

Thanks i'll get round to it

Ta

  • Thanks 1
Link to comment
Share on other sites

Dickydodah!

Sorry to do this 🙁 but I've just found a little GUI bug. If you hover your mouse over the + next to the dropdown to choose libraries it comes up with a tooltip that says "ignore series".

  • Thanks 1
Link to comment
Share on other sites

fillidill

I really want to try this out but I have two questions.

  • Will this plugin be available to the latest stable release?
  • Maybe stupid question but do I understand correctly that this will remove ASS subtitles? 
Link to comment
Share on other sites

Cheesegeezer
47 minutes ago, fillidill said:

I really want to try this out but I have two questions.

  • Will this plugin be available to the latest stable release?

yes

47 minutes ago, fillidill said:
  • Maybe stupid question but do I understand correctly that this will remove ASS subtitles? 

Are ass subs external or stored internally? If they are text based internally then any text based sub would be extracted as SRT. I should really add a function to extract them based on what the user wants.

if the subs are already extracted then it wont touch them

Edited by Cheesegeezer
  • Thanks 1
Link to comment
Share on other sites

fillidill
2 hours ago, Cheesegeezer said:

yes

Are ass subs external or stored internally? If they are text based internally then any text based sub would be extracted as SRT. I should really add a function to extract them based on what the user wants.

if the subs are already extracted then it wont touch them

They are internal. I however just want to get rid of them (because of how bad it works in emby browser app streamed from my ds920+), no need for extracting. 

Link to comment
Share on other sites

Cheesegeezer

I have just released a new version for testing in our we group so waiting for feedback on that.

i would suggest that you create a new library and copy a couple of shows or movies to that library. Ive invited you to it

Link to comment
Share on other sites

MagicDoubleM

Quick question, what happens to subtitles that aren't properly tagged? I guess they get removed, so can we have an option to keep those?

Could, you, wild thinking here, scan through those subs and identify the actual language? 🤯

Link to comment
Share on other sites

MagicDoubleM

One more little feature request: Taking special flags in consideration would make sense, like always keeping subs for the original language or commentaries.

Link to comment
Share on other sites

Cheesegeezer
On 08/10/2022 at 18:31, MagicDoubleM said:

Quick question, what happens to subtitles that aren't properly tagged? I guess they get removed, so can we have an option to keep those?

that’s not my job to ensure that “obtained” media has been tagged & encoded correctly. 

On 08/10/2022 at 18:31, MagicDoubleM said:


Could, you, wild thinking here, scan through those subs and identify the actual language? 🤯

Absolutely not!

Edited by Cheesegeezer
Link to comment
Share on other sites

Cheesegeezer
1 hour ago, MagicDoubleM said:

One more little feature request: Taking special flags in consideration would make sense, like always keeping subs for the original language or commentaries.

The scope of the plugin is purely to deal with language, forced and SDH flags.  Its a tool to reduce the number of subtitles stored in a media container.

Edited by Cheesegeezer
Link to comment
Share on other sites

gihayes

Subkiller Generating Errors, Not able to Extract Subtitle.

Thanks for all your hard work on the gazillion plugins Cheese. 🙂

Subkiller is never finishing on my system.  Never gets past 3% no matter how long it runs. The directory where it is processing files is not read only. Emby and other programs are able to read and write to it fine. It seems that if it has nothing to extract it's OK. I restarted Emby, and started Subkiller running from Scheduled Tasks. The log is attached.

 

Subrip Error.txt

Edited by gihayes
Link to comment
Share on other sites

gihayes
On 10/14/2022 at 12:57 PM, gihayes said:

Subkiller Generating Errors, Not able to Extract Subtitle.

Thanks for all your hard work on the gazillion plugins Cheese. 🙂

Subkiller is never finishing on my system.  Never gets past 3% no matter how long it runs. The directory where it is processing files is not read only. Emby and other programs are able to read and write to it fine. It seems that if it has nothing to extract it's OK. I restarted Emby, and started Subkiller running from Scheduled Tasks. The log is attached.

 

Subrip Error.txt 115.36 kB · 4 downloads

There were several other errors occurring in the log, so I set Emby to do a Database Vacuum, shut down Emby, rebooted the computer and restarted Emby before bed last night. This morning I discovered that the Subkiller was working Ok. It was at 60 or some percent when I looked at it and it finished some time later. Now it finishes a run in seconds. All is well.

Link to comment
Share on other sites

  • 2 weeks later...
hhoverflow

Do I need any other package to use the SubKiller?

I have this error. Running Emby stable version on a Synology NAS.

*** Error Report ***
Version: 4.7.8.0
Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
Operating system: Linux version 4.4.180+ (root@build15) (gcc version 8.5.0 (GCC) ) #42962 SMP Wed Sep 21 10:56:47 CST 2022
Framework: .NET 6.0.8
OS/Process: x64/x64
Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
Processor count: 4
Data path: /var/packages/EmbyServer/var
Application path: /volume1/@appstore/EmbyServer/system
System.NotImplementedException: System.NotImplementedException: The method or operation is not implemented.
at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.Run()
at Emby.Server.Implementations.ApplicationHost.RunEntryPoints(IEnumerable`1 entryPoints, Boolean isBeforeStartup)
Source: Emby.SubKiller
TargetSite: Void Run()
Link to comment
Share on other sites

Cheesegeezer
6 hours ago, hhoverflow said:

Do I need any other package to use the SubKiller?

I have this error. Running Emby stable version on a Synology NAS.

*** Error Report ***
Version: 4.7.8.0
Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
Operating system: Linux version 4.4.180+ (root@build15) (gcc version 8.5.0 (GCC) ) #42962 SMP Wed Sep 21 10:56:47 CST 2022
Framework: .NET 6.0.8
OS/Process: x64/x64
Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
Processor count: 4
Data path: /var/packages/EmbyServer/var
Application path: /volume1/@appstore/EmbyServer/system
System.NotImplementedException: System.NotImplementedException: The method or operation is not implemented.
at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.Run()
at Emby.Server.Implementations.ApplicationHost.RunEntryPoints(IEnumerable`1 entryPoints, Boolean isBeforeStartup)
Source: Emby.SubKiller
TargetSite: Void Run()

@FrostByte should be able to help you he has Synology and been testing Subkiller with us.

 

Link to comment
Share on other sites

FrostByte
3 hours ago, Cheesegeezer said:

@FrostByte should be able to help you he has Synology and been testing Subkiller with us.

 

I get the same error running beta server, though the plugin works just fine.

You get that error on server startup so it's not even running the task yet.

System.NotImplementedException: System.NotImplementedException: The method or operation is not implemented.
at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.Run()
at Emby.Server.Implementations.ApplicationHost.RunEntryPoints(IEnumerable`1 entryPoints, Boolean isBeforeStartup)

 

  • Thanks 1
Link to comment
Share on other sites

Dickydodah!

@Cheesegeezer I believe I have found a small bug. I'm currently running v1.0.0.0 on server v4.7.8.0. I'm using a scheduled task as I have been seeing some odd errors in the debug log mostly due to file locks on files that have just been imported so I decided to keep it simple 🙂 I have Subkiller set to extract all Eng subs and it is working fine extracting Normal, SDH and Forced subs as expected.

I have narrowed down the issue I'm seeing to external SRT subs that existed prior to installing Subkiller. It seems that SubKiller is interpreting these as embeded subs and attempting to extract them and then failing. This particular file has no embeded subs and just one external SRT file. (I have 20 "problem" files with pre existing subs) Whilst this doesn't really cause me any issues it does slow down the scanning process as the ID is never added to the processed list and the files are scanned everytime Subkiller runs. I can see problems scenarios where the external subs are imported when the video file is imported which I currently don't do.

I intend to remove all the problem SRT files and run SubKiller again to get them into the processed list and then I should be able to add the SRT files back. I think the issue may also occur if you choose to refresh the processed list but currently I'm not 100% certain.

 

2022-10-28 15:46:13.227 Info SubKiller: PROCESSING OF  The House of Enlightenment  HAS STARTED
2022-10-28 15:46:13.227 Info SubKiller: Item FilePath = M:\TV Shows\See\Season 03 - See\See - S03E05 - The House of Enlightenment.mkv 
2022-10-28 15:46:13.227 Debug SubKiller: total No of Streams = 3
2022-10-28 15:46:13.228 Debug SubKiller: total No of Subtitles = 1
2022-10-28 15:46:13.228 Debug SubKiller: Subtitle Start Index = 2
2022-10-28 15:46:13.228 Debug SubKiller: Subtitle Display Lang = English, Embedded Title = , Language = eng, Index = 2, is Forced=True, isTextBased = True
2022-10-28 15:46:13.228 Info SubKiller: Languages selected = [eng]
2022-10-28 15:46:13.228 Debug SubKiller: Stored Lang:eng - Stored Title: - Index:0 - Forced:True
2022-10-28 15:46:13.228 Info SubKiller: Extracting Subtitles to File
2022-10-28 15:46:13.228 Error SubKiller: ***** ERROR ***** UNABLE TO PERFORM SUBTITLE PROCESSING IN MAIN METHOD
2022-10-28 15:46:13.229 Error SubKiller: System.NullReferenceException: Object reference not set to an instance of an object.
   at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.ExtractSubtitles(BaseItem item)
   at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.MatchSubtitles(BaseItem item)
   at Emby.SubKiller.ScheduledTasks.SubKillerScheduledTask.Execute(CancellationToken cancellationToken, IProgress`1 progress)

Link to comment
Share on other sites

Dickydodah!

I can confirm that removing and running SubKiller again before re adding the SRT files works. I can also confirm that refreshing the processed list is what causes the problem. You have to rescan the library after deleting the SRT files as I'm guessing SubKiller gets the info regarding the number of subs from the Emby DB.

Edited by Dickydodah!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...