Release gdrive - Google Drive Video/Music Add-on
(2016-03-12, 10:10)dabinn Wrote:
(2016-03-11, 14:23)dmdsoftware Wrote:
(2016-03-11, 09:23)dabinn Wrote: Hi,
Something is wrong with .ass subtitle in v0.7.45.
Click on a video, after the 'Choose a stream' dialog, screen stopped at 'Bufering... 100%' for several minutes. (KODI was not freeze, but it will crash if I hit stop button at this moment)
I also test video files with idx/sub subtitle, same situation. Only srt subtitle is OK.

If I know how to print/output debug message from the python code, I may able to help debugging this.


--
Update:
I still don't know why xbmc.log('debug string', xbmc.LOGERROR) did not update my kodi.log.
Finally I have setup the pydev debugger, and will try to trace the subtitle issue.

To activate the debugger, you can add the following two lines to your settings.xml

<setting id="remote_debugger" value="true" />
<setting id="remote_debugger_host" value="localhost" />

Hi,
I am still testing and tracing the code, some foundings here:
* The sub/ass loading freeze issue
I fount this is not cause by ass file type, but the amount of subtitle files in the same directory.
In function cache.setSRT(), file title did not pass to service.getSRT(). So that the service.getSRT() always returns all the subtitle file, no mater their filename matches the video file or not. (Is this by design?)
If cachePath was not set, each subttile file url will cause a 10 second timeout(approx.) to load.
(each generate an error message like :
14:22:30 T:7224 ERROR: CCurlFile::Stat - Failed: Timeout was reached(28) for https://doc-14-c4-docs.googleusercontent...34rgexxxxx...)
For example, a directory with TV series EP01~15, there will be 15 subtitles read, and takes 150 seconds waiting timeout.

* Wrong subtitle
When I test with cachePath set, wrong subtitle is displayed when playing TV series.

* Chinese subtitle filename massed up
In default.py, after 'files = cache.getSRT(service)'
file = file.decode('unicode-escape')
file = file.encode('utf-8')
These causes Chinese subtitle filename unable to load.


-------------
Update:
I have successfully fixed the subtitle issue by passing the title string to service.getSRT() and querying "title contains 'xxxx'" in google api.
All subtitles are displayed correctly, but I need more test to ensure there is no side effect.

I don't know how to commit code, so I paste the code I modified here:
In default.py:
Code:
cache.setSRT(service, title)
In cache.py
Code:
def setSRT(self, service, title):
....
srt = service.getSRT(title, self.package.folder.id)
...
srt = service.getSRT(title, self.package.folder.id)

In gdrive_api2.py
Code:
def getSRT(self, title, folderid):
...
        q='';
        # search in directory
        if folderid != False:
            q = q + "'"+str(folderid)+"' in parents"

        # search for title
        if title != False:
            title = os.path.splitext(title)[0]
            encodedTitle = re.sub(' ', '+', title)
            #url = url + "?q=title+contains+'" + str(encodedTitle) + "'"
            q = q + " and title contains '"+title+"'"

        url = url + "?" + urllib.urlencode({'q':q})

It sounds like you have the load srt from same directory enabled in the settings. It was meant to search and load subtitles when the user doesn't have the title of the SRT the same name as the video.

So I need to rethink things a bit.

There are the following situations that need to be satisfied:

1) videofile.mp4 with videofile.*.srt (1 video per directory)
2) videofile.mp4 with language.srt (1 video per directory)
3) videofile.series.mp4 with videofile.series.*.srt (multiple videos)
4) videofile.series.mp4 with language.series.*.srt (multiple videos)
5) videofile.mp4 with videofile.*.srt in a different directory

The current solution works 1,2,3,5 but you need to toggle a setting (switch between 1/3/5 and 2) otherwise 3 and 4 will cause severe issues. Your solution will work with 1 and 3.

I think I really need a solution similar to yours that will drop the need for the user to toggle a setting to change the behaviour.

1. search all srt in the directory then sub-search for title.*.srt, if match, load
2. if no match in 1, and there is only 1 srt, load
3. if no match in 1 but there are multiple srt, user prompt to select
4. if no srt returned in 1, research all srt with title across account, if match, load

I think that will handle 1)-5) situations. Thoughts?

The reason for the decoding was unicode characters would appear as squares.

edit:
I realize now that I somehow dropped the logic that switches between the search for title vs search for all srt in folder (setting: srt_folder). I don't know how that happened.
Reply


Messages In This Thread
u - by Kraevin - 2015-05-13, 17:37
RE: [RELEASE] gdrive - Google Drive Video/Music Add-on - by dmdsoftware - 2016-03-12, 15:55
Logout Mark Read Team Forum Stats Members Help
gdrive - Google Drive Video/Music Add-on12