[PRE-RELEASE] Mute Profanity - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: [PRE-RELEASE] Mute Profanity (/showthread.php?tid=130563)
[PRE-RELEASE] Mute Profanity - fegunz - 2012-05-03 05:13
I've created a plugin that is designed to mute profanity in your movie library. It works by comparing the movie's subtitle file against your filter file. When a match is found, XBMC will mute the audio for the duration of the word.
Source code: https://github.com/brazilbrown/mute-profanity
How to use it:
Install the add-on by unzipping to XBMC's addons folder. Plugin can be found in video add-ons. Once started you will see your movie collection. When you select a movie, the add-on will try to find the subtitle file for that movie. If you don't have one, it will ask if you'd like to download one. After a very brief processing time, it will complete and you then play the movie normally. You will notice that the blocked words are muted!
Since the subtitle file and not the audio itself is analyzed, you will notice that the mute times are not always exact. The script is only guessing when the blocked word is spoken, and it can be wrong sometimes. This add-on includes a setting which specifies the amount of time in milliseconds before and after the time of the blocked word that XBMC should start and end the mute. By default, this is 250ms, but can be adjusted for more or less time, depending on preferences.
It's important to have an accurate subtitles file, with correct timings. If you notice that your subtitles show up too early or too late, the script will mute too early or too late as well. Even with max timing settings, the plugin will not mute before or after the subtitle is no longer displayed.
After you download and install the application, the list of blocked words is found in the script directory under "resources"->"filter.txt". Each word should be on it's own line. Change this file as you see fit, but remember spaces matter. For example you might want to filter "asswipe" but not "class". You'll notice my filter file contains spaces for this reason (and they are important).
How it works:
XBMC has built-in the ability to read a EDL file (Edit Decision List) and process it accordingly. The script will create this file, which contains the timestamps of when mutes should occur. Again, this calculation is found from processing the subtitles file of the movie being 'edited'. My script currently only handles SRT subtitle files. If no SRT file could be found, the add-on will attempt to download one based on the name of the file from http://www.opensubtitles.org. If one could not be found, the script will fail. If you really, really need to mute a movie and it's not working, I suggest you download the SRT file separately, ensure that it works, then re-run my script to mute the profanity.
Possible Future Additions:
As this is a work in progress, I've started to come up with a list of features that one might find helpful with an add-on like this one:
* Edit the filter file in settings menu
* Multiple filter levels (little kids, young adults, etc)
* TV Shows option
* Much more...
What I need from you:
I've only tested this on one Windows machine, with only a few movies. I need more testers and suggestions. I have a list of features I'd like to implement in the future but would like to hear from the community as well. What features are most important to you?
One more note:
This add-on is not for everyone, I dare say not even for most. If you don't want to mute profanity, please don't use this add-on. This might come to a shock to a lot of people, but different people have different opinions, and they both can be valid. Just because you feel one way or another doesn't mean you're "right" and the other person is "wrong". If you want to use this that great, and if you don't that's great also.
RE: [PRE-RELEASE] Mute Profanity - spiff - 2012-05-04 10:12
hell yeah! that's fucking awesome.
RE: [PRE-RELEASE] Mute Profanity - rogerdpack - 2012-05-16 18:28
Wow looks nice. For some reason I've shied away from "super automatic" subtitle download, but this does look convenient (of course, having a working library with sensible cinema would be even better). I assume you've used Sensible Cinema so you know that sometimes it's problematic to find subtitles that line up right...
Speaking of which, I wonder how hard it would be to have XBMC play an EDL file for a DVD--I haven't seen it yet.
RE: [PRE-RELEASE] Mute Profanity - Bstrdsmkr - 2012-05-16 19:50
Hey, I just realized I could invert this to skip the boring parts of porn and go straight to the good stuff!
RE: [PRE-RELEASE] Mute Profanity - fegunz - 2012-05-16 19:58
Yes, finding correct subtitles are difficult to say the least. However, automatic subtitle download isn't my primary motivation for this plugin. I have looked at Sensible Cinema, and it looks great, however I don't use DVDs, I pretty much exclusively use XBMC for my movie watching. I didn't realize that Sensible Cinema even had a automatic subtitle to filter option til a few days ago. But that's what I wanted the most in an XBMC plugin. It seems like it would be real easy to make my code work with Sensible Cinema, as well as I could have probably used your code to create a XBMC edl file.
Now we need to convince ClearPlay to release their filters for the public to fully automate the system...
(2012-05-16 19:50)Bstrdsmkr Wrote: Hey, I just realized I could invert this to skip the boring parts of porn and go straight to the good stuff!
Actually no, you can't. Inverting this wouldn't 'skip' anything, only mute out everything that's not a cuss word. Which would make your porn more boring.
RE: [PRE-RELEASE] Mute Profanity - Bstrdsmkr - 2012-05-16 22:23
lol, not directly, but where you mute, I would seek. I'd also have to find a list of "scenes" somewhere lol
Although now that I think about it, that could potentially be a useful feature in regular videos. Hmmm.....
RE: [PRE-RELEASE] Mute Profanity - giftie - 2012-05-17 01:27
RE: [PRE-RELEASE] Mute Profanity - sho - 2012-05-17 02:23
(2012-05-17 01:27)giftie Wrote:
RE: [PRE-RELEASE] Mute Profanity - jcolby - 2012-05-23 16:55
How does this work with .iso files? Most of my library 500+ are .iso files. I prefer those to the .avi mostly because it doesn't lose quality from the original and I don't have to worry about subtitles and things not being included. I am using an Apple TV 2 with the XBMC EDEN 11. I have downloaded a .srt file for Kill Bill (great movie) but when I try to run the script it says that it can't find the file. I wonder if it can't find it because the movie is a .iso.
UPDATE: It appears to do the same thing with .avi files. The addon doesn't seem to find the subtitle file (even though there is a .srt in the same folder correctly named) and then it tries to download one and fails. Anyone else having this same issue?
I also just created my own simple .edl file to try this out. I can't figure out how to enable XBMC to recognize the .edl file. How do you turn that on?
RE: [PRE-RELEASE] Mute Profanity - joeperson - 2012-05-27 10:23
I have xbmc (11.0) on a MAC (10.6.8).
I manually copied the plugin to the addons folder, closed XBMC and restarted it.
When I try to run the script, it says there is an error with the script.
Is there something i'm missing?
If there is a log file I can send let me know.