download_opensubtitle

Dolphin Service Menus

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

0
7.3
Description:

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
Last changelog:

5 years ago

Added support for the new OpenSubtitles API - Thanks Nicola Felice!

ariacorrente

4 years ago

I've uploaded a working version named kdeServiceMenuOpenSubtitles here:
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

8 years ago

Try changing
session = server.LogIn("","","en","python")
to
session = server.LogIn("","","en","OS Test User Agent")

Report

vimania

4 years ago

I have a similar problem:

Login failed:
415 Disabled user agent

Report

ariacorrente

4 years ago

I've uploaded a working version here:
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

7 years ago

Thanks. It solved the problem.

Report

siavash8

8 years ago

I did everything that zipizap123 has written and still it doesn't work. When I clock on Download subtitle from opensubtitles.net in the service menu, a task titled "Download Subtitles from opensubtitle" opens for a few seconds, no window, only visible in the task manager, and then it automatically closes without any error or result. Any solution?

Report

zipizap123

8 years ago

The script version 0.3 (last updated in Jan 17 2009) was proved to work in KDE4 (KDE4.4.2), with the following procedure for Kubuntu (or any other debian/ubuntu based system)

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

8 years ago

well, my previous post looks horrible - the BBCode formating is not working and I can't do anything to fix it, not at my control...

simply ignore completely all the "[b]" and "[\b]" and it will work

Report

zipizap123

8 years ago

The script version 0.3 (last updated in Jan 17 2009) was proved to work in KDE4 (KDE4.4.2), with the following procedure for Kubuntu (or any other debian/ubuntu based system)

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

10 years ago

I try the script, but it always crushes... it only displays a dialgobox saying "An Error ocurred".... I tryed to run it from Konsole and I get the same error, but no explanation about what could it be...

Report

oeglesius

10 years ago

When I try downloading subtitles with this script, it crashes with the following error message:

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

8 years ago

URL of the opensubtitles.com API has changed, you must correct this in download_opensubtitle.py:

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

11 years ago

support for rmvb and other formats?

thanks for this script

Report

califdreas

11 years ago

Thank you for this little gem!

Report

d1rice

11 years ago

i can't get it to work with croatian subs, i tried hr, hrv and cro... all i get is: No subtitles found. message, but i know there is at least one.

Report

C

Hirs

11 years ago

Try scr

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

11 years ago

for example i tried this one: http://www.opensubtitles.org/en/subtitles/23530/the-family-man-hr ... it matches almost every line in the movie, and it didn't find anything with scr, hr or hrv...
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

11 years ago

Thanks, it's working great!
And I like the widget style you're using, specially the first shot. What is it?

Report

dsec

11 years ago

Ditto :) What style is it? I can't place the rounded menus, but they look pretty slick.

Report

C

Hirs

11 years ago

It's domino widget style, the best polished style I've ever used

Report

knot

11 years ago

Hi,
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

11 years ago

thanks knot

Report

hosein-mec

11 years ago

An error ocurred downloading or writing the subtitle

Report

C

Hirs

11 years ago

Can you create and write files in your video directory?

Or may be something went wrong with wget, do you have wget installed?

Report

hosein-mec

11 years ago

yes i can create and write files in my directory . and wget is installed

Report

5 years ago

Added support for the new OpenSubtitles API - Thanks Nicola Felice!

12345678910
1
product-maker ariacorrente Mar 16 2015 8 great
product-maker Count:28 Rating: 7.25
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
0.4
updated Dec 28 2013
added Sep 01 2007
downloads today
2
page views today 2
System Tags addon
+