
download_opensubtitle
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
This is a service menu to download subtitles from opensubtitle.org
just right click on a video file -> actions -> download subtitle, it will show you a list of subtitles select one and it will be downloaded and saved with the same name as the video (with a subtitle extension of course), so your player will detect automatically the subtitle
The search is done extracting a hash from the file, this way you will get the correct subtitle for sure (no more async problems)
thank you to opensubtitles.org for that great service, hope this will be implemented directly in media players
- To install:
KDE3: Copy download_subtitle.desktop to ~/.kde/share/apps/konqueror/servicemenus
KDE4: Copy download_subtitle.desktop to ~.kde/share/kde4/services/ServiceMenus
Copy download_subtitle.py to some dir of your path (i.e. ~/bin)
- Dependencies:
python
wget
kdialog
The default language is english, you can change it in the python file
7 years ago
Added support for the new OpenSubtitles API - Thanks Nicola Felice!
7 years ago
Added support for the new OpenSubtitles API - Thanks Nicola Felice!
ariacorrente
5 years ago
http://kde-apps.org/content/show.php/kdeServiceMenuOpenSubtitles?content=169223
The problem was caused by OpenSubtitles.org guys changing the user agent used for development purposes used by this script. Now i requested a regulard user agent so this wont happen anymore. I've also made some minor changes in the dialogs but everything else is the same.
Report
joopbraak
9 years ago
session = server.LogIn("","","en","python")
to
session = server.LogIn("","","en","OS Test User Agent")
Report
vimania
6 years ago
Login failed:
415 Disabled user agent
Report
ariacorrente
5 years ago
http://kde-apps.org/content/show.php/kdeServiceMenuOpenSubtitles?content=169223
The problem was caused by OpenSubtitles.org guys changing the user agent used for development purposes used by this script.
Report
siavash8
9 years ago
Report
siavash8
9 years ago
Report
zipizap123
10 years ago
1- Download the script using this page "download" button
2- Open a console in the folder where you downloaded the script
3- Untar the downloaded file (it will create a directory named "download_opensubtitle/".). Type in the console:
[b]
tar -zxvf 65444-download_opensubtitle.tar.gz"
[\b]
4- Install the Service-menu-script file to the correct location (the following destination directory is for KDE4. For KDE3 it is different). Type in the console:
[b]
ServiceMenu_script_file_kde4="download_opensubtitle/kde4/download_opensubtitle.desktop"
Destination_dir_kde4="$HOME/.kde/share/kde4/services/ServiceMenus"
mkdir -p $Destination_dir_kde4
cp -v $ServiceMenu_script_file_kde4 $Destination_dir_kde4
[\b]
4.99- At the current version 0.3 of the script there is an error in line 56 (as explained by <<eneko>> in the above comments) of the python file, and it needs to be corrected so that it works. Type this in the console to correct it:
[b]
sed --in-place 's_http://www.opensubtitles.org/xml-rpc_http://api.opensubtitles.org/xml-rpc_g' download_opensubtitle/download_opensubtitle.py
[\b]
5- Install the python file to "/usr/local/bin"
[b]
Python_file_kde4="download_opensubtitle/download_opensubtitle.py"
cp -v $Python_file_kde4 /usr/local/bin
[\b]
6- Check that your system has all the needed dependencies (most probably it will already have them installed, but if not just you can install them this way). Type this in a console, inserting your password when asked:
sudo apt-get install wget python
And you are done - it will be working by now, try it in konqueror :)
My respects to the creator and to eneko for the great sharings - this post is intended to make an updated resume of how to make this service-menu-script work without worries.
Hope to see this comment replied some day with something like "thanks" or maybe even with a "no-more-need-for-this-as-the-script-has-been-updated-by-author" :)
zipizap
Report
zipizap123
10 years ago
simply ignore completely all the "[b]" and "[\b]" and it will work
Report
zipizap123
10 years ago
1- Download the script using this page "download" button
2- Open a console in the folder where you downloaded the script
3- Untar the downloaded file (it will create a directory named "download_opensubtitle/".). Type in the console:
[b]
tar -zxvf 65444-download_opensubtitle.tar.gz"
[\b]
4- Install the Service-menu-script file to the correct location (the following destination directory is for KDE4. For KDE3 it is different). Type in the console:
[b]
ServiceMenu_script_file_kde4="download_opensubtitle/kde4/download_opensubtitle.desktop"
Destination_dir_kde4="$HOME/.kde/share/kde4/services/ServiceMenus"
mkdir -p $Destination_dir_kde4
cp -v $ServiceMenu_script_file_kde4 $Destination_dir_kde4
[\b]
4.99- At the current version 0.3 of the script there is an error in line 56 (as explained by <<eneko>> in the above comments) of the python file, and it needs to be corrected so that it works. Type this in the console to correct it:
[b]
sed --in-place 's_http://www.opensubtitles.org/xml-rpc_http://api.opensubtitles.org/xml-rpc_g' download_opensubtitle/download_opensubtitle.py
[\b]
5- Install the python file to "/usr/local/bin"
[b]
Python_file_kde4="download_opensubtitle/download_opensubtitle.py"
cp -v $Python_file_kde4 /usr/local/bin
[\b]
6- Check that your system has all the needed dependencies (most probably it will already have them installed, but if not just you can install them this way). Type this in a console, inserting your password when asked:
sudo apt-get install wget python
And you are done - it will be working by now, try it in konqueror :)
My respects to the creator and to eneko for the great sharings - this post is intended to make an updated resume of how to make this service-menu-script work without worries.
Hope to see this comment replied some day with something like "thanks" or maybe even with a "no-more-need-for-this-as-the-script-has-been-updated-by-author" :)
zipizap
Report
danux
11 years ago
Report
oeglesius
12 years ago
Quote:
Traceback (most recent call last):
File "download_opensubtitle.py", line 64, in <module>
token = session["token"]
KeyError: 'token'
Any ideas what went wrong?
Thanks,
Stefan
Report
eneko
10 years ago
Line 56:
BEFORE (wrong)
server = ServerProxy("http://www.opensubtitles.org/xml-rpc")
AFTER (correct)
ServerProxy("http://api.opensubtitles.org/xml-rpc")
Changing the URL solved the problem for me, hope it helps anyone else.
Nice work Hirs!
Eneko
Report
amigib
13 years ago
thanks for this script
Report
califdreas
13 years ago
Report
d1rice
13 years ago
Report
Hirs
13 years ago
Found codes here:
http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
Remember that may be there are subtitles for that title but not for that file
Report
d1rice
13 years ago
i think it should be hrv because when i click on the link: Find all subtitles for this movie in this language... it takes me to this page: http://www.opensubtitles.org/en/search/sublanguageid-hrv/idmovie-3561
Report
Aikurn
13 years ago
And I like the widget style you're using, specially the first shot. What is it?
Report
dsec
13 years ago
Report
Hirs
13 years ago
Report
knot
13 years ago
I've tried your servicemenu and I noticed that it has problems with files containing spaces.
I believe it can be fixed by adding apostrophes around destination file in wget command:
response = os.system('wget -O - ' + subURL + ' | gunzip > ' + "'" + subDirName + '/' + subFileName + "'" ).
I wanted to send you a patch but I was not able to find your mail address. You can contact me at petr(dot)uzel(at)centrum(dot)cz
Report
hosein-mec
13 years ago
Report
hosein-mec
13 years ago
Report
Hirs
13 years ago
Or may be something went wrong with wget, do you have wget installed?
Report
hosein-mec
13 years ago
Report