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})


Does it actually work? urllib.urlencode encoding the 'folderid' results in a error 400 Bad Request for me when I tested

edit:
nm, got it working

I merged your changes and came up with this:

PHP Code:
# merge contribution by dabinn
        
''
        
# search in current directory
        
if package.folder is not None and (package.folder.id != False or package.folder.id != ''):

            
"'"+str(package.folder.id)+"' in parents"

        
# search for title
        
if package.file is not None and (package.file.title != False or package.file.title != ''):
            
title os.path.splitext(package.file.title)[0]
            if 
!= '':
                
' and '
            
"title contains '" str(title) + "'"

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

Still need to work on this to work in all the cases. Only works in the one case.
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, 18:52
Logout Mark Read Team Forum Stats Members Help
gdrive - Google Drive Video/Music Add-on12