[Script] Download subtitles on-the-fly

Discuss your Lua playlist, album art and interface scripts.
Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby Jean-Baptiste Kempf » 27 Jan 2011 04:14

It would be cool to have an update :D
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

aciidb0mb3r
New Cone
New Cone
Posts: 3
Joined: 13 Feb 2011 16:41

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby aciidb0mb3r » 13 Feb 2011 16:46

Hi , its awesome script.
I was making it for another site but the problem is they check HTTP referrer
is it possible to send custom HTTP referrer while requesting the url?

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby ivoire » 14 Feb 2011 23:10

Couldn't you use the "http-referrer" option ? If you gave it to vlc as an input item option it might work (":http-referrer bla").

aciidb0mb3r
New Cone
New Cone
Posts: 3
Joined: 13 Feb 2011 16:41

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby aciidb0mb3r » 15 Feb 2011 04:06

i tried didnt work

svkpd
New Cone
New Cone
Posts: 7
Joined: 19 Jul 2010 11:13

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby svkpd » 05 May 2011 16:08

It is working, but I have a question.. do you use hash function for best suited results? I am making java version of OS downloader right now and I get lots of results even when I search with hashes. I checked your code and havent found any usage of hashes, so I am asking.. And very nice feature would be automatic upload of users subtitles, if they watched ~60% of video (so there is pretty good chance the subtitles fit). Maybe as an idea into the future.

Btw, java version of my downloader, it is school project and still in developement. However, it works, there are just some bugs somewhere (sorry for slovak language, try google translate)
http://student.fiit.stuba.sk/~dulacka09 ... lenet.html

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby ale5000 » 13 May 2011 03:30

I haven't much time but I'm still here, if someone add hash functions to VLC itself and expose them to LUA then it will add hash searching in my script; but doing hashing directly from LUA is a thing that I want to avoid.

Upload is difficult, but if someone has a (pratical) suggestion of how implement it, I will do it.
I'm not sure if it is possible with current VLC, because I need to check how much of file is played (with a specific loaded subtitle, not just played and not just with any subtitles), I also need to check the upload part (I have never done it from LUA).
Last edited by ale5000 on 20 May 2011 06:08, edited 1 time in total.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby Jean-Baptiste Kempf » 13 May 2011 11:32

What kind of hash functions do you need?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

svkpd
New Cone
New Cone
Posts: 7
Joined: 19 Jul 2010 11:13

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby svkpd » 13 May 2011 11:40

here are the source code of OpenSubtitles hash computing for all major languages
http://trac.opensubtitles.org/projects/ ... ourceCodes

so the task is to rewrite this in lua. with hash, you can search for subtitles that fits (which could be a gamechanger :))

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby Jean-Baptiste Kempf » 13 May 2011 12:03

They are NOT using standard hash functions? You've got to be kidding me!
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby ale5000 » 13 May 2011 12:32

I have given a better look at the page and it seems to be a lot faster than normal hashing so doing it directly in lua may be feasable; but I haven't even tried and I still hate hashing :D
So I appreciate if someone else create the hashing code either in LUA or directly in VLC.

svkpd
New Cone
New Cone
Posts: 7
Joined: 19 Jul 2010 11:13

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby svkpd » 17 May 2011 21:14

... or directly in VLC.
I believe that full implementation in VLC wouldn't be bad, guys at BSplayer tried it and it is working great for them. I have read a topic with some legal issues concernes when it came to subtitles, but player is not responsible anyway, subtitle servers are (if there were any issues, subtitles are just texts and can not be copywrighted). And it is not a lot of work.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby Jean-Baptiste Kempf » 17 May 2011 23:37

No, legally, given access to a database that is mostly illegal is illegal.

A script is fine then.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby ale5000 » 18 May 2011 01:36

... or directly in VLC.
I believe that full implementation in VLC wouldn't be bad, guys at BSplayer tried it and it is working great for them. I have read a topic with some legal issues concernes when it came to subtitles, but player is not responsible anyway, subtitle servers are (if there were any issues, subtitles are just texts and can not be copywrighted). And it is not a lot of work.
I was referring only to the "hashing code", not the whole subtitle search/download, so there isn't any problem.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: [Beta] Script to download subtitles on-the-fly, need VLC

Postby ale5000 » 19 May 2011 06:17

I think that I will change the name of the script.

If you have a suggestion for a better name, say it.
Last edited by ale5000 on 19 May 2011 17:56, edited 1 time in total.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: [Script] Download subtitles on-the-fly

Postby Jean-Baptiste Kempf » 19 May 2011 11:20

Subtitle Finder?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

svkpd
New Cone
New Cone
Posts: 7
Joined: 19 Jul 2010 11:13

Re: [Script] Download subtitles on-the-fly

Postby svkpd » 19 May 2011 12:22

SubtitleFetcher, SubFinder, SuDo (Subtitle Downloader)..

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: [Script] Download subtitles on-the-fly

Postby ale5000 » 19 May 2011 17:58

Probably I will use "Subtitles Finder", but keep suggesting names.

Tuche
New Cone
New Cone
Posts: 1
Joined: 27 May 2011 15:29

Re: [Script] Download subtitles on-the-fly

Postby Tuche » 27 May 2011 15:31

i am on mac and did put it in the right folder, as mentioned in the first page, but it does not seem to work at all, i do also not see a extension submenu under any menu from vlc . . .

help needed, thanks!

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: [Script] Download subtitles on-the-fly

Postby ale5000 » 27 May 2011 15:35

Edit: Post removed
Last edited by ale5000 on 28 Jun 2011 17:18, edited 1 time in total.

bullride
New Cone
New Cone
Posts: 2
Joined: 28 Jun 2011 11:41

Re: [Script] Download subtitles on-the-fly

Postby bullride » 28 Jun 2011 11:45

Hi all

would anyone please be so kind and tell me how to run the subtitle lua script? i have posted it on the folder mentioned in the post (Running on Mac OSx 10.6.8 / VLC 1.1.10.1) but some how the subtitles are not being downloaded nor shown in any way.

do i have to trigger the script to run or will it just run automatically?

any help appreciated.

cheers

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: [Script] Download subtitles on-the-fly

Postby ale5000 » 28 Jun 2011 17:18

It is manual.
You should see a new entry in the "View" menu, but the Mac interface of VLC is behind.
So probably lua extensions aren't working on Mac.

bullride
New Cone
New Cone
Posts: 2
Joined: 28 Jun 2011 11:41

Re: [Script] Download subtitles on-the-fly

Postby bullride » 30 Jun 2011 17:49

Thanks ale5000, that would make complete sense. i'll give it a try on my win7 machine and see if the menu pops up.

cheers

mono_demon
New Cone
New Cone
Posts: 5
Joined: 19 Oct 2010 10:26

Re: [Script] Download subtitles on-the-fly

Postby mono_demon » 16 Jul 2011 03:39

may i know where is the downloaded subtitle file is saved?

dorin
New Cone
New Cone
Posts: 1
Joined: 09 Sep 2011 04:32

Re: [Script] Download subtitles on-the-fly

Postby dorin » 09 Sep 2011 04:42

It's great, works perfectly,
But, why didn't you added more languages by default?

Seems to be realy easy to add.

Code: Select all

{ title = "Portuguese", tag = "pt" }, { title = "Russian", tag = "ru" }, { title = "Romanian", tag = "ro" } { title = "Spanish", tag = "es" }

ofird
New Cone
New Cone
Posts: 1
Joined: 03 Oct 2011 20:17

Re: [Script] Download subtitles on-the-fly

Postby ofird » 03 Oct 2011 20:27

Thanks for the script, great job!

Also, if you want to download Hebrew as well just edit the script
and add this line to the languages array (at the bottom of the script)

Code: Select all

{ title = "Hebrew", tag = "he" },


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 5 guests