exebetche / vlsub

VLC extension to download subtitles from opensubtitles.org
1.35k stars 345 forks source link

streaming video #90

Open jvillasante opened 9 years ago

jvillasante commented 9 years ago

Doesn't work while streaming video. For example, with popcorntime.io In the activate() function I just added the "and" condition and it seems to work

 if vlc.input.item() and vlc.input.item() ~= "" then
    openSub.getFileInfo()
    openSub.getMovieInfo()
  end
db1996 commented 9 years ago

Hello, i still have this issue, even though i added the "and" condidtion, i know a bit of code but nothing from LUA, can you help me?

jvillasante commented 9 years ago

Hello, I don't know much about lua either. What I ended up doing was commenting out the entire thing, forget the and and just comment out the if clause. The only problem with that is that vlsub tries to auto load the title of the current video you're watching and now (with the lines commented out or deleted) you just have to enter the title on the vlsub interface and perform the search by hand. Anyways, at least I can see stuff on Popcorn-Time. Hope this helps.

ghostwan commented 9 years ago

To fix the problem add in the LUA line 1382:

if not file.path then file.path = "/tmp/tmpvideo.mp4" end

And it will works even if you stream

nbara commented 8 years ago

@ghostwan

That doesn't seem to work either. Can you show exactly where in the .lua file we need to put these lines (maybe show one line before and one line after as well)?

RodolfoCastanheira commented 8 years ago

@nbara @ghostwan

The ghostwan code didin't work for me either. But that worked:

if not file.completeName then file.completeName = "thisisabug" end

In line 1415 of the LUA file

RodolfoCastanheira commented 8 years ago

The code above isn't suficient. The search by hash won't work, and to get the search by name working you'll have to add

if not openSub.file.dir then openSub.file.dir = "deleteme" end

Right bellow the line

 -- Determine if the path to the video file is accessible for writing

It'll say something about not saving the subtitle, but just ignore and it'll work. And you will have a deleteme.srt somewhere, probably on your home folder. There are yet other bugs, but with this we at least have the minimal functionality the see our movies :)

ghost commented 8 years ago

http://pastebin.com/SAA62xQs

This modification enabled me to search manually by typing in the name, and download automatically. The downside is it doesn't get the hash even if the movie is non-streaming. I don't know much coding so maybe someone can improve what I did. I have simply replaced isFile value to true and openSub.file.dir value to 'bug' in everywhere.

mihaimetal commented 8 years ago

Change line 1406 to this: file.path = parsed_uri["path"] or item:uri()