download_tvsubtitles.net

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
Score 50.0%
Description:

This is a service menu to download subtitles from tvsubtitles.net

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

Install:
Copy download_tvsubtitle.desktop to ~.kde/share/kde4/services/ServiceMenus
Copy download_tvsubtitles.net.py to some dir of your path (i.e. ~/bin)

- Dependencies:
python
wget
kdialog

You may also be interested in:
http://kde-apps.org/content/show.php/download_opensubtitle?content=65444

Bram77

10 years ago

The script is not working because it can not handle the filename.

This filename will result in an error...
/storage/Programs/download_tvsubtitles.net.py "Smallville - S02E06 - Redux.avi"

Show: "smallville -"
Season: 2
Episode: 06
sh: zenity: not found


And this one does work well... (I have to rename the subtitle file manually to match the video file).

/storage/Programs/download_tvsubtitles.net.py "Smallville S02E06.avi"

Show: "smallville"
Season: 2
Episode: 06
episode-97.html
['English subtitles (DVD)', 'French subtitles ', 'Russian subtitles ', 'Hungarian subtitles (DVD)']



Report

revertex

10 years ago

thanks theccm, with your fixes it works as expected now, i can download just fine, and select any available language other than English.

Report

theccm

10 years ago

ok answer to myself, the broken pipe problem occurs when you have space in filename.

However, in my case it downloads always english subtitle 'cause the following code does not work :

for name in names:
if name == resp:
j=i
i=i+1

because if you select 3rd line, <resp> will equal "2" and <name> will equal "Italian subtitle" so the test never works and j will always equal "0"

btw i don't understand why you do this test ?

I removed it and dit the following change :

link = url + "download-" + links[j][10:]

becomes :

link = url + "download-" + links[int(resp)][10:]

--
Qt: 4.4.3
KDE: 4.2.1 (KDE 4.2.1)
KDialog: 1.0

Report

theccm

10 years ago

ok answer to myself, the broken pipe problem occurs when you have space in filename.

However, in my case it downloads always english subtitle 'cause the following code does not work :

for name in names:
if name == resp:
j=i
i=i+1

because if you select 3rd line, <resp> will equal "2" and <name> will equal "Italian subtitle" so the test never works and j will always equal "0"

btw i don't understand why you do this test ?

I removed it and dit the following change :

link = url + "download-" + links[j][10:]

becomes :

link = url + "download-" + links[int(resp)][10:]

--
Qt: 4.4.3
KDE: 4.2.1 (KDE 4.2.1)
KDialog: 1.0

Report

theccm

10 years ago

here is the log from konsole, I think it's a "space in filename" problem or something like this...
does apply with 4 differents videos didn't find one which work
--
thanks!

['English subtitles ', 'English subtitles (DVD.ORPHEUS)', 'Spanish subtitles ', 'French subtitles (HDTV.NoTV)', 'Russian subtitles (HR HDTV)', 'Greek subtitles ', 'Hungarian subtitles (HDTV.NoTV)', 'Polish subtitles (HDTV)']
/subtitle-8826.html
gzip: S02E04.gz: No such file or directory

gzip: stdin: Bad file descriptor
--2009-03-09 23:48:35-- http://www.tvsubtitles.net/download-8826.html
Résolution de www.tvsubtitles.net... 213.155.5.112
Connexion vers www.tvsubtitles.net|213.155.5.112|:80... gzip: S02E04.gz: No such file or directory

gzip: stdin: Bad file descriptor
connecté.
requête HTTP transmise, en attente de la réponse... 302 Found
Emplacement: http://f.tvsubtitles.net/Dexter_2x04_en.zip [suivant]
--2009-03-09 23:48:35-- http://f.tvsubtitles.net/Dexter_2x04_en.zip
Résolution de f.tvsubtitles.net... 87.118.126.180
Connexion vers f.tvsubtitles.net|87.118.126.180|:80... connecté.
requête HTTP transmise, en attente de la réponse... 200 OK
Longueur: 21820 (21K) [application/zip]
Saving to: `STDOUT'

0% [ ] 0 --.-K/s in 0s


Ne peut écrire dans « - » (Relais brisé (pipe)).

Report

theccm

10 years ago

workaround:

replace:
response = os.system("wget -O - \"" + link + "\" |zcat > " + subName )


with:
response = os.system("wget -O - \"" + link + "\" |zcat > \'" + subName + "\'")

Report

Sciamano72

10 years ago

I'm still using KDE3, so I copied the .desktop file to the ~/.kde/share/apps/konqueror/servicemenus folder.
It searches for the subtitles file, but if I try to download it, Konqueror gives the following error:

An error ocurred downloading or writing the subtitle

Also tried the alternative python file posted on the comment above, but that does not work at all for me.

Report

golgoth

10 years ago

Hum, strange because it works really well for me, i'm under KDE4 but it's actually not relevant, it should work under KDE3 too.

Could you try my version by opening a console and type the following:

/path/to/download_tvsubtitles.net.py /full/path/to/your/video/file.avi

If it doesn't work it should give you an error, please copy/paste it here.

Report

Sciamano72

10 years ago

This is what it says:

bash: /home/luca/bin/download_tvsubtitles.net2.py: /usr/bin/python^M: bad interpreter: No such file or directory

I'm sure the problem is that "^M", but I have no idea about what it is

Report

golgoth

10 years ago

Ok I think, some extra characters were added when you copied/pasted the code from the link I posted. What editor do you use ?

Try kate or kwrite and check if you actually see these strange characters in order to remove them.

Report

golgoth

10 years ago

Ok easier way, I've posted it there: http://www.yousendit.com/download/WnBUa3ZKQk5rWThLSkE9PQ

Report

Sciamano72

10 years ago

I actually downloaded it from the first site. Did not copy/paste.
I use Kate anyway... I'll try the last link now.

Report

Sciamano72

10 years ago

Now it works perfectly. Thanks!!!

Report

golgoth

10 years ago

Hi,

It wasn't working for me (there is a 5 seconds delay on the subtitle html page) so I made some changes to "download_tvsubtitles.net.py". You can find my version here: http://pastebin.com/f205a3f24

Subtitles are located at http://tvsubtitles.net/files/ so the trick is to get the filename from inside the html file. (This filename is actually splitted over 3 variables: s2, s3 and s4)

What do you think about it?

Cheers,
Tom

Report

12345678910
product-maker Base: 4 x 5.0 Ratings
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
0.1
updated Jan 17 2009
added Jan 17 2009
downloads 24h
0
page views 24h 2
System Tags addon