sensible-cinema 0.21.9 → 0.21.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/LICENSE.TXT +8 -72
  2. data/README +126 -90
  3. data/Rakefile +28 -34
  4. data/TODO +157 -129
  5. data/VERSION +1 -1
  6. data/bin/sensible-cinema +40 -23
  7. data/change_log_with_feature_list.txt +26 -0
  8. data/development.txt +15 -6
  9. data/go.bat +1 -1
  10. data/go_ocr_tracker.bat +1 -1
  11. data/gocreatemode.bat +1 -1
  12. data/is_it_legal_to_copy_dvds.txt +80 -0
  13. data/lib/auto_convert.rb +4 -3
  14. data/lib/count_down_timer_jruby_swing.rb +5 -5
  15. data/lib/drive_info.rb +27 -7
  16. data/lib/edl_parser.rb +0 -1
  17. data/lib/mencoder_wrapper.rb +4 -5
  18. data/lib/subtitle_profanity_finder.rb +128 -0
  19. data/sensible-cinema.gemspec +24 -93
  20. data/spec/common.rb +8 -9
  21. data/spec/dragon.srt +32 -0
  22. data/spec/drive_info.spec.rb +2 -1
  23. data/spec/how_to +13 -0
  24. data/spec/notes +651 -41
  25. data/spec/subtitle_profanity_finder.spec.rb +53 -0
  26. data/template_bats/RUN SENSIBLE CINEMA CLICK HERE.bat +11 -2
  27. data/todo.build_library.txt +1 -1
  28. data/todo.inventionzy.txt +16 -11
  29. data/todo.open_edl_list_org.txt +19 -2
  30. data/todo.subtitle +16 -4
  31. data/{bin → vendor}/monkey.png +0 -0
  32. data/www/index.html +1 -1
  33. data/zamples/edit_decision_lists/dvds/how_to_train_your_dragon.txt +25 -0
  34. data/zamples/edit_decision_lists/dvds/legend_of_the_guardians_the_owls_of_gahoole.txt +1 -1
  35. data/zamples/edit_decision_lists/dvds/sintel_open_source_blender.txt +18 -0
  36. data/zamples/edit_decision_lists/dvds/tron_legacy.txt +27 -0
  37. metadata +306 -413
  38. data/lib/profanity_finder.rb +0 -84
  39. data/spec/images/black.bmp +0 -0
  40. data/spec/images/colon.bmp +0 -0
  41. data/spec/images/hulu_0.bmp +0 -0
  42. data/spec/images/hulu_2.bmp +0 -0
  43. data/spec/images/hulu_2_3.bmp +0 -0
  44. data/spec/images/hulu_2_4.bmp +0 -0
  45. data/spec/images/hulu_3.bmp +0 -0
  46. data/spec/images/hulu_3_4.bmp +0 -0
  47. data/spec/images/hulu_4.bmp +0 -0
  48. data/spec/images/hulu_4_4.bmp +0 -0
  49. data/spec/images/hulu_5.bmp +0 -0
  50. data/spec/images/hulu_7.bmp +0 -0
  51. data/spec/images/hulu_8.bmp +0 -0
  52. data/spec/images/hulu_slash.bmp +0 -0
  53. data/spec/images/netflix_a0.bmp +0 -0
  54. data/spec/images/netflix_a1.bmp +0 -0
  55. data/spec/images/netflix_a2.bmp +0 -0
  56. data/spec/images/netflix_a3.bmp +0 -0
  57. data/spec/images/netflix_a4.bmp +0 -0
  58. data/spec/images/netflix_a5.bmp +0 -0
  59. data/spec/images/netflix_a6.bmp +0 -0
  60. data/spec/images/netflix_a7.bmp +0 -0
  61. data/spec/images/netflix_a8.bmp +0 -0
  62. data/spec/images/netflix_a9.bmp +0 -0
  63. data/spec/images/netflix_b9.bmp +0 -0
  64. data/spec/images/vlc_0.bmp +0 -0
  65. data/spec/images/vlc_2_4.bmp +0 -0
  66. data/spec/images/vlc_2_6.bmp +0 -0
  67. data/spec/images/vlc_4.bmp +0 -0
  68. data/spec/images/vlc_5.bmp +0 -0
  69. data/spec/images/vlc_6.bmp +0 -0
  70. data/spec/images/vlc_9.bmp +0 -0
  71. data/spec/images/vlc_colon.bmp +0 -0
  72. data/spec/images/youtube_0.bmp +0 -0
  73. data/spec/images/youtube_1.bmp +0 -0
  74. data/spec/images/youtube_2_0.bmp +0 -0
  75. data/spec/images/youtube_2_5.bmp +0 -0
  76. data/spec/images/youtube_2_6.bmp +0 -0
  77. data/spec/images/youtube_3_0.bmp +0 -0
  78. data/spec/images/youtube_4.bmp +0 -0
  79. data/spec/images/youtube_4_0.bmp +0 -0
  80. data/spec/images/youtube_5.bmp +0 -0
  81. data/spec/images/youtube_6.bmp +0 -0
  82. data/spec/images/youtube_light_0.bmp +0 -0
  83. data/spec/images/youtube_light_1_3.bmp +0 -0
  84. data/spec/images/youtube_light_2_1.bmp +0 -0
  85. data/spec/images/youtube_light_2_3.bmp +0 -0
  86. data/spec/images/youtube_light_2_9.bmp +0 -0
  87. data/spec/images/youtube_light_4.bmp +0 -0
  88. data/spec/images/youtube_light_4_3.bmp +0 -0
  89. data/spec/images/youtube_light_5.bmp +0 -0
  90. data/spec/images/youtube_light_5_0.bmp +0 -0
  91. data/spec/images/youtube_light_8.bmp +0 -0
  92. data/spec/images/youtube_light_9.bmp +0 -0
  93. data/spec/images/youtube_small_0.bmp +0 -0
  94. data/spec/images/youtube_small_2.bmp +0 -0
  95. data/spec/images/youtube_small_2_0.bmp +0 -0
  96. data/spec/images/youtube_small_4.bmp +0 -0
  97. data/spec/silence.wav +0 -0
  98. data/vendor/SetPriority.exe +0 -0
  99. data/vendor/gocr049.exe +0 -0
  100. data/vendor/music.wav +0 -0
  101. data/vendor/unzip.exe +0 -0
@@ -1,3 +1,29 @@
1
+ == 0.21.10 == [gem only release]
2
+
3
+ The (offline) subtitle parser now generates descriptions better (to look for false positives),
4
+ and accepts parameters more easily on the command line (examle, if you want to exclude "Thor"
5
+ then its ruby lib\subtitle_profanity_finder.rb filename.srt Thor t....)
6
+
7
+ Note that I obscure profanities within the code to a "euphemized" version for human use.
8
+
9
+ Note that VLC has had a "subtitle filter" capability for awhile: https://forum.videolan.org/viewtopic.php?f=7&t=90847
10
+
11
+ Note that VLC can "upconvert" [ex: DVD's] so I guess that means since we support it, we support upconverting players.
12
+
13
+ Tons of notes on how to use (or not use) various players/grabbers.
14
+
15
+ == 0.21.9 == [gem only release]
16
+
17
+ Add profanity subtitle auto-parser-generator, which can parse .srt's, extract timestamps, look for profanity. also make it "optional" for specific profanities. (offline analyzer, doesn't include auto-OCR or what not)
18
+ This was inspired by the python program, and also an email'ed program to me that did this in C# with XBMC/mplayer EDL syntax.
19
+ Also it has optional profanities.
20
+
21
+ Note well that avidemux can extract subtitles from tracks (example: from DVD) through training it on character recognition (trainable), and parses it out for you appropriately. It's a separate, unrelated open source project. Note also that VLC and other players can overlay arbitrary .srt subtitles over movies, and also they can display DVD subtitles correctly. See also the python movie content editor. Also note that several programs can just use normal OCR to extract .srt's from subtitle overlays/tracks.
22
+
23
+ Demo of auto-adjusted time signature, to map for instance a timestamps to another player, or what not.
24
+
25
+ Also some cross platform capabilities.
26
+
1
27
  == 0.21.9 == (released same day as 0.21.8 to try to clarify quickly)
2
28
 
3
29
  Added some lists of previously existing work.
data/development.txt CHANGED
@@ -1,28 +1,37 @@
1
- Source code (open source, GPLv3) : http://github.com/rdp/sensible-cinema (create an issue for feature requests/bugs etc.)
1
+ A few notes for developers:
2
2
 
3
3
  You can test the program out out by (on windows) installing daemon tools, then mounting the DVD of "big buck bunny" (open source, freely available movie)
4
4
  Or you could alternatively burn a copy of big buck bunny to DVD, then use that to test it against (a slightly more cross platform approach).
5
5
 
6
- You should be able to run the program and test it out against said DVD, put it through its paces to demo it, etc.
6
+ There are some demo DVD ISO's for development in
7
+ http://rogerdpack.t28.net/sensible-cinema/releases/dvd_isos (my own DVD, I release it under the CC license, as well as some
8
+ other CC released licensed DVD's).
9
+
10
+ You should be able to run the program and test it out against said DVD, put it through its paces to demo it, fix it, etc.
7
11
 
8
12
  Or if you have a DVD that already has a delete list available for it, you could use that, obviously.
9
13
 
10
- The main development roadmap is in the README. If you have any feedback/feature requests, et al, post an
14
+ The main development roadmap is in the TODO. If you have any feedback/feature requests, et al, post an
11
15
  issue or post to the Mailing List: http://groups.google.com/group/sensible-cinema
12
16
 
13
- It's written in jruby, and currently packages itself up as a zip with jruby-complete.jar with its required dependencies (see the Rakefile).
17
+ Sensible cinema is written in jruby, and currently packages itself up as a zip with jruby-complete.jar with its required dependencies (see the Rakefile) for windows.
14
18
 
15
19
  To run it from source, you may need to install a few gem dependencies (listed in the Rakefile)
16
20
 
21
+ or install them automatically:
22
+
23
+ $ jruby -S gem install sensible-cinema # installs dev. dependencies
24
+ Note that, in order to run the unit tests, you'll want to checkout the source from the repository to get all the test images
25
+
17
26
  The tests are in the spec directory, though some of them are out of date as development has focused in other areas.
18
27
 
19
28
  Currently it's windows only, ping me if you want that changed.
20
29
 
21
30
  Note: you transfer (c) to copyrighted published of sensible cinema when you submit patches.
22
31
 
23
- Note that there are batch files to run it in normal, create, and "realtime OCR track" mode.
32
+ Note that there are batch files to more easily run SC in normal, create, and/or "realtime OCR track" mode.
24
33
 
25
- We welcome all feedback/contribution :)
34
+ All feedback/contribution welcome :)
26
35
 
27
36
  == Advanced Usage ==
28
37
 
data/go.bat CHANGED
@@ -1,2 +1,2 @@
1
1
  @rem NB that you can call it like go --debug
2
- call j %* bin\sensible-cinema
2
+ call j %* bin\sensible-cinema || call jruby %* bin\sensible-cinema
data/go_ocr_tracker.bat CHANGED
@@ -1 +1 @@
1
- call j bin\sensible-cinema-cli %*
1
+ call j bin\sensible-cinema-cli %* || call jruby bin\sensible-cinema-cli %*
data/gocreatemode.bat CHANGED
@@ -1 +1 @@
1
- call j %* bin\sensible-cinema --create-mode
1
+ call j %* bin\sensible-cinema --create-mode || call jruby %* bin\sensible-cinema --create-mode
@@ -0,0 +1,80 @@
1
+ So...is this legal?
2
+
3
+ Unclear. In general ripping personal DVD's is legal.
4
+
5
+ Note also that if you don't feel it is legal in your country, you can still use the timing info given
6
+ to "manually" skip/mute scenes you dislike.
7
+ Also you may be able to hook up something that does the editing in "realtime" while playing it back (see README
8
+ for a list of related works that might help with this). This would fall under the The Family Home Movie Act of 2005.
9
+
10
+ And making verbatim "backup copies" of commercial DVD's (I think--I'm no laywer) may fall under
11
+ fair use [3].
12
+
13
+ Sensible cinema doesn't include any ability to actually rip DVD's,
14
+ and relies on you to use something else for that, on your own.
15
+
16
+ It is controversial to use open source software to play/rip commercial DVD's.
17
+ There are a few conflicting views.
18
+ Sensible-cinema doesn't actually do any decryption or decoding, nor has any knowledge of it.
19
+ It doesn't even have knowledge
20
+ as to whether the DVD was originally encrypted or not, we chose a "you have to do the ripping through
21
+ some other means" philosophy.
22
+ You can ask the authors of the ripping programs if it is legal. Apparently
23
+ libdvdcss (which the other programs that it calls out to use) has never been legally challenged in court (or so they say),
24
+ and uses a slightly different algorithm than those that have, so the jury's still out. Possibly
25
+ it has been challenged in French courts and found legal so it might vary from country to country [4].
26
+
27
+ Using sensible-cinema also might not be more unethical than ripping your DVD collection to your hard
28
+ drive so you can "keep your DVD's all in one place" or what not (which might even be termed fair use), since it
29
+ basically only saves parts from the original concatenated. Only original content is saved. It just happens to be bits and
30
+ pieces that don't have the profanity.
31
+ Note also that fair use at times does allow one to "record" things for personal use/backup (for example off the TV).
32
+ Note that sensible cinema does require the original DVD to be present when using it, also, to help enforce copy protection,
33
+ at least for watching it/using from within sensible cinema. Certainly do not rip DVD's you don't own.
34
+
35
+ If general, if it's not legal in your country, then don't use it!
36
+ You are responsible for your actions and use of the program.
37
+ It is possible that the authors of sensible-cinema are not cupable of anything
38
+ regarding its use themselves, since they re-distribute no edited media,
39
+ nor distribute cracking codes. Check your country's rules first. Be warned.
40
+
41
+ Note: do not redistribute or re-sell edited DVD's, certainly that is illegal.
42
+ We have learned from clean flicks that redistributing
43
+ (well at least renting/selling) edited commercial DVD's is illegal in the US.
44
+ Please don't redistribute. Consult your lawyer.
45
+ DO NOT MAKE ILLEGAL COPIES.
46
+ USE AT YOUR OWN RISK.
47
+
48
+ In terms of copyright, some uses of sensible cinema may be legal under The Family Home Movie Act of 2005,
49
+ at least in the United States, when viewed using the "playlist" option or "realtime" options
50
+ (v 0.10'ish, later removed--used VLC), the "realtime" option (0.18.0 -> 0.21'ish +, using mplayer).
51
+ In general, if I have the original DVD sitting next to my TV, I don't feel bad about watching
52
+ it edited, but please consult a laywer first if you have concerns.
53
+
54
+ This program can also be used for editing home movies, etc (example, the "pack wedding" file herein included).
55
+
56
+ Note that this software might well be legal in the EU,
57
+ as it is only software (if you watch it on your computer), and therefore possibly not subject to patents in certain countries
58
+ (see "Patents and codec" in [2]).
59
+
60
+ Also note that several ideas have been released in various releases that are disabled in later releases. Please see the mailing list and/or blog
61
+ for release notes http://betterlogic.com/roger, as well as http://ruby-forum.com (ruby talk ML there), and rubygems.org
62
+ which lists the various released ruby sources, including release notes, and also github.com/rdp/sensible-cinema which,
63
+ lists commits and changes and release notes, and is publicly available. And see also the changelog file included herein for a list.
64
+ See also the README text file which contains some invention related notes.
65
+ A more ancient history of various brainstorming thoughts was also described here:
66
+ http://betterlogic.com/roger/?p=2618
67
+
68
+ Never download files from the Internet and use those--we all know this is illegal.
69
+
70
+ Note also that since SC requires larger raw JPEG's, this discourages piracy since those are usually for compressed videos, which don't work.
71
+
72
+ NB: YOU MUST AGREE TO THE gplv3 in order to use this software. See LICENSE.TXT file.
73
+
74
+ [2] http://www.videolan.org/legal.html
75
+ [3] http://www.macworld.com/article/150731/2010/04/dvdripping_faqs.html
76
+ [4] http://www.videolan.org/legal.html
77
+
78
+ note also http://en.wikipedia.org/wiki/DVD_Decrypter for some more legal interestingnss.
79
+
80
+ Also note that this project was done under the gplv3 in Roger's jurisdiction, not a product of anybody else or any other owner.
data/lib/auto_convert.rb CHANGED
@@ -1,3 +1,4 @@
1
- seconds = 1000
2
- p 'converted value is', seconds* 29.97/30
3
- p 'another converted value is', seconds* 30/29.97
1
+ seconds = (ARGV[0] || 1000).to_f
2
+ p 'syntax: second to convert, first conversion ratio, second conversation ratio'
3
+ p 'converted value is', seconds * (ARGV[1] ||29.97/30).to_f
4
+ p 'another converted value is', seconds* (ARGV[2] ||29.97/30).to_f
@@ -6,7 +6,7 @@ module SensibleSwing
6
6
 
7
7
  class MainWindow < JFrame
8
8
 
9
- def initialize
9
+ def initialize
10
10
  super "countdown"
11
11
  set_size 150,100
12
12
  setDefaultCloseOperation JFrame::EXIT_ON_CLOSE # happiness
@@ -26,15 +26,15 @@ def initialize
26
26
 
27
27
  @switch_image_timer = javax.swing.Timer.new(1000, nil) # nil means it has no default person to call when the action has occurred...
28
28
  @switch_image_timer.add_action_listener do |e|
29
- seconds_left = (ARGV[0] || '35').to_i*60 - (Time.now - @start_time)
30
- @jlabel.set_text "%02d:%02d" % [seconds_left/60, seconds_left % 60]
29
+ seconds_left = (ARGV[0] || '25').to_i*60 - (Time.now - @start_time)
30
+ @jlabel.set_text "%02d:%02d" % [seconds_left/60, seconds_left % 60]
31
31
  end
32
32
  @switch_image_timer.start
33
33
  self.always_on_top=true
34
34
  end
35
35
 
36
- end
36
+ end
37
37
 
38
- MainWindow.new.show
38
+ MainWindow.new.show
39
39
 
40
40
  end
data/lib/drive_info.rb CHANGED
@@ -16,7 +16,7 @@ This file is part of Sensible Cinema.
16
16
  along with Sensible Cinema. If not, see <http://www.gnu.org/licenses/>.
17
17
  =end
18
18
  require 'digest/md5'
19
- require 'ruby-wmi'
19
+ require 'sane'
20
20
  require 'ostruct'
21
21
 
22
22
  class DriveInfo
@@ -24,7 +24,7 @@ class DriveInfo
24
24
  def self.md5sum_disk(dir)
25
25
  digest = Digest::MD5.new()
26
26
  files = Dir[dir + "VIDEO_TS/*.IFO"]
27
- files.sort.each{|f|
27
+ files.sort.each{|f| # sort tends to not do anything...
28
28
  digest << File.binread(f)
29
29
  }
30
30
  raise 'drive might not yet have disc in it? ' + dir unless files.length > 0
@@ -32,15 +32,35 @@ class DriveInfo
32
32
  end
33
33
 
34
34
  def self.get_dvd_drives_as_openstruct
35
- disks = WMI::Win32_LogicalDisk.find(:all)
35
+ disks = get_all_drives_as_ostructs
36
36
  disks.select{|d| d.Description =~ /CD-ROM/}.map{|d| d2 = OpenStruct.new; d2.VolumeName = d.VolumeName; d2.Name = d.Name; d2}
37
37
  end
38
38
 
39
- def self.get_drive_with_most_space_with_slash
40
- disks = WMI::Win32_LogicalDisk.find(:all)
41
- most_space = disks.sort_by{|d| d.FreeSpace.to_i}[-1]
39
+ def self.get_drive_with_most_space_with_slash
40
+ disks = get_all_drives_as_ostructs
41
+ most_space = disks.sort_by{|d| d.FreeSpace}[-1]
42
42
  most_space.Name + "\\"
43
- end
43
+ end
44
+
45
+ def self.get_all_drives_as_ostructs
46
+ if OS.mac?
47
+ require 'plist'
48
+ a = Dir['/Volumes/*'].map{|dir|
49
+ parsed = Plist.parse_xml(`diskutil info -plist "#{dir}"`)
50
+ d2 = OpenStruct.new
51
+ d2.VolumeName = parsed["VolumeName"]
52
+ d2.Name = dir # DevNode?
53
+ d2.FreeSpace = parsed["FreeSpace"].to_i
54
+ d2.Description = parsed['Description'] # work ??
55
+ d2
56
+ }
57
+ a
58
+ else
59
+ require 'ruby-wmi'
60
+ disks = WMI::Win32_LogicalDisk.find(:all)
61
+ disks.map{|d| d2 = OpenStruct.new; d2.Description = d.Description; d2.VolumeName = d.VolumeName; d2.Name = d.Name; d2.FreeSpace = d.FreeSpace.to_i; d2}
62
+ end
63
+ end
44
64
 
45
65
  end
46
66
 
data/lib/edl_parser.rb CHANGED
@@ -94,7 +94,6 @@ class EdlParser
94
94
  original_secs = translate_string_to_seconds(type) + offset
95
95
  # now if splits is 900 and we'are at 909, then we're just 9
96
96
  closest_split_idx = splits.reverse.index{|t| t < original_secs}
97
- p 'got idx', closest_split_idx
98
97
  if closest_split_idx
99
98
  closest_split = splits.reverse[closest_split_idx]
100
99
  # add some extra seconds onto these if they're "past" a split, too
@@ -28,7 +28,8 @@ class MencoderWrapper
28
28
  if File.exist?(@big_temp) && File.exist?(@big_temp + '.done')
29
29
  out = '@rem '
30
30
  end
31
- audio_codec = these_settings['audio_codec'] || 'lavc' # not copy...sniff...or you can't hear cars...
31
+ audio_codec = these_settings['audio_codec'] || 'mp3lame' # not copy...sniff...or you can't hear cars... LODO
32
+ # LODO do I need mp3lame for sintel, or can I get away with lavc?
32
33
  video_opts = "-vf scale=720:480,harddup -ovc lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=1:vstrict=0:acodec=ac3:abitrate=192:autoaspect -ofps 30000/1001"
33
34
  out + "mencoder dvdnav://#{@dvd_title_track} -of mpeg -mpegopts format=dvd:tsaf -alang en -nocache -sid 1000 -oac #{audio_codec} #{video_opts} -o #{@big_temp} -dvd-device #{this_drive} && echo done_grabbing > #{@big_temp}.done\n"
34
35
  end
@@ -75,9 +76,7 @@ class MencoderWrapper
75
76
  FileUtils.rm to_here_final_file # raises on deletion failure...which is what we want I think...hopefully.
76
77
  end
77
78
  out += "call mencoder #{partials.join(' ')} -o #{to_here_final_file} -ovc copy -oac copy\n"
78
- # LODO only do this if they want to watch it on their computer, with something other than smplayer, or want to make it smaller, as it takes *forever* longer to run...
79
- # or is ffdshow enough without this?
80
- out += "@rem old way... call mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 #{partials.join(' ')} -o #{to_here_final_file}\n"
79
+ out += "@rem old DISABLED join way... call mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 #{partials.join(' ')} -o #{to_here_final_file}\n"
81
80
 
82
81
  delete_prefix = ""#delete_partials ? "" : "@rem "
83
82
 
@@ -93,7 +92,7 @@ class MencoderWrapper
93
92
  endy = endy - start - 0.001
94
93
  # very decreased volume is like muting :)
95
94
  # LODO can we copy more here? ntsc-dvd supposedly remuxes...
96
- codecs = should_mute ? "-vcodec copy -acodec ac3 -vol 0 " : "-vcodec copy -acodec copy " # LODO the ac3 must match the copy...hmm...
95
+ codecs = should_mute ? "-vcodec copy -acodec ac3 -vol 0 " : "-vcodec copy -acodec copy " # LODO the ac3 must match the other copy codec ?
97
96
  partial_filename = to_here_final_file + '.' + (@idx += 1).to_s + '.avi'
98
97
  if File.exist? partial_filename
99
98
  FileUtils.rm partial_filename
@@ -0,0 +1,128 @@
1
+ #
2
+ # warning: somewhat scary/explicit!
3
+
4
+ # see subtitle_todo file
5
+
6
+
7
+
8
+
9
+
10
+ module SubtitleProfanityFinder
11
+
12
+
13
+
14
+
15
+
16
+
17
+ def self.edl_output args
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ profanities = {'hell' => 'heck',
54
+ 'g' +
55
+ 'o' + 100.chr => '...', 'g' +
56
+ 111.chr +
57
+ 100.chr +
58
+ 's' => 'g...',
59
+ 'lord' => 'lo..', 'da' +
60
+ 'mn' => 'da..', 'f' +
61
+ 117.chr +
62
+ 99.chr +
63
+ 107.chr =>
64
+ 'f...',
65
+ 'bi' +
66
+ 'tc' + 104.chr => 'b.....',
67
+ 'bas' +
68
+ 'tar' + 100.chr => 'ba.....',
69
+ ('a' +
70
+ 's'*2) => 'a..',
71
+ 'breast' => 'br....'
72
+ }
73
+
74
+ incoming = File.read(args.shift)
75
+
76
+ while args.length > 0
77
+ prof = args.shift
78
+ sanitized = args.shift
79
+ profanities[prof] = sanitized
80
+ end
81
+
82
+ profanities = profanities.to_a.sort.reverse.map!{|profanity, sanitized| [Regexp.new(profanity, Regexp::IGNORECASE), sanitized]}
83
+
84
+ output = ''
85
+ for glop in incoming.scan(/\d\d:\d\d:\d\d.*?^\d+$/m)
86
+
87
+ for profanity, sanitized in profanities
88
+ # dunno if we should force words to just start with this or contain it anywhere...
89
+ # what about 'g..ly' for example?
90
+ # or 'un...ly' ?
91
+
92
+ if glop =~ profanity
93
+ # create english-ified version
94
+ # take out timing line, number line
95
+ sanitized_glop = glop.lines.to_a[1..-2].join('')
96
+ sanitized_glop.gsub!(/[\r\n]/, '') # flatten 3 lines to 1
97
+ sanitized_glop.gsub!(/<i>/, '') # oddity
98
+ sanitized_glop.gsub!(/[^a-zA-Z0-9]/, ' ') # kill weird stuff like ellipses
99
+
100
+
101
+ # sanitize
102
+ for (prof2, sanitized2) in profanities
103
+ sanitized_glop.gsub!(prof2, sanitized2)
104
+ end
105
+
106
+ # extract timing info
107
+ timing_line = glop.split("\n").first.strip
108
+ timing_line =~ /((\d\d:\d\d:\d\d),(\d\d\d) --> (\d\d:\d\d:\d\d),(\d\d\d))/
109
+ # "00:03:00.0" , "00:04:00.0", "violence", "of some sort",
110
+ output += %!"#{$2}.#{$3}" , "#{$4}.#{$5}", "profanity", "#{sanitized}", "#{sanitized_glop.strip}",\n!
111
+ end
112
+
113
+ end
114
+
115
+ end
116
+ output
117
+
118
+ end
119
+ end
120
+
121
+ if $0 == __FILE__
122
+ if ARGV.empty?
123
+ p 'syntax: filename.srt [prof1 sanitized_equivalent1 prof2 sanitized_equivalent2 ...]'
124
+ exit
125
+ else
126
+ print SubtitleProfanityFinder.edl_output ARGV
127
+ end
128
+ end
@@ -5,13 +5,13 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sensible-cinema}
8
- s.version = "0.21.9"
8
+ s.version = "0.21.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roger Pack"]
12
- s.date = %q{2011-05-18}
12
+ s.date = %q{2011-06-08}
13
13
  s.email = %q{rogerdpack@gmail.com}
14
- s.executables = ["monkey.png", "sensible-cinema", "sensible-cinema-cli"]
14
+ s.executables = ["sensible-cinema", "sensible-cinema-cli"]
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.TXT",
17
17
  "README",
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
24
24
  "TODO",
25
25
  "VERSION",
26
26
  "_DO_NOT_RUN_IT_FROM_HERE_DOWNLOAD_THE_RELEASE_ZIP_INSTEAD",
27
- "bin/monkey.png",
28
27
  "bin/sensible-cinema",
29
28
  "bin/sensible-cinema-cli",
30
29
  "business_ideas.txt",
@@ -36,6 +35,7 @@ Gem::Specification.new do |s|
36
35
  "gocreatemode.bat",
37
36
  "gplv3.txt",
38
37
  "how_to_create_your_own_delete_lists.txt",
38
+ "is_it_legal_to_copy_dvds.txt",
39
39
  "legal/md5s.txt",
40
40
  "legal/transcript_mute_vlc.txt",
41
41
  "legal2",
@@ -58,9 +58,9 @@ Gem::Specification.new do |s|
58
58
  "lib/ocr.rb",
59
59
  "lib/overlayer.rb",
60
60
  "lib/play_audio.rb",
61
- "lib/profanity_finder.rb",
62
61
  "lib/screen_tracker.rb",
63
62
  "lib/storage.rb",
63
+ "lib/subtitle_profanity_finder.rb",
64
64
  "lib/swing_helpers.rb",
65
65
  "lib/vlc_programmer.rb",
66
66
  "never_do",
@@ -71,68 +71,12 @@ Gem::Specification.new do |s|
71
71
  "spec/blanker.spec.rb",
72
72
  "spec/common.rb",
73
73
  "spec/convert_image.rb",
74
+ "spec/dragon.srt",
74
75
  "spec/drive_info.spec.rb",
75
76
  "spec/edl_parser.spec.rb",
76
77
  "spec/frame_accurate.spec.rb",
77
78
  "spec/go_line.bat",
78
- "spec/images/black.bmp",
79
- "spec/images/colon.bmp",
80
- "spec/images/hulu_0.bmp",
81
- "spec/images/hulu_2.bmp",
82
- "spec/images/hulu_2_3.bmp",
83
- "spec/images/hulu_2_4.bmp",
84
- "spec/images/hulu_3.bmp",
85
- "spec/images/hulu_3_4.bmp",
86
- "spec/images/hulu_4.bmp",
87
- "spec/images/hulu_4_4.bmp",
88
- "spec/images/hulu_5.bmp",
89
- "spec/images/hulu_7.bmp",
90
- "spec/images/hulu_8.bmp",
91
- "spec/images/hulu_slash.bmp",
92
- "spec/images/netflix_a0.bmp",
93
- "spec/images/netflix_a1.bmp",
94
- "spec/images/netflix_a2.bmp",
95
- "spec/images/netflix_a3.bmp",
96
- "spec/images/netflix_a4.bmp",
97
- "spec/images/netflix_a5.bmp",
98
- "spec/images/netflix_a6.bmp",
99
- "spec/images/netflix_a7.bmp",
100
- "spec/images/netflix_a8.bmp",
101
- "spec/images/netflix_a9.bmp",
102
- "spec/images/netflix_b9.bmp",
103
- "spec/images/vlc_0.bmp",
104
- "spec/images/vlc_2_4.bmp",
105
- "spec/images/vlc_2_6.bmp",
106
- "spec/images/vlc_4.bmp",
107
- "spec/images/vlc_5.bmp",
108
- "spec/images/vlc_6.bmp",
109
- "spec/images/vlc_9.bmp",
110
- "spec/images/vlc_colon.bmp",
111
- "spec/images/youtube_0.bmp",
112
- "spec/images/youtube_1.bmp",
113
- "spec/images/youtube_2_0.bmp",
114
- "spec/images/youtube_2_5.bmp",
115
- "spec/images/youtube_2_6.bmp",
116
- "spec/images/youtube_3_0.bmp",
117
- "spec/images/youtube_4.bmp",
118
- "spec/images/youtube_4_0.bmp",
119
- "spec/images/youtube_5.bmp",
120
- "spec/images/youtube_6.bmp",
121
- "spec/images/youtube_light_0.bmp",
122
- "spec/images/youtube_light_1_3.bmp",
123
- "spec/images/youtube_light_2_1.bmp",
124
- "spec/images/youtube_light_2_3.bmp",
125
- "spec/images/youtube_light_2_9.bmp",
126
- "spec/images/youtube_light_4.bmp",
127
- "spec/images/youtube_light_4_3.bmp",
128
- "spec/images/youtube_light_5.bmp",
129
- "spec/images/youtube_light_5_0.bmp",
130
- "spec/images/youtube_light_8.bmp",
131
- "spec/images/youtube_light_9.bmp",
132
- "spec/images/youtube_small_0.bmp",
133
- "spec/images/youtube_small_2.bmp",
134
- "spec/images/youtube_small_2_0.bmp",
135
- "spec/images/youtube_small_4.bmp",
79
+ "spec/how_to",
136
80
  "spec/keyboard_input.spec.rb",
137
81
  "spec/mencoder_wrapper.spec.rb",
138
82
  "spec/mouse.spec.rb",
@@ -143,7 +87,7 @@ Gem::Specification.new do |s|
143
87
  "spec/overlayer.spec.rb",
144
88
  "spec/screen_tracker.spec.rb",
145
89
  "spec/sensible_cinema_gui.spec.rb",
146
- "spec/silence.wav",
90
+ "spec/subtitle_profanity_finder.spec.rb",
147
91
  "spec/swing_helpers.spec.rb",
148
92
  "spec/test_yaml.yml",
149
93
  "spec/vlc_programmer.spec.rb",
@@ -153,11 +97,8 @@ Gem::Specification.new do |s|
153
97
  "todo.inventionzy.txt",
154
98
  "todo.open_edl_list_org.txt",
155
99
  "todo.subtitle",
156
- "vendor/SetPriority.exe",
157
- "vendor/gocr049.exe",
158
- "vendor/music.wav",
100
+ "vendor/monkey.png",
159
101
  "vendor/readme.txt",
160
- "vendor/unzip.exe",
161
102
  "www/index.html",
162
103
  "zamples/edit_decision_lists/category descriptions.txt",
163
104
  "zamples/edit_decision_lists/dvds/COOL_RUNNINGS.txt",
@@ -168,6 +109,7 @@ Gem::Specification.new do |s|
168
109
  "zamples/edit_decision_lists/dvds/example_delete_list.txt",
169
110
  "zamples/edit_decision_lists/dvds/example_delete_list_that_has_no_cuts_in_it.txt",
170
111
  "zamples/edit_decision_lists/dvds/happiest baby on the block.txt",
112
+ "zamples/edit_decision_lists/dvds/how_to_train_your_dragon.txt",
171
113
  "zamples/edit_decision_lists/dvds/legend_of_the_guardians_the_owls_of_gahoole.txt",
172
114
  "zamples/edit_decision_lists/dvds/making_marriage_work.txt",
173
115
  "zamples/edit_decision_lists/dvds/old_and_inaccurate/White Christmas.txt",
@@ -178,6 +120,8 @@ Gem::Specification.new do |s|
178
120
  "zamples/edit_decision_lists/dvds/old_and_inaccurate/making marriage work.txt",
179
121
  "zamples/edit_decision_lists/dvds/old_and_inaccurate/star_trek_generations_hulu.txt",
180
122
  "zamples/edit_decision_lists/dvds/pack_wedding_2007-03-03.txt",
123
+ "zamples/edit_decision_lists/dvds/sintel_open_source_blender.txt",
124
+ "zamples/edit_decision_lists/dvds/tron_legacy.txt",
181
125
  "zamples/edit_decision_lists/dvds/turn_around_alma_younger.txt",
182
126
  "zamples/edit_decision_lists/netflix/greatest_story_ever_told_netflix.txt",
183
127
  "zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt",
@@ -200,25 +144,6 @@ Gem::Specification.new do |s|
200
144
  s.require_paths = ["lib"]
201
145
  s.rubygems_version = %q{1.5.1}
202
146
  s.summary = %q{an EDL scene-selector/bleeper that works with online players like hulu}
203
- s.test_files = [
204
- "spec/blanker.spec.rb",
205
- "spec/common.rb",
206
- "spec/convert_image.rb",
207
- "spec/drive_info.spec.rb",
208
- "spec/edl_parser.spec.rb",
209
- "spec/frame_accurate.spec.rb",
210
- "spec/keyboard_input.spec.rb",
211
- "spec/mencoder_wrapper.spec.rb",
212
- "spec/mouse.spec.rb",
213
- "spec/mplayer_edl.spec.rb",
214
- "spec/muter.spec.rb",
215
- "spec/ocr.spec.rb",
216
- "spec/overlayer.spec.rb",
217
- "spec/screen_tracker.spec.rb",
218
- "spec/sensible_cinema_gui.spec.rb",
219
- "spec/swing_helpers.spec.rb",
220
- "spec/vlc_programmer.spec.rb"
221
- ]
222
147
 
223
148
  if s.respond_to? :specification_version then
224
149
  s.specification_version = 3
@@ -228,11 +153,13 @@ Gem::Specification.new do |s|
228
153
  s.add_runtime_dependency(%q<rdp-win32screenshot>, [">= 0.0.7.3"])
229
154
  s.add_runtime_dependency(%q<mini_magick>, [">= 3.1"])
230
155
  s.add_runtime_dependency(%q<whichr>, [">= 0.3.6"])
231
- s.add_runtime_dependency(%q<jruby-win32ole>, [">= 0"])
232
156
  s.add_runtime_dependency(%q<rdp-ruby-wmi>, [">= 0"])
157
+ s.add_runtime_dependency(%q<plist>, [">= 0"])
233
158
  s.add_runtime_dependency(%q<ffi>, [">= 0"])
234
159
  s.add_development_dependency(%q<hitimes>, [">= 0"])
235
- s.add_development_dependency(%q<rspec>, [">= 0"])
160
+ s.add_development_dependency(%q<rspec>, ["> 2"])
161
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
162
+ s.add_development_dependency(%q<rake>, [">= 0"])
236
163
  s.add_runtime_dependency(%q<hitimes>, [">= 0"])
237
164
  s.add_runtime_dependency(%q<rspec>, [">= 0"])
238
165
  s.add_runtime_dependency(%q<jeweler>, [">= 0"])
@@ -242,11 +169,13 @@ Gem::Specification.new do |s|
242
169
  s.add_dependency(%q<rdp-win32screenshot>, [">= 0.0.7.3"])
243
170
  s.add_dependency(%q<mini_magick>, [">= 3.1"])
244
171
  s.add_dependency(%q<whichr>, [">= 0.3.6"])
245
- s.add_dependency(%q<jruby-win32ole>, [">= 0"])
246
172
  s.add_dependency(%q<rdp-ruby-wmi>, [">= 0"])
173
+ s.add_dependency(%q<plist>, [">= 0"])
247
174
  s.add_dependency(%q<ffi>, [">= 0"])
248
175
  s.add_dependency(%q<hitimes>, [">= 0"])
249
- s.add_dependency(%q<rspec>, [">= 0"])
176
+ s.add_dependency(%q<rspec>, ["> 2"])
177
+ s.add_dependency(%q<jeweler>, [">= 0"])
178
+ s.add_dependency(%q<rake>, [">= 0"])
250
179
  s.add_dependency(%q<hitimes>, [">= 0"])
251
180
  s.add_dependency(%q<rspec>, [">= 0"])
252
181
  s.add_dependency(%q<jeweler>, [">= 0"])
@@ -257,11 +186,13 @@ Gem::Specification.new do |s|
257
186
  s.add_dependency(%q<rdp-win32screenshot>, [">= 0.0.7.3"])
258
187
  s.add_dependency(%q<mini_magick>, [">= 3.1"])
259
188
  s.add_dependency(%q<whichr>, [">= 0.3.6"])
260
- s.add_dependency(%q<jruby-win32ole>, [">= 0"])
261
189
  s.add_dependency(%q<rdp-ruby-wmi>, [">= 0"])
190
+ s.add_dependency(%q<plist>, [">= 0"])
262
191
  s.add_dependency(%q<ffi>, [">= 0"])
263
192
  s.add_dependency(%q<hitimes>, [">= 0"])
264
- s.add_dependency(%q<rspec>, [">= 0"])
193
+ s.add_dependency(%q<rspec>, ["> 2"])
194
+ s.add_dependency(%q<jeweler>, [">= 0"])
195
+ s.add_dependency(%q<rake>, [">= 0"])
265
196
  s.add_dependency(%q<hitimes>, [">= 0"])
266
197
  s.add_dependency(%q<rspec>, [">= 0"])
267
198
  s.add_dependency(%q<jeweler>, [">= 0"])