content-editing-movie-player 0.38.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +3 -0
- data/.rvmrc +1 -0
- data/LICENSE.TXT +20 -0
- data/README.TXT +225 -0
- data/Rakefile +206 -0
- data/TODO +740 -0
- data/VERSION +1 -0
- data/_DO_NOT_RUN_IT_FROM_HERE_DOWNLOAD_THE_RELEASE_ZIP_FROM_SOURCEFORGE_INSTEAD +0 -0
- data/bin/sensible-cinema +60 -0
- data/bin/sensible-cinema-cli +161 -0
- data/business_ideas.txt +21 -0
- data/change_log_with_feature_list.txt +952 -0
- data/documentation/DOCUMENTATION_README.TXT +44 -0
- data/documentation/how_to_get_files_from_dvd.txt +30 -0
- data/documentation/is_it_legal_to_copy_dvds.txt +97 -0
- data/documentation/troubleshooting.txt +30 -0
- data/documentation/upconversion.txt +4 -0
- data/experimental_online_player_ocr_readme.txt +45 -0
- data/go +1 -0
- data/go.bat +2 -0
- data/go.sh +1 -0
- data/go_ocr_tracker.bat +1 -0
- data/goc +1 -0
- data/goc.bat +1 -0
- data/goc.sh +1 -0
- data/gpl-2.0.txt +339 -0
- data/gplv3.txt +219 -0
- data/history_and_related_works_list.txt +108 -0
- data/inventionzy_files/cone.png +0 -0
- data/inventionzy_files/md5s.txt +53 -0
- data/inventionzy_files/play_with_inserted_scene.bat +8 -0
- data/inventionzy_files/play_with_overlay.bat +24 -0
- data/inventionzy_files/transcript_mute_vlc.txt +117 -0
- data/legal_draft +23 -0
- data/lib/add_any_bundled_gems_to_load_path.rb +32 -0
- data/lib/auto_window_finder.rb +41 -0
- data/lib/blanker.rb +104 -0
- data/lib/check_installed_mac.rb +34 -0
- data/lib/convert_thirty_fps.rb +20 -0
- data/lib/edl_parser.rb +387 -0
- data/lib/eight_three.rb +28 -0
- data/lib/extract/dumpstream.bat +1 -0
- data/lib/extract/get_init.bat +3 -0
- data/lib/extract/pause_early.rb +13 -0
- data/lib/fake_blanker.rb +35 -0
- data/lib/frame_accurate.rb +3 -0
- data/lib/gui/base.rb +748 -0
- data/lib/gui/create-file.rb +24 -0
- data/lib/gui/create.rb +581 -0
- data/lib/gui/dependencies.rb +219 -0
- data/lib/gui/normal.rb +123 -0
- data/lib/gui/upconvert.rb +284 -0
- data/lib/keyboard_input.rb +60 -0
- data/lib/media_info_parser.rb +27 -0
- data/lib/mouse_forever.rb +19 -0
- data/lib/movie_hasher.rb +27 -0
- data/lib/mplayer_edl.rb +42 -0
- data/lib/muter.rb +87 -0
- data/lib/ocr.rb +125 -0
- data/lib/ocr_seed/netflix_b9.bmp +0 -0
- data/lib/overlayer.rb +373 -0
- data/lib/screen_tracker.rb +269 -0
- data/lib/subtitle_profanity_finder.rb +294 -0
- data/lib/vlc_programmer.rb +112 -0
- data/lib/zoom_player_max_edl.rb +50 -0
- data/never_do +40 -0
- data/notes_for_potential_developers.txt +46 -0
- data/preamble +17 -0
- data/roadmap_possibilities +12 -0
- data/spec/arse.srt +41 -0
- data/spec/auto_window_finder.spec.rb +65 -0
- data/spec/bad_beginning.srt +3778 -0
- data/spec/blanker.spec.rb +60 -0
- data/spec/common.rb +81 -0
- data/spec/convert_image.rb +25 -0
- data/spec/deity_end.srt +11 -0
- data/spec/dragon.srt +34 -0
- data/spec/edl_parser.spec.rb +270 -0
- data/spec/frame_accurate.spec.rb +71 -0
- data/spec/keyboard_input.spec.rb +73 -0
- data/spec/media_info_parser.spec.rb +29 -0
- data/spec/mplayer_edl.spec.rb +100 -0
- data/spec/muter.spec.rb +50 -0
- data/spec/notes +4996 -0
- data/spec/ocr.spec.rb +119 -0
- data/spec/overlayer.spec.rb +440 -0
- data/spec/screen_tracker.spec.rb +318 -0
- data/spec/sensible_cinema_gui.spec.rb +452 -0
- data/spec/subtitle_profanity_finder.spec.rb +224 -0
- data/spec/test_yaml.yml +4 -0
- data/spec/tsmuxer.output +33 -0
- data/spec/vlc_programmer.spec.rb +124 -0
- data/spec/youtube_edl.spec.rb +28 -0
- data/spec/zoom_player_max_edl.spec.rb +29 -0
- data/template_bats/README_DISTRO.TXT +8 -0
- data/template_bats/RUN SENSIBLE CINEMA CLICK HERE WINDOWS.bat +25 -0
- data/template_bats/_DO_NOT_RUN_IT_FROM_HERE_DOWNLOAD_THE_RELEASE_ZIP_FROM_SOURCEFORGE_INSTEAD +0 -0
- data/template_bats/mac/RUN SENSIBLE CINEMA CLICK HERE.command +5 -0
- data/template_bats/mac/advanced--create or edit sensible cinema edit list files.command +3 -0
- data/template_bats/mac/advanced--run-upconverting-video-player.command +3 -0
- data/template_bats/pc/advanced--create or edit sensible cinema edit list files.bat +2 -0
- data/template_bats/pc/advanced--run-upconverting-video-player.bat +2 -0
- data/todo.build_library.txt +11 -0
- data/todo.inventionzy.txt +162 -0
- data/todo.open_edl_list_org.txt +169 -0
- data/todo.propaganda +107 -0
- data/todo.subtitle +17 -0
- data/todo.upconvert +53 -0
- data/upconvert.bat +1 -0
- data/upconvert_from_screen/go_upscaling.bat +12 -0
- data/upconvert_from_screen/go_upscaling_works +0 -0
- data/upconvert_from_screen/old/latest2/combine_video.avs +23 -0
- data/upconvert_from_screen/old/latest2/go_no_upscaling.bat +1 -0
- data/upconvert_from_screen/old/latest2/go_upscaling.bat +12 -0
- data/upconvert_from_screen/old/latest2/push2.GRF +0 -0
- data/upconvert_from_screen/old/latest2/push3.grf +0 -0
- data/upconvert_from_screen/old/latest2/setup_capture_coords.rb +27 -0
- data/upconvert_from_screen/old/latest2/setup_directshow_filter_params.rb +29 -0
- data/upconvert_from_screen/old/latest2/upconvert_from_screen_me2.avs +19 -0
- data/upconvert_from_screen/old/latest_now_possibly_oudated/push2.GRF +0 -0
- data/upconvert_from_screen/old/latest_now_possibly_oudated/upconvert_from_screen_me2.avs +18 -0
- data/upconvert_from_screen/old/position_window.png +0 -0
- data/upconvert_from_screen/old/push_source_desktop.GRF +0 -0
- data/upconvert_from_screen/old/record_screen/record.bat +2 -0
- data/upconvert_from_screen/old/upconvert_from_screen.avs +21 -0
- data/upconvert_from_screen/old/upconvert_from_screen_me.avs +21 -0
- data/upconvert_from_screen/old/upconvert_from_screen_me2.avs +3 -0
- data/upconvert_from_screen/old/upconvert_from_screen_me_push_source.avs +3 -0
- data/upconvert_from_screen/old/uscreen.GRF +0 -0
- data/upconvert_from_screen/old/uscreen_me.GRF +0 -0
- data/upconvert_from_screen/push3.grf +0 -0
- data/upconvert_from_screen/upconvert_from_screen_me2.avs +19 -0
- data/vendor/movie-content-editor-read-only/.metadata/.lock +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.mylyn/.tasks.xml.zip +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.mylyn/repositories.xml.zip +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.mylyn/tasks.xml.zip +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version +1 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version +1 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs +3 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs +14 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs +3 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs +5 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs +3 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat +0 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml +2 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml +2 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml +10 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml +11 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.intro/dialog_settings.xml +4 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml +10 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml +232 -0
- data/vendor/movie-content-editor-read-only/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml +4 -0
- data/vendor/movie-content-editor-read-only/.metadata/version.ini +1 -0
- data/vendor/movie-content-editor-read-only/.project +17 -0
- data/vendor/movie-content-editor-read-only/.pydevproject +11 -0
- data/vendor/movie-content-editor-read-only/.settings/org.eclipse.core.resources.prefs +6 -0
- data/vendor/movie-content-editor-read-only/SubIt.py +171 -0
- data/vendor/movie-content-editor-read-only/VLCMacVideo.py +257 -0
- data/vendor/movie-content-editor-read-only/VideoMac.ui +102 -0
- data/vendor/movie-content-editor-read-only/badwords.txt +4 -0
- data/vendor/movie-content-editor-read-only/blank.srt +4 -0
- data/vendor/movie-content-editor-read-only/edit.py +197 -0
- data/vendor/movie-content-editor-read-only/mergeCommands.py +73 -0
- data/vendor/movie-content-editor-read-only/mute.txt +5 -0
- data/vendor/movie-content-editor-read-only/panda.srt +4235 -0
- data/vendor/movie-content-editor-read-only/panda_custom.txt +3 -0
- data/vendor/movie-content-editor-read-only/panda_edit.srt +4235 -0
- data/vendor/movie-content-editor-read-only/subtitle.py +90 -0
- data/vendor/movie-content-editor-read-only/vlc.py +5579 -0
- data/vendor/movie-content-editor-read-only/vlcwidget.py +154 -0
- data/vendor/mplayer_patches/how_to_doze.bat +6 -0
- data/vendor/mplayer_patches/port_dir/PortIndex.quick +2 -0
- data/vendor/mplayer_patches/port_dir/how_to +20 -0
- data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/Portfile +285 -0
- data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/files/configure.x11.patch +20 -0
- data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/files/llvm-gcc-workaround.patch +11 -0
- data/vendor/mplayer_patches/port_dir/multimedia/rdp-projects/Portfile +43 -0
- data/vendor/mplayer_patches/port_dir_is_for_mac +0 -0
- data/www/content_editor.html +92 -0
- data/www/index.html +47 -0
- data/www/upconverting_movie_player.html +62 -0
- data/www/video reel.jpg +0 -0
- data/www/youtube_edl/.htaccess +44 -0
- data/www/youtube_edl/control_youtube.rhtml +141 -0
- data/www/youtube_edl/dispatch.fcgi +25 -0
- data/www/youtube_edl/render_edited.rb +25 -0
- data/www/youtube_edl/server_this_dir.rb +6 -0
- data/www/youtube_edl/todo +23 -0
- data/www/zoomplayer_max.png +0 -0
- data/zamples/edit_decision_lists/dvds/Harry Potter 2 chamber of secrets.txt +22 -0
- data/zamples/edit_decision_lists/dvds/aa_example_delete_list_that_has_no_cuts_in_it.txt +10 -0
- data/zamples/edit_decision_lists/dvds/aladdin.txt +30 -0
- data/zamples/edit_decision_lists/dvds/bambi.txt +17 -0
- data/zamples/edit_decision_lists/dvds/big_buck_bunny_dvd.txt +23 -0
- data/zamples/edit_decision_lists/dvds/bob the builder pets in a pickle.txt +10 -0
- data/zamples/edit_decision_lists/dvds/bobs_big_plan.txt +10 -0
- data/zamples/edit_decision_lists/dvds/cars_2.txt +26 -0
- data/zamples/edit_decision_lists/dvds/cars_disney.txt +40 -0
- data/zamples/edit_decision_lists/dvds/condor_man_widescreen.txt +22 -0
- data/zamples/edit_decision_lists/dvds/cool runnings.txt +53 -0
- data/zamples/edit_decision_lists/dvds/court_jester.txt +24 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/amazing_grace.txt +49 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/father_goose.txt +41 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/harry_potter_and_the_goblet_of_fire.txt +45 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/hugo.txt +31 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/making_marriage_work.txt +15 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/national_treasure.txt +26 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/percy_jackson_lightening_thief.txt +40 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/percy_jackson_lightening_thief_mute_scary.txt +23 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/prince_of_egypt.txt +28 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/puss_in_boots.txt +33 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/ratatouille.txt +35 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/rio.txt +24 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/test_delete_list_for_experimenting_with.txt +10 -0
- data/zamples/edit_decision_lists/dvds/edls_being_edited/the_explorers.txt +49 -0
- data/zamples/edit_decision_lists/dvds/finding_neverland.txt +32 -0
- data/zamples/edit_decision_lists/dvds/flight_of_the_navigator.txt +40 -0
- data/zamples/edit_decision_lists/dvds/happiest baby on the block.txt +9 -0
- data/zamples/edit_decision_lists/dvds/harry_potter_3_prisoner_of_azkaban.txt +37 -0
- data/zamples/edit_decision_lists/dvds/hitchhiker's_guide_to_the_galaxy.txt +32 -0
- data/zamples/edit_decision_lists/dvds/how_to_train_your_dragon.txt +25 -0
- data/zamples/edit_decision_lists/dvds/if_a_man_answers.txt +43 -0
- data/zamples/edit_decision_lists/dvds/innerspace.txt +77 -0
- data/zamples/edit_decision_lists/dvds/iq.txt +32 -0
- data/zamples/edit_decision_lists/dvds/king_of_kings.txt +28 -0
- data/zamples/edit_decision_lists/dvds/kung_fu_panda_1.txt +17 -0
- data/zamples/edit_decision_lists/dvds/legend_of_the_guardians_the_owls_of_gahoole.txt +18 -0
- data/zamples/edit_decision_lists/dvds/monsters_vs_aliens.txt +41 -0
- data/zamples/edit_decision_lists/dvds/muppet_treasure_island.txt +21 -0
- data/zamples/edit_decision_lists/dvds/nanny_mcphee.txt +31 -0
- data/zamples/edit_decision_lists/dvds/narnia_voyage_of_the_dawn_treader.txt +16 -0
- data/zamples/edit_decision_lists/dvds/pack_jackson_wedding_2007-03-03.txt +31 -0
- data/zamples/edit_decision_lists/dvds/peter_pan.txt +29 -0
- data/zamples/edit_decision_lists/dvds/remember_the_titans.txt +35 -0
- data/zamples/edit_decision_lists/dvds/sintel_open_source_blender_ntsc_dvd.txt +22 -0
- data/zamples/edit_decision_lists/dvds/snow_white_and_the_7_dwarfs_1937.txt +19 -0
- data/zamples/edit_decision_lists/dvds/speed_racer.txt +47 -0
- data/zamples/edit_decision_lists/dvds/tangled.txt +21 -0
- data/zamples/edit_decision_lists/dvds/tron_legacy.txt +29 -0
- data/zamples/edit_decision_lists/dvds/turn_around_alma_younger.txt +17 -0
- data/zamples/edit_decision_lists/files/conference_music_video.txt +10 -0
- data/zamples/edit_decision_lists/netflix_instant/avatar-last-air-bender-movie.txt +13 -0
- data/zamples/edit_decision_lists/netflix_instant/avatar-last-airbender-series.txt +1 -0
- data/zamples/edit_decision_lists/netflix_instant/greatest_story_ever_told_netflix.txt +10 -0
- data/zamples/edit_decision_lists/netflix_instant/wrinkle-in-time.txt +23 -0
- data/zamples/edit_decision_lists/notes_on_movies_without_edls_yet/tron.txt +10 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/White Christmas.txt +15 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/all_dogs_go_to_heaven.txt +9 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/cars_disney.txt +24 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/happy_feet.txt +12 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/labyrinth.txt +17 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/dvds/star_trek_generations_hulu.txt +8 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt +14 -0
- data/zamples/edit_decision_lists/old_not_yet_updated/youtube/gummy_bear_song_youtube.txt +9 -0
- data/zamples/edit_decision_lists/youtube/demo_mutes.txt +12 -0
- data/zamples/edit_decision_lists/youtube/nuki_song_youtube.txt +14 -0
- data/zamples/edit_decision_lists/youtube/nuki_song_youtube_pointer.txt +3 -0
- data/zamples/players/how_to_create_more_players.txt +24 -0
- data/zamples/players/hulu/total_length_over_an_hour.txt +25 -0
- data/zamples/players/netflix/netflix_firefox_non_maximized.txt +25 -0
- data/zamples/players/vlc/full_screened_total_length_over_an_hour.txt +27 -0
- data/zamples/players/vlc/windowed_total_length_over_an_hour.txt +26 -0
- data/zamples/players/vlc/windowed_total_length_under_an_hour.txt +22 -0
- data/zamples/players/youtube/full_screened_1024x768.txt +20 -0
- data/zamples/players/youtube/full_screened_1152x864.txt +20 -0
- data/zamples/players/youtube/full_screened_1680x1050.txt +20 -0
- data/zamples/players/youtube/normal_in_youtube.com.chrome.txt +23 -0
- data/zamples/players/youtube/note_these_assume_less_than_10_minutes_length.txt +2 -0
- metadata +483 -0
@@ -0,0 +1 @@
|
|
1
|
+
org.eclipse.core.runtime=1
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projectDescription>
|
3
|
+
<name>movie_editor</name>
|
4
|
+
<comment></comment>
|
5
|
+
<projects>
|
6
|
+
</projects>
|
7
|
+
<buildSpec>
|
8
|
+
<buildCommand>
|
9
|
+
<name>org.python.pydev.PyDevBuilder</name>
|
10
|
+
<arguments>
|
11
|
+
</arguments>
|
12
|
+
</buildCommand>
|
13
|
+
</buildSpec>
|
14
|
+
<natures>
|
15
|
+
<nature>org.python.pydev.pythonNature</nature>
|
16
|
+
</natures>
|
17
|
+
</projectDescription>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<?eclipse-pydev version="1.0"?>
|
3
|
+
|
4
|
+
<pydev_project>
|
5
|
+
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
|
6
|
+
<path>/movie_editor/src</path>
|
7
|
+
<path>/movie_editor</path>
|
8
|
+
</pydev_pathproperty>
|
9
|
+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
|
10
|
+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
|
11
|
+
</pydev_project>
|
@@ -0,0 +1,171 @@
|
|
1
|
+
#Subit
|
2
|
+
# * Version 1.2
|
3
|
+
# * 2009-01-11
|
4
|
+
# * URL: http://www.homeofthehip.com
|
5
|
+
# * Description: Subtitle downloader.
|
6
|
+
# * Author: Magnus Dunker
|
7
|
+
# * Modified by: S. Andrew Ning
|
8
|
+
# * Copyright: Copyright (c) 2009 Magnus Dunker. Use it anyway you like
|
9
|
+
#
|
10
|
+
#@Parameters
|
11
|
+
# -f The name of the avi file or directory. If -f is not specified subit will look in the current directory.
|
12
|
+
# -l A comma delimitered string specifying the language of the subtitles in prioritied order.
|
13
|
+
#
|
14
|
+
#Usage: SubIt.py -f "M:\MyAvis" -l dan,eng
|
15
|
+
|
16
|
+
import time
|
17
|
+
from array import array
|
18
|
+
import struct
|
19
|
+
import os
|
20
|
+
import urllib
|
21
|
+
import sys
|
22
|
+
|
23
|
+
from zipfile import *
|
24
|
+
from xmlrpclib import ServerProxy, Error
|
25
|
+
from urllib2 import Request, urlopen, URLError, HTTPError
|
26
|
+
from optparse import OptionParser
|
27
|
+
|
28
|
+
server = ServerProxy("http://api.opensubtitles.org/xml-rpc")
|
29
|
+
token=""
|
30
|
+
def SubIt():
|
31
|
+
filename=""
|
32
|
+
lang=""
|
33
|
+
movieFound=False
|
34
|
+
parser = OptionParser()
|
35
|
+
parser.add_option("-f", help="name of the file or directory to get subtitles for. If omitted SubIt will look for .avi files in the current directory", dest="filename")
|
36
|
+
parser.add_option("-l", help="comma delimitered string with languages. eg dan,eng. If omitted the default will be english", dest="languages")
|
37
|
+
|
38
|
+
(options, args) = parser.parse_args()
|
39
|
+
|
40
|
+
if options.filename:
|
41
|
+
filename = options.filename
|
42
|
+
if options.languages:
|
43
|
+
lang=options.languages
|
44
|
+
else:
|
45
|
+
lang="eng"
|
46
|
+
|
47
|
+
|
48
|
+
if filename=="" or os.path.isdir(filename) == True:
|
49
|
+
if(os.path.isdir(filename) == True):
|
50
|
+
directory = filename
|
51
|
+
else:
|
52
|
+
directory=os.getcwd()
|
53
|
+
for root, dirs, files in os.walk(directory):
|
54
|
+
for fname in files:
|
55
|
+
extension = os.path.splitext( fname )[1]
|
56
|
+
if extension==".avi":
|
57
|
+
movieFound=True
|
58
|
+
FindSubtitles(root +"\\"+ fname,lang)
|
59
|
+
|
60
|
+
else:
|
61
|
+
FindSubtitles(filename,lang)
|
62
|
+
movieFound=True
|
63
|
+
if not movieFound:
|
64
|
+
print "No movies found in '"+os.getcwd()+"'"
|
65
|
+
|
66
|
+
raw_input("Done... press enter ")
|
67
|
+
def FindSubtitles(videoname,lang):
|
68
|
+
print "Contacting www.opensubtitles.org ("+videoname+")"
|
69
|
+
filename = os.path.dirname(videoname) + "\\" +os.path.splitext(os.path.basename(videoname))[0]+ ".srt"
|
70
|
+
|
71
|
+
langs=lang.split(",")
|
72
|
+
|
73
|
+
data=GetSubtitles(videoname);
|
74
|
+
found=False
|
75
|
+
if data:
|
76
|
+
for l in langs:
|
77
|
+
for item in data:
|
78
|
+
if item['SubLanguageID']== l and not found:
|
79
|
+
print "Found", item['LanguageName'], "subtitle ..."
|
80
|
+
zipname=Download(item['ZipDownloadLink'],item['SubFileName'])
|
81
|
+
print "Extracting subtitle ",filename
|
82
|
+
Unzip(zipname,filename)
|
83
|
+
os.remove(zipname)
|
84
|
+
found=True
|
85
|
+
else:
|
86
|
+
print "No Subtitles found"
|
87
|
+
|
88
|
+
def GetSubtitles(moviepath ):
|
89
|
+
#print server.LogIn("","","","SubIt")['status']
|
90
|
+
try:
|
91
|
+
token=server.LogIn("","","","SubIt")['token']
|
92
|
+
except:
|
93
|
+
print "opensubtitles.org server is not online at the moment. please try again later."
|
94
|
+
exit(1);
|
95
|
+
|
96
|
+
moviebytesize = os.path.getsize(moviepath)
|
97
|
+
hash=Compute(moviepath)
|
98
|
+
movieInfo = {'sublanguageid' : 'eng','moviehash' : hash, 'moviebytesize' : moviebytesize}
|
99
|
+
movies=[movieInfo]
|
100
|
+
data=server.SearchSubtitles(token,movies)['data']
|
101
|
+
|
102
|
+
# if the hash fails, try searching by title of movie (assuming file is named after its title)
|
103
|
+
if (data == False):
|
104
|
+
basename = os.path.basename(moviepath)
|
105
|
+
name = os.path.splitext(basename)[0]
|
106
|
+
print "Could not find by hash ..."
|
107
|
+
print "Searching by name: \"" + name + "\""
|
108
|
+
movieInfo = {'sublanguageid' : 'eng','query' : name}
|
109
|
+
movies=[movieInfo]
|
110
|
+
data=server.SearchSubtitles(token,movies)['data']
|
111
|
+
|
112
|
+
server.LogOut()
|
113
|
+
|
114
|
+
return data
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
def Compute(name):
|
119
|
+
try:
|
120
|
+
longlongformat = 'q' # long long
|
121
|
+
bytesize = struct.calcsize(longlongformat)
|
122
|
+
f = file(name, "rb")
|
123
|
+
filesize = os.path.getsize(name)
|
124
|
+
hash = filesize
|
125
|
+
|
126
|
+
if filesize < 65536 * 2:
|
127
|
+
return "SizeError"
|
128
|
+
|
129
|
+
for x in range(65536/bytesize):
|
130
|
+
buffer = f.read(bytesize)
|
131
|
+
(l_value,)= struct.unpack(longlongformat, buffer)
|
132
|
+
hash += l_value
|
133
|
+
hash = hash & 0xFFFFFFFFFFFFFFFF #to remain as 64bit number
|
134
|
+
|
135
|
+
|
136
|
+
f.seek(max(0,filesize-65536),0)
|
137
|
+
for x in range(65536/bytesize):
|
138
|
+
buffer = f.read(bytesize)
|
139
|
+
(l_value,)= struct.unpack(longlongformat, buffer)
|
140
|
+
hash += l_value
|
141
|
+
hash = hash & 0xFFFFFFFFFFFFFFFF
|
142
|
+
|
143
|
+
f.close()
|
144
|
+
returnedhash = "%016x" % hash
|
145
|
+
return returnedhash
|
146
|
+
|
147
|
+
except(IOError):
|
148
|
+
return "IOError"
|
149
|
+
|
150
|
+
def Unzip(zipname,unzipname):
|
151
|
+
z = ZipFile(zipname)
|
152
|
+
for filename in z.namelist():
|
153
|
+
if os.path.splitext(os.path.basename(filename))[1] == ".srt":
|
154
|
+
outfile = file(unzipname, "w")
|
155
|
+
outfile.write(z.read(filename))
|
156
|
+
outfile.close()
|
157
|
+
|
158
|
+
def Download(url,filename):
|
159
|
+
req = Request(url)
|
160
|
+
f = urlopen(req)
|
161
|
+
print "downloading " + url
|
162
|
+
# Open our local file for writing
|
163
|
+
local_file = open(filename+".zip", "w" + "b")
|
164
|
+
#Write to our local file
|
165
|
+
local_file.write(f.read())
|
166
|
+
local_file.close()
|
167
|
+
return filename+".zip"
|
168
|
+
|
169
|
+
|
170
|
+
SubIt()
|
171
|
+
|
@@ -0,0 +1,257 @@
|
|
1
|
+
#! /usr/bin/python
|
2
|
+
|
3
|
+
#import vlc
|
4
|
+
import sys
|
5
|
+
from PyQt4 import QtGui, QtCore, uic
|
6
|
+
from Foundation import *
|
7
|
+
from AppKit import NSView
|
8
|
+
from Quartz import *
|
9
|
+
from CoreFoundation import *
|
10
|
+
import objc
|
11
|
+
from objc import YES, NO, NULL
|
12
|
+
import sip
|
13
|
+
|
14
|
+
#objc.loadBundle("VLCKit",globals(),bundle_path=objc.pathForFramework("/Users/slloyd/Downloads/vlc/projects/macosx/framework/build/Debug/VLCKit.framework"))
|
15
|
+
d='/Users/slloyd/Downloads/vlc/projects/macosx/framework/build/vlc_build_dir'
|
16
|
+
d='/Applications/VLC.app/Contents/MacOS'
|
17
|
+
TIME_RES = 10000
|
18
|
+
|
19
|
+
"""The ideal way to do this would be to use the objc.loadBundle method to import the VLCKit framework already built for VLC.
|
20
|
+
This would ideally build Python wrappers around all of the custom VLC objects we need and allow us to create them in Python
|
21
|
+
directly without having to define the classes ourselves. I wasn't able to get this to work, so for now, I've defined just one
|
22
|
+
of these classes myself (the VLCVideoView class) to allow us to have something that works"""
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
"""Objective C class defined in Python. Lots of signatures to tell objc which methods to call. Some of them are apparently
|
27
|
+
unnecessary, but it wasn't clear to me which were needed and which weren't, so I left them all in. I suspect that they are
|
28
|
+
unnecessary when overriding methods of a parent class, but I haven't confirmed that."""
|
29
|
+
class VLCVideoView(NSView):
|
30
|
+
|
31
|
+
objc.synthesize('delegate', copy=True)
|
32
|
+
objc.synthesize('backColor',copy=True)
|
33
|
+
objc.synthesize('hasVideo', copy=True)
|
34
|
+
|
35
|
+
#Initialize the VLCVideoView object. If running in 64-bit on SnowLeopard, it expects a CGRect rather than an NSRect
|
36
|
+
@objc.signature("@@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
|
37
|
+
# @objc.signature("@@:{CGRect={CGPoint=dd}{CGSize=dd}}")
|
38
|
+
def initWithFrame_(self,rect):
|
39
|
+
self = super(VLCVideoView, self).initWithFrame_(rect)
|
40
|
+
if self is None: return None
|
41
|
+
self._delegate = None
|
42
|
+
self._backColor = NSColor.blackColor()
|
43
|
+
self._fillScreen = NO
|
44
|
+
self._hasVideo = NO
|
45
|
+
self.setStretchesVideo_(NO)
|
46
|
+
self.setAutoresizesSubviews_(YES)
|
47
|
+
|
48
|
+
#probably need to figure out how to assign an appropriate layoutManager, but for now it's None
|
49
|
+
self.layoutManager = None
|
50
|
+
return self
|
51
|
+
|
52
|
+
@objc.signature("@@:")
|
53
|
+
def backColor(self):
|
54
|
+
return self._backColor
|
55
|
+
|
56
|
+
@objc.signature("c@:")
|
57
|
+
def hasVideo(self):
|
58
|
+
return self._hasVideo
|
59
|
+
|
60
|
+
@objc.signature("@@:")
|
61
|
+
def delegate(self):
|
62
|
+
return self._delegate
|
63
|
+
|
64
|
+
@objc.signature("v@:")
|
65
|
+
def dealloc(self):
|
66
|
+
self._delegate = None
|
67
|
+
self._backColor = None
|
68
|
+
if self.layoutManager:
|
69
|
+
self.layoutManager.release()
|
70
|
+
super(VLCVideoView,self).dealloc()
|
71
|
+
|
72
|
+
@objc.signature("v@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
|
73
|
+
def drawRect_(self,aRect):
|
74
|
+
self.lockFocus()
|
75
|
+
self.backColor().set()
|
76
|
+
NSRectFill(aRect)
|
77
|
+
self.unlockFocus()
|
78
|
+
|
79
|
+
@objc.signature("c@:")
|
80
|
+
def isOpaque(self):
|
81
|
+
return YES
|
82
|
+
|
83
|
+
|
84
|
+
@objc.signature("c@:")
|
85
|
+
def fillScreen(self):
|
86
|
+
if self.layoutManager:
|
87
|
+
return self.layoutManager.fillScreenEntirely()
|
88
|
+
return NO
|
89
|
+
|
90
|
+
@objc.signature("v@:c")
|
91
|
+
def setFillScreen_(self,fillScreen):
|
92
|
+
#need to implement
|
93
|
+
return NO
|
94
|
+
|
95
|
+
|
96
|
+
@objc.signature("v@:{CALayer=#{_CALayerIvars=iII^{__CFArray}@^{_CALayerState}^{_CALayerState}^{_CALayerAnimation}[3^{_CALayerTransaction}]}}")
|
97
|
+
def addVoutLayer_(self, aLayer):
|
98
|
+
CATransaction.begin()
|
99
|
+
self.setWantsLayer_(YES)
|
100
|
+
rootLayer = self.layer()
|
101
|
+
aLayer.name = u"vlcopengllayer"
|
102
|
+
if self.layoutManager:
|
103
|
+
self.layoutManager.setOriginalVideoSize_(aLayer.bounds().size())
|
104
|
+
|
105
|
+
rootLayer.setLayoutManager_(layoutManager)
|
106
|
+
rootLayer.insertSublayer_atIndex_(aLayer, 0)
|
107
|
+
aLayer.setNeedsDisplayOnBoundsChange_(True)
|
108
|
+
|
109
|
+
CATransaction.commit()
|
110
|
+
self._hasVideo = YES
|
111
|
+
|
112
|
+
@objc.signature("v@:@")
|
113
|
+
def removeVoutLayer_(self, voutLayer):
|
114
|
+
CATransaction.begin()
|
115
|
+
voutLayer.removeFromSuperlayer()
|
116
|
+
CATransaction.commit()
|
117
|
+
self._hasVideo = NO
|
118
|
+
|
119
|
+
@objc.signature("v@:c")
|
120
|
+
def setStretchesVideo_(self,value):
|
121
|
+
self._stretchesVideo = value;
|
122
|
+
|
123
|
+
|
124
|
+
@objc.signature("v@:@")
|
125
|
+
def addVoutSubview_(self, aView):
|
126
|
+
aView.setFrame_(self.bounds())
|
127
|
+
self.addSubview_(aView)
|
128
|
+
aView.setAutoresizingMask_((NSViewHeightSizable|NSViewWidthSizable))
|
129
|
+
|
130
|
+
@objc.signature("v@:@")
|
131
|
+
def removeVoutSubview_(self, view):
|
132
|
+
#not doing anything right now
|
133
|
+
pass
|
134
|
+
|
135
|
+
@objc.signature("c@:")
|
136
|
+
def stretchesVideo(self):
|
137
|
+
return self._stretchesVideo
|
138
|
+
|
139
|
+
@objc.signature("v@:@")
|
140
|
+
def didAddSubview_(self, subview):
|
141
|
+
pass
|
142
|
+
# NSLog(u'A subview was added')
|
143
|
+
|
144
|
+
# def __del__(self):
|
145
|
+
# self._delegate = None
|
146
|
+
# self._backColor = None
|
147
|
+
# self.layoutManager = None
|
148
|
+
|
149
|
+
#app = QtGui.QApplication(sys.argv)
|
150
|
+
|
151
|
+
|
152
|
+
"""This is the QtGui widget that will actually hold our video NSView video object defined above"""
|
153
|
+
class MacVideo(QtGui.QWidget):
|
154
|
+
|
155
|
+
def __init__(self, parent=None):
|
156
|
+
super(MacVideo,self).__init__(parent)
|
157
|
+
self.videoLayout = QtGui.QVBoxLayout()
|
158
|
+
self.videoLayout.setContentsMargins(0,0,0,0)
|
159
|
+
self.setLayout(self.videoLayout)
|
160
|
+
|
161
|
+
|
162
|
+
def createVideoWindow(self,media_player):
|
163
|
+
videoWidget = QtGui.QMacCocoaViewContainer(None)
|
164
|
+
self.videoLayout.addWidget(videoWidget)
|
165
|
+
videoView = VLCVideoView.alloc().init()
|
166
|
+
videoWidget.setCocoaView(sip.voidptr(objc.pyobjc_id(videoView)))
|
167
|
+
media_player.set_nsobject(objc.pyobjc_id(videoView))
|
168
|
+
videoView.release()
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
class MacPlayer(QtGui.QWidget):
|
174
|
+
|
175
|
+
|
176
|
+
def __init__(self, player, parent=None):
|
177
|
+
super(MacPlayer,self).__init__(parent)
|
178
|
+
self.media_player = player
|
179
|
+
self.instance = self.media_player.get_instance()
|
180
|
+
self.videoWidget = None
|
181
|
+
|
182
|
+
#import the Qt interface defined in VideoMac.ui
|
183
|
+
self.win = uic.loadUi("VideoMac.ui")
|
184
|
+
|
185
|
+
"""the poller is just a simple way to create an event to update the
|
186
|
+
position slider and do any other interface updates we need"""
|
187
|
+
self.poller = QtCore.QTimer(self)
|
188
|
+
|
189
|
+
#connect all of the buttons and sliders defined in the imported interface
|
190
|
+
self.poller.timeout.connect(self.updateInterface)
|
191
|
+
self.positionSlider = self.win.positionSlider
|
192
|
+
self.positionSlider.setMaximum(TIME_RES)
|
193
|
+
self.positionSlider.sliderPressed.connect(self.positionChanging)
|
194
|
+
self.positionSlider.sliderReleased.connect(self.positionChanged)
|
195
|
+
self.win.pauseButton.clicked.connect(self.play_pause)
|
196
|
+
self.win.stopButton.clicked.connect(self.stop)
|
197
|
+
|
198
|
+
#start the poller and tell it to timeout every .1 s
|
199
|
+
self.poller.start(100)
|
200
|
+
|
201
|
+
#create the actual widget that will hold the vlc video
|
202
|
+
videoWidget = MacVideo()
|
203
|
+
videoWidget.createVideoWindow(self.media_player)
|
204
|
+
self.win.videoLayout.setContentsMargins(0,0,0,0)
|
205
|
+
self.win.videoLayout.addWidget(videoWidget)
|
206
|
+
self.win.show()
|
207
|
+
|
208
|
+
|
209
|
+
def play(self):
|
210
|
+
self.media_player.play()
|
211
|
+
self.show()
|
212
|
+
|
213
|
+
|
214
|
+
# right now if you try to stop the player on a mac, it crashes the program
|
215
|
+
def stop(self, checked):
|
216
|
+
# if self.videoWidget:
|
217
|
+
# self.videoWidget= None
|
218
|
+
# if self.media_player.get_media() is not None and self.media_descr is not None:
|
219
|
+
# self.media_player.stop()
|
220
|
+
# self.isPlaying = False
|
221
|
+
# self.media_player.stop()
|
222
|
+
return
|
223
|
+
|
224
|
+
def changeVolume(self, newVolume):
|
225
|
+
self.instance.audio_set_volume(newVolume)
|
226
|
+
|
227
|
+
def positionChanging(self):
|
228
|
+
self.poller.stop()
|
229
|
+
|
230
|
+
def positionChanged(self):
|
231
|
+
self.changePosition()
|
232
|
+
self.poller.start(100)
|
233
|
+
|
234
|
+
def play_pause(self,checked):
|
235
|
+
if checked or self.media_player.is_playing():
|
236
|
+
self.media_player.pause()
|
237
|
+
else:
|
238
|
+
self.media_player.play()
|
239
|
+
|
240
|
+
def changePosition(self, newPosition=None):
|
241
|
+
if not self.media_player.is_playing():
|
242
|
+
return
|
243
|
+
if self.media_player.get_media() is None:
|
244
|
+
return
|
245
|
+
newPosition = self.positionSlider.sliderPosition()
|
246
|
+
self.media_player.set_position(float(newPosition)/float(TIME_RES))
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
def updateInterface(self):
|
251
|
+
if not self.media_player.is_playing():
|
252
|
+
return
|
253
|
+
if self.media_player.get_media() is None:
|
254
|
+
return
|
255
|
+
a = self.media_player.get_position()
|
256
|
+
self.positionSlider.setValue(self.media_player.get_position()*TIME_RES)
|
257
|
+
|