Kodi Community Forum

Full Version: gdrive - Google Drive Video/Music Add-on
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2016-03-15, 11:44)dmdsoftware Wrote: [ -> ]
(2016-03-15, 09:38)dabinn Wrote: [ -> ]
(2016-03-14, 17:07)dmdsoftware Wrote: [ -> ]Can you test out v0.7.46? I've implemented behaviour for 1-5 without having to toggle a setting. I tested them with a few test cases and looks good.

http://dmdsoftware.net/repository.ddurdl...0.7.46.zip
v0.7.46 (2016-03-14)
- SRT - merge contribution by dabinn (dealing with TV series in a single directory)
- add ability to toggle caching of thumbnails and SRT on/off
- fix cache of SRT
- rework SRT logic
1) list of files (multiple languages) from the same folder that exactly match the title of the video
2) list of candidate files that are from the same folder but don't match the title of the video (if exceeds 4, ask user to select -- likely TV series or folder containing multiple movies)

Many thanks, I will test 0.7.46 later today. Smile
I am still testing on Unicode file name issue (File name in Traditional Chinese, Simplified Chinese, Japanese). Something is strange but I am not very sure right now.
If you are interesting in this, here is an .ass subtitle file with 3 Chinese words in the file name.
https://drive.google.com/file/d/0B-IpAlZ...E2ZWc/view

thanks, I will test with the subtitle

I have roughly tested 0.7.46 and found some problem.

* Too many subtitle files are loaded.
If a directory contained 10 video files (file_01~file10.avi), and I played file_08.avi.
- In some directories, subtitle with filename file08~file10 will be loaded.
- In other directories, subtitle with filename file01~file08 will be loaded.

* file name escaping causes problem
In default.py
Code:
files = cache.getSRT(service)
for file in files:
    if file != '':
        try:
            xbmc.log('gdrive_file_before: '+file, xbmc.LOGNOTICE)
            #file = file.decode('unicode-escape')
            file = file.encode('utf-8')
            xbmc.log('gdrive_file_after: '+file, xbmc.LOGNOTICE)

- file name escaping issue 1: Chinese characters in file name are messed up.
Code:
16:37:06 T:9408  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][現視研][GENSHIKEN][01].sub
16:37:06 T:9408  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][c??e|?c??][GENSHIKEN][01].sub
- file name escaping issue 2: On windows, backslash in path string was escaped, subtitle was not loaded.
(In this case "\t" seems to be changed into tab character.)
Code:
17:12:57 T:11296  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass
17:12:57 T:11296  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass

* When cache is turned off
- Windows path and Chinese charactor are OK since filenames are not used when cache is off.
- Each subtitle loaded with a 10 seconds timeout.
While video loading, subtiles cause UI stopped on "Buffering..." message. 1 subtitle takes 10 seconds, 15 subtitles take 150 seconds.
while video playing, switching subtitle (click on KODI UI, subtitle icon --> Next) causes another 10 second timeout before subtitle loaded.
Code:
16:30:19 T:6916   ERROR: CCurlFile::Stat - Failed: Timeout was reached(28) for https://doc-14-c4-docs.googleusercontent.com/docs/securesc/rncrrl446vt43p34xxxxx....
(2016-03-15, 11:57)dabinn Wrote: [ -> ]
(2016-03-15, 11:44)dmdsoftware Wrote: [ -> ]
(2016-03-15, 09:38)dabinn Wrote: [ -> ]Many thanks, I will test 0.7.46 later today. Smile
I am still testing on Unicode file name issue (File name in Traditional Chinese, Simplified Chinese, Japanese). Something is strange but I am not very sure right now.
If you are interesting in this, here is an .ass subtitle file with 3 Chinese words in the file name.
https://drive.google.com/file/d/0B-IpAlZ...E2ZWc/view

thanks, I will test with the subtitle

I have roughly tested 0.7.46 and found some problem.

* Too many subtitle files are loaded.
If a directory contained 10 video files (file_01~file10.avi), and I played file_08.avi.
- In some directories, subtitle with filename file08~file10 will be loaded.
- In other directories, subtitle with filename file01~file08 will be loaded.

* file name escaping causes problem
In default.py
Code:
files = cache.getSRT(service)
for file in files:
    if file != '':
        try:
            xbmc.log('gdrive_file_before: '+file, xbmc.LOGNOTICE)
            #file = file.decode('unicode-escape')
            file = file.encode('utf-8')
            xbmc.log('gdrive_file_after: '+file, xbmc.LOGNOTICE)

- file name escaping issue 1: Chinese characters in file name are messed up.
Code:
16:37:06 T:9408  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][現視研][GENSHIKEN][01].sub
16:37:06 T:9408  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][c??e|?c??][GENSHIKEN][01].sub
- file name escaping issue 2: On windows, backslash in path string was escaped, subtitle was not loaded.
(In this case "\t" seems to be changed into tab character.)
Code:
17:12:57 T:11296  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass
17:12:57 T:11296  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass

* When cache is turned off
- Windows path and Chinese charactor are OK since filenames are not used when cache is off.
- Each subtitle loaded with a 10 seconds timeout.
While video loading, subtiles cause UI stopped on "Buffering..." message. 1 subtitle takes 10 seconds, 15 subtitles take 150 seconds.
while video playing, switching subtitle (click on KODI UI, subtitle icon --> Next) causes another 10 second timeout before subtitle loaded.
Code:
16:30:19 T:6916   ERROR: CCurlFile::Stat - Failed: Timeout was reached(28) for https://doc-14-c4-docs.googleusercontent.com/docs/securesc/rncrrl446vt43p34xxxxx....

Can you PM the exact name of the video files?
(2016-03-15, 12:00)dmdsoftware Wrote: [ -> ]
(2016-03-15, 11:57)dabinn Wrote: [ -> ]
(2016-03-15, 11:44)dmdsoftware Wrote: [ -> ]thanks, I will test with the subtitle

I have roughly tested 0.7.46 and found some problem.

* Too many subtitle files are loaded.
If a directory contained 10 video files (file_01~file10.avi), and I played file_08.avi.
- In some directories, subtitle with filename file08~file10 will be loaded.
- In other directories, subtitle with filename file01~file08 will be loaded.

* file name escaping causes problem
In default.py
Code:
files = cache.getSRT(service)
for file in files:
    if file != '':
        try:
            xbmc.log('gdrive_file_before: '+file, xbmc.LOGNOTICE)
            #file = file.decode('unicode-escape')
            file = file.encode('utf-8')
            xbmc.log('gdrive_file_after: '+file, xbmc.LOGNOTICE)

- file name escaping issue 1: Chinese characters in file name are messed up.
Code:
16:37:06 T:9408  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][現視研][GENSHIKEN][01].sub
16:37:06 T:9408  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][c??e|?c??][GENSHIKEN][01].sub
- file name escaping issue 2: On windows, backslash in path string was escaped, subtitle was not loaded.
(In this case "\t" seems to be changed into tab character.)
Code:
17:12:57 T:11296  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass
17:12:57 T:11296  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass

* When cache is turned off
- Windows path and Chinese charactor are OK since filenames are not used when cache is off.
- Each subtitle loaded with a 10 seconds timeout.
While video loading, subtiles cause UI stopped on "Buffering..." message. 1 subtitle takes 10 seconds, 15 subtitles take 150 seconds.
while video playing, switching subtitle (click on KODI UI, subtitle icon --> Next) causes another 10 second timeout before subtitle loaded.
Code:
16:30:19 T:6916   ERROR: CCurlFile::Stat - Failed: Timeout was reached(28) for https://doc-14-c4-docs.googleusercontent.com/docs/securesc/rncrrl446vt43p34xxxxx....

Can you PM the exact name of the video files?

I cannot access the member area (don't know why), It's OK, I post some file names here .
Code:
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][OP].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][sub].rar
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][DVDRIP][BIG5][FONTS].rar
[現視研.OVA].[X2][Genshiken_OVA][NCED][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][NCOP][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol2_sp][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol3_sp][DVDRIP][BIG5][XVID].avi
(2016-03-15, 12:17)dabinn Wrote: [ -> ]
(2016-03-15, 12:00)dmdsoftware Wrote: [ -> ]
(2016-03-15, 11:57)dabinn Wrote: [ -> ]I have roughly tested 0.7.46 and found some problem.

* Too many subtitle files are loaded.
If a directory contained 10 video files (file_01~file10.avi), and I played file_08.avi.
- In some directories, subtitle with filename file08~file10 will be loaded.
- In other directories, subtitle with filename file01~file08 will be loaded.

* file name escaping causes problem
In default.py
Code:
files = cache.getSRT(service)
for file in files:
    if file != '':
        try:
            xbmc.log('gdrive_file_before: '+file, xbmc.LOGNOTICE)
            #file = file.decode('unicode-escape')
            file = file.encode('utf-8')
            xbmc.log('gdrive_file_after: '+file, xbmc.LOGNOTICE)

- file name escaping issue 1: Chinese characters in file name are messed up.
Code:
16:37:06 T:9408  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][現視研][GENSHIKEN][01].sub
16:37:06 T:9408  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOLU9mYkdRamhzWDQ/[Anifan][c??e|?c??][GENSHIKEN][01].sub
- file name escaping issue 2: On windows, backslash in path string was escaped, subtitle was not loaded.
(In this case "\t" seems to be changed into tab character.)
Code:
17:12:57 T:11296  NOTICE: gdrive_file_before: D:\tmp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass
17:12:57 T:11296  NOTICE: gdrive_file_after: D:    mp\/0B-IpAlZeDhMOaDEtczlJd0VMZGM/[file][08][X264_AAC].ass

* When cache is turned off
- Windows path and Chinese charactor are OK since filenames are not used when cache is off.
- Each subtitle loaded with a 10 seconds timeout.
While video loading, subtiles cause UI stopped on "Buffering..." message. 1 subtitle takes 10 seconds, 15 subtitles take 150 seconds.
while video playing, switching subtitle (click on KODI UI, subtitle icon --> Next) causes another 10 second timeout before subtitle loaded.
Code:
16:30:19 T:6916   ERROR: CCurlFile::Stat - Failed: Timeout was reached(28) for https://doc-14-c4-docs.googleusercontent.com/docs/securesc/rncrrl446vt43p34xxxxx....

Can you PM the exact name of the video files?

I cannot access the member area (don't know why), It's OK, I post some file names here .
Code:
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][OP].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][sub].rar
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][DVDRIP][BIG5][FONTS].rar
[現視研.OVA].[X2][Genshiken_OVA][NCED][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][NCOP][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol2_sp][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol3_sp][DVDRIP][BIG5][XVID].avi


OK, thx, I will replicate a folder using the same names and debug. There is a failsafe that should prompt you to select 1 subtitle track if it believes there are more than 4 to select from.
(2016-03-15, 09:38)dabinn Wrote: [ -> ]
(2016-03-14, 17:07)dmdsoftware Wrote: [ -> ]
(2016-03-12, 20:07)dabinn Wrote: [ -> ]In my experience, most video player handle subtitle file like 1) and 3)
1) videofile.mp4 with videofile.*.srt (1 video per directory)
3) videofile.series.mp4 with videofile.series.*.srt (multiple videos)
and they may additionally provide an ability to select any subtitle from any directory.

I think your 1~4 step is very good. I may consider not to search title across account, although it is fast with google API in my test( maybe they have built index or something). But I am still afraid if user had lots lots of file in google drive, it may takes too long time to wait for response. Searching in a user specified str_folder should be safer.


Can you test out v0.7.46? I've implemented behaviour for 1-5 without having to toggle a setting. I tested them with a few test cases and looks good.

http://dmdsoftware.net/repository.ddurdl...0.7.46.zip
v0.7.46 (2016-03-14)
- SRT - merge contribution by dabinn (dealing with TV series in a single directory)
- add ability to toggle caching of thumbnails and SRT on/off
- fix cache of SRT
- rework SRT logic
1) list of files (multiple languages) from the same folder that exactly match the title of the video
2) list of candidate files that are from the same folder but don't match the title of the video (if exceeds 4, ask user to select -- likely TV series or folder containing multiple movies)

Many thanks, I will test 0.7.46 later today. Smile
I am still testing on Unicode file name issue (File name in Traditional Chinese, Simplified Chinese, Japanese). Something is strange but I am not very sure right now.
If you are interesting in this, here is an .ass subtitle file with 3 Chinese words in the file name.
https://drive.google.com/file/d/0B-IpAlZ...E2ZWc/view
If it is only the filename a problem, then I could store the files using their fileid instead. It sounds like, from your other post, when the subtitles are streamed (not cached), they load.
(2016-03-15, 13:40)dmdsoftware Wrote: [ -> ]
(2016-03-15, 12:17)dabinn Wrote: [ -> ]
(2016-03-15, 12:00)dmdsoftware Wrote: [ -> ]Can you PM the exact name of the video files?

I cannot access the member area (don't know why), It's OK, I post some file names here .
Code:
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][OP].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][sub].rar
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][DVDRIP][BIG5][FONTS].rar
[現視研.OVA].[X2][Genshiken_OVA][NCED][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][NCOP][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol2_sp][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol3_sp][DVDRIP][BIG5][XVID].avi


OK, thx, I will replicate a folder using the same names and debug. There is a failsafe that should prompt you to select 1 subtitle track if it believes there are more than 4 to select from.


I didn't see the prompt, I'll check it too.

--
edit:

I checked the code of 0.7.46, and fix the major subtitle issue.(not perfect)
* file.decode('unicode-escape') is removed.
This converts the unicode with \uXXXX format to unicode char. But I didn't see this is necessary? (I think the \uXXXX format only exists in json data, and they have already converted in Python string?)
If I didn't remove this, Windows cache path and Chinese filename would not be load correctly.
* Use title.startswith() to match title name : more accurate.
* Move 'isExactMatch = False' into loop : fix 'too many subtitle loaded' issue
* Add idx extension support: idx and sub files are a pair, idx is index file, sub contains bitmap subtitle. They need to work together.

Code:
diff --git a/default.py b/default.py
index 87151ff..25645b5 100644
--- a/default.py
+++ b/default.py
@@ -1000,7 +1000,7 @@ elif mode == 'audio' or mode == 'video' or mode == 'search' or mode == 'play' or
             for file in files:
                 if file != '':
                     try:
-                        file = file.decode('unicode-escape')
+                        #file = file.decode('unicode-escape')
                         file = file.encode('utf-8')
                     except:
                         pass
@@ -1363,7 +1363,7 @@ elif mode == 'audio' or mode == 'video' or mode == 'search' or mode == 'play' or
                 for file in files:
                     if file != '':
                         try:
-                            file = file.decode('unicode-escape')
+                            #file = file.decode('unicode-escape')
                             file = file.encode('utf-8')
                         except:
                             pass
diff --git a/resources/lib/gdrive_api2.py b/resources/lib/gdrive_api2.py
index 15e88cf..237b004 100644
--- a/resources/lib/gdrive_api2.py
+++ b/resources/lib/gdrive_api2.py
@@ -851,7 +851,6 @@ class gdrive(cloudservice):

             # parsing page for videos
             # video-entry
-            isExactMatch = False
             for r2 in re.finditer('\"items\"\:\s+\[[^\{]+(\{.*?)\}\s+\]\s+\}' ,response_data, re.DOTALL):
              entryS = r2.group(1)
              for r1 in re.finditer('\{(.*?)\"appDataContents\"\:' ,entryS, re.DOTALL):
@@ -862,11 +861,12 @@ class gdrive(cloudservice):
                 title = ''
                 url = ''
                 fileExtension = ''
+                isExactMatch = False
                 for r in re.finditer('\"fileExtension\"\:\s+\"([^\"]+)\"' ,
                              entry, re.DOTALL):
                   fileExtension = r.group(1)
                   break
-                if fileExtension.lower() in ('srt','sub','ass','ssa'):
+                if fileExtension.lower() in ('srt','idx','sub','ass','ssa'):

                     for r in re.finditer('\"id\"\:\s+\"([^\"]+)\"' ,
                              entry, re.DOTALL):
@@ -875,7 +875,7 @@ class gdrive(cloudservice):
                     for r in re.finditer('\"title\"\:\s+\"([^\"]+)\"' ,
                              entry, re.DOTALL):
                         title = r.group(1)
-                        if os.path.splitext(package.file.title)[0] in title:
+                        if title.startswith(os.path.splitext(package.file.title)[0]) :
                             isExactMatch = True
                         break
                     for r in re.finditer('\"downloadUrl\"\:\s+\"([^\"]+)\"' ,

I saw the failsafe prompt this time, when I was playing the file :[現視研.OVA].[X2][Genshiken_OVA][vol2_sp][DVDRIP][BIG5][XVID].avi
This file uses no subtitle so I choose 'cancel' in the dialog, a (wrong) subtitle file is loaded.(I believe that the first or last item in srtCandidates[].)
The behavior may need to change, because in some situation like this we don't really need a subtitle for the file.
I found another issue, when pressing 'next' button to playt next video in the series, the subtitle is not loaded.
But if I played the video to the end, and the player loads the next video, the subtitle is OK.
I check the log file for the difference,
- in normal situation:
video played to the end --> CDVDPlayer::CloseFile() --> player.PlayStream() --> player.setsubtitle() -->new video loaded
- when pressing 'next' :
Player didn't know the video is about to be end --> player.PlayStream() --> player.setsubtitle() --> CDVDPlayer::CloseFile() -->new video loaded

The subtitle is cleared with the closing of previous video?

--
Edit:

Not sure how to resolve this, but add an 1 second delay before player.setsubtitle() seems to be a workaround.
This helps setsubtitle() executed after CDVDPlayer::CloseFile()
Code:
diff --git a/default.py b/default.py
index 25645b5..c6f14b6 100644
--- a/default.py
+++ b/default.py
@@ -1344,7 +1344,8 @@ elif mode == 'audio' or mode == 'video' or mode == 'search' or mode == 'play' or

                     item.setPath(mediaURL.url)
                     xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
-
+            if player.isPlaying():
+                xbmc.sleep(1000)

             # need to seek?
             if seek > 0:
(wrong post, deleted)
(2016-03-17, 12:52)dabinn Wrote: [ -> ]I found another issue, when pressing 'next' button to playt next video in the series, the subtitle is not loaded.
But if I played the video to the end, and the player loads the next video, the subtitle is OK.
I check the log file for the difference,
- in normal situation:
video played to the end --> CDVDPlayer::CloseFile() --> player.PlayStream() --> player.setsubtitle() -->new video loaded
- when pressing 'next' :
Player didn't know the video is about to be end --> player.PlayStream() --> player.setsubtitle() --> CDVDPlayer::CloseFile() -->new video loaded

The subtitle is cleared with the closing of previous video?

--
Edit:

Not sure how to resolve this, but add an 1 second delay before player.setsubtitle() seems to be a workaround.
This helps setsubtitle() executed after CDVDPlayer::CloseFile()
Code:
diff --git a/default.py b/default.py
index 25645b5..c6f14b6 100644
--- a/default.py
+++ b/default.py
@@ -1344,7 +1344,8 @@ elif mode == 'audio' or mode == 'video' or mode == 'search' or mode == 'play' or

                     item.setPath(mediaURL.url)
                     xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
-
+            if player.isPlaying():
+                xbmc.sleep(1000)

             # need to seek?
             if seek > 0:

Yes, the subtitles not loading unless there is a pause is a known KODI issue. I had the following to deal with that:

PHP Code:
# load captions
            
if  (settings.srt or settings.cc) and service.protocol == 2:
                while 
not (player.isPlaying()):
                    
xbmc.sleep(1000

But yes, because the player is already playing it is skipped and the subtitle isn't loaded. It doesn't distract from anything to add it.

I'm actually probably going to move the subtitle addition to the player object (tied to the OnPlayerStart). I'm adding support to playlists and adding subtitles needs to change.[/quote]
(2016-03-15, 13:50)dabinn Wrote: [ -> ]
(2016-03-15, 13:40)dmdsoftware Wrote: [ -> ]
(2016-03-15, 12:17)dabinn Wrote: [ -> ]I cannot access the member area (don't know why), It's OK, I post some file names here .
Code:
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][01].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][02].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][03].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][04].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][05].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][06].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][07].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][08].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][09].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][10].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][11].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].idx
[Anifan][現視研][GENSHIKEN][TWDVDrip][12].sub
[Anifan][現視研][GENSHIKEN][TWDVDrip][OP].avi
[Anifan][現視研][GENSHIKEN][TWDVDrip][sub].rar
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][01][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][02][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].ass
[現視研.OVA].[X2][Genshiken_OVA][03][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][DVDRIP][BIG5][FONTS].rar
[現視研.OVA].[X2][Genshiken_OVA][NCED][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][NCOP][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol2_sp][DVDRIP][BIG5][XVID].avi
[現視研.OVA].[X2][Genshiken_OVA][vol3_sp][DVDRIP][BIG5][XVID].avi


OK, thx, I will replicate a folder using the same names and debug. There is a failsafe that should prompt you to select 1 subtitle track if it believes there are more than 4 to select from.


I didn't see the prompt, I'll check it too.

--
edit:

I checked the code of 0.7.46, and fix the major subtitle issue.(not perfect)
* file.decode('unicode-escape') is removed.
This converts the unicode with \uXXXX format to unicode char. But I didn't see this is necessary? (I think the \uXXXX format only exists in json data, and they have already converted in Python string?)
If I didn't remove this, Windows cache path and Chinese filename would not be load correctly.
* Use title.startswith() to match title name : more accurate.
* Move 'isExactMatch = False' into loop : fix 'too many subtitle loaded' issue
* Add idx extension support: idx and sub files are a pair, idx is index file, sub contains bitmap subtitle. They need to work together.

Code:
diff --git a/default.py b/default.py
index 87151ff..25645b5 100644
--- a/default.py
+++ b/default.py
@@ -1000,7 +1000,7 @@ elif mode == 'audio' or mode == 'video' or mode == 'search' or mode == 'play' or
             for file in files:
                 if file != '':
                     try:
-                        file = file.decode('unicode-escape')
+                        #file = file.decode('unicode-escape')
                         file = file.encode('utf-8')
                     except:
                         pass
@@ -1363,7 +1363,7 @@ elif mode == 'audio' or mode == 'video' or mode == 'search' or mode == 'play' or
                 for file in files:
                     if file != '':
                         try:
-                            file = file.decode('unicode-escape')
+                            #file = file.decode('unicode-escape')
                             file = file.encode('utf-8')
                         except:
                             pass
diff --git a/resources/lib/gdrive_api2.py b/resources/lib/gdrive_api2.py
index 15e88cf..237b004 100644
--- a/resources/lib/gdrive_api2.py
+++ b/resources/lib/gdrive_api2.py
@@ -851,7 +851,6 @@ class gdrive(cloudservice):

             # parsing page for videos
             # video-entry
-            isExactMatch = False
             for r2 in re.finditer('\"items\"\:\s+\[[^\{]+(\{.*?)\}\s+\]\s+\}' ,response_data, re.DOTALL):
              entryS = r2.group(1)
              for r1 in re.finditer('\{(.*?)\"appDataContents\"\:' ,entryS, re.DOTALL):
@@ -862,11 +861,12 @@ class gdrive(cloudservice):
                 title = ''
                 url = ''
                 fileExtension = ''
+                isExactMatch = False
                 for r in re.finditer('\"fileExtension\"\:\s+\"([^\"]+)\"' ,
                              entry, re.DOTALL):
                   fileExtension = r.group(1)
                   break
-                if fileExtension.lower() in ('srt','sub','ass','ssa'):
+                if fileExtension.lower() in ('srt','idx','sub','ass','ssa'):

                     for r in re.finditer('\"id\"\:\s+\"([^\"]+)\"' ,
                              entry, re.DOTALL):
@@ -875,7 +875,7 @@ class gdrive(cloudservice):
                     for r in re.finditer('\"title\"\:\s+\"([^\"]+)\"' ,
                              entry, re.DOTALL):
                         title = r.group(1)
-                        if os.path.splitext(package.file.title)[0] in title:
+                        if title.startswith(os.path.splitext(package.file.title)[0]) :
                             isExactMatch = True
                         break
                     for r in re.finditer('\"downloadUrl\"\:\s+\"([^\"]+)\"' ,

I saw the failsafe prompt this time, when I was playing the file :[現視研.OVA].[X2][Genshiken_OVA][vol2_sp][DVDRIP][BIG5][XVID].avi
This file uses no subtitle so I choose 'cancel' in the dialog, a (wrong) subtitle file is loaded.(I believe that the first or last item in srtCandidates[].)
The behavior may need to change, because in some situation like this we don't really need a subtitle for the file.

Thanks, looks very good. I'll add these changes. Great work.
reg * file.decode('unicode-escape')

I did a test with this removed and it loaded German and French files fine for me, but I tend to recall there were users who had issues previously with certain encoded files. I'll leave it out and see if there are reported issues.
New build:
http://dmdsoftware.net/repository.ddurdl...0.7.47.zip

v0.7.47 (2016-03-17)
- Contributions by dabinn
- Use title.startswith() to match title name : more accurate.
- Move 'isExactMatch = False' into loop : fix 'too many subtitle loaded' issue
- Add idx extension support: idx and sub files are a pair, idx is index file, sub contains bitmap subtitle. They need to work together.
- fix double-byte character filenames (cache SRT)
- playback next fix for srt
- fix: cancel on srt selection
Nice to see somebody contributing to this great plugin. Thanks dabinn (and thanks, as usual, dmdsoftware). Smile
(2016-03-18, 16:02)ashlar Wrote: [ -> ]Nice to see somebody contributing to this great plugin. Thanks dabinn (and thanks, as usual, dmdsoftware). Smile

Testing contributions, user requests and feedback is very important as well.
(2016-03-18, 16:02)ashlar Wrote: [ -> ]Nice to see somebody contributing to this great plugin. Thanks dabinn (and thanks, as usual, dmdsoftware). Smile
I just do what I can do for this great plugin, thanks to dmdsoftware.

(2016-03-18, 17:31)dmdsoftware Wrote: [ -> ]
(2016-03-18, 16:02)ashlar Wrote: [ -> ]Nice to see somebody contributing to this great plugin. Thanks dabinn (and thanks, as usual, dmdsoftware). Smile

Testing contributions, user requests and feedback is very important as well.
Would you please add '.iso' to the video type?
I found KODI support DVD rip iso files natively, but it is not shown with gdrive addon.