• 1
  • 8
  • 9
  • 10
  • 11(current)
  • 12
[CLOSED] OneDrive (SkyDrive) Video/Music add-on for XBMC / Kodi
(2015-10-15, 05:37)GuyFromOz Wrote: Nope. Latest Version. Running Kodi 15.1. Just tried it again and I can't start playing anything until I navigate in the browser. Do you want me to send you log file?

From how I understand it, to reproduce:

-Open a particular directory in the plugin
-wait 1.5-2 hours
-Try playback of a video file from list shown on screen

Is that right?
Reply
No. It's actually just playing any stream file first thing. I will then get this error file not found. However when I go back to browse any directory and try the stream file again all is well.

I also see the issue sometimes if I just sit in Kodi for a while. I will have to go back to browse a directory and then try the stream again.

I tried the testing stream but it behaves exactly the same way. I get this error and then Kodi says it can't find the next file to play.

If it's helpful, I'm using the SSL Script login type to authenticate.
Reply
(2015-10-16, 00:26)GuyFromOz Wrote: No. It's actually just playing any stream file first thing. I will then get this error file not found. However when I go back to browse any directory and try the stream file again all is well.

I also see the issue sometimes if I just sit in Kodi for a while. I will have to go back to browse a directory and then try the stream again.

I tried the testing stream but it behaves exactly the same way. I get this error and then Kodi says it can't find the next file to play.

If it's helpful, I'm using the SSL Script login type to authenticate.

Can you try 0.4.0?
http://dmdsoftware.net/repository.ddurdl...-0.4.0.zip
Reply
I noticed the automatic update to this version. Unfortunately it still doesn't fix my issue. I don't understand why this is happening. I tried another kodi which is 14.2 and it also has the same problem. If I'm only getting this problem then it's something account specific. I send you crash log 570 but I checked the log and it's the same as the snippet I posted.

Any ideas? Not sure if it is related but it never resumes where I left off and it's not flagging watched videos either.
Reply
(2015-10-17, 14:00)GuyFromOz Wrote: I noticed the automatic update to this version. Unfortunately it still doesn't fix my issue. I don't understand why this is happening. I tried another kodi which is 14.2 and it also has the same problem. If I'm only getting this problem then it's something account specific. I send you crash log 570 but I checked the log and it's the same as the snippet I posted.

Any ideas? Not sure if it is related but it never resumes where I left off and it's not flagging watched videos either.

Do you have SRT enabled?
Reply
Yes. I tried turning it off but same thing. Video won't play unless I browse directory. I also notice another thing. After about an hour if I stop or rewind playback fails until I browse directory. So I can only get an hours worth of playback before I have to "reset" by directory browsing. Any other ideas?
Reply
So I managed to install debugging on one of my PC's and I was able to track down the issue. For whatever reason OneDrive is throwing a 404 error not 403 or 401 as you are expecting.

I updated onedrive_api.py and replaced every case of the following:

if e.code == 403 or e.code == 401

with

if e.code == 403 or e.code == 401 or e.code == 404

I'm still testing to see if there are any knock on effects, but seems this solved the problem.
Reply
(2015-10-21, 05:13)GuyFromOz Wrote: So I managed to install debugging on one of my PC's and I was able to track down the issue. For whatever reason OneDrive is throwing a 404 error not 403 or 401 as you are expecting.

I updated onedrive_api.py and replaced every case of the following:

if e.code == 403 or e.code == 401

with

if e.code == 403 or e.code == 401 or e.code == 404

I'm still testing to see if there are any knock on effects, but seems this solved the problem.

What that tells me is that it is definitely a case of the token expiring, as originally suspected. Now dig deeper into it.
Reply
Well now. I know nothing about Kodi plugins or how to program python. Could be a problem Smile

I will say this. One drive is clear that tokens last only for an hour. As far as I can tell your code is extremely resilient to errors and seems to re login with new token. I have tried the fix on Android and it so far is flawless.

From my perspective there is no further need for digging as your login logic is just fine.

I would point out that I don't understand why when playing videos from Onedrive directory will cause Kodi to properly resume if stopped and mark complete. But from strm file it does not. As far as I can tell your gplayer class should handle this (brilliant idea to store state in spreadsheet!) but I don't think it will work on a pc because there is no logged in google account. I note that 1channel plugin saves state into a local mysql db so it would be very feasible to copy this to Onedrive and use a local db instead of a gdrive spreadsheet. You wouldn't get sync of bookmarks but it should work.

If I have time I might consider playing around with python. But your plugin is so good that I'm inclined to just live with it.
Reply
(2015-10-21, 11:36)GuyFromOz Wrote: Well now. I know nothing about Kodi plugins or how to program python. Could be a problem Smile

I will say this. One drive is clear that tokens last only for an hour. As far as I can tell your code is extremely resilient to errors and seems to re login with new token. I have tried the fix on Android and it so far is flawless.

From my perspective there is no further need for digging as your login logic is just fine.

I would point out that I don't understand why when playing videos from Onedrive directory will cause Kodi to properly resume if stopped and mark complete. But from strm file it does not. As far as I can tell your gplayer class should handle this (brilliant idea to store state in spreadsheet!) but I don't think it will work on a pc because there is no logged in google account. I note that 1channel plugin saves state into a local mysql db so it would be very feasible to copy this to Onedrive and use a local db instead of a gdrive spreadsheet. You wouldn't get sync of bookmarks but it should work.

If I have time I might consider playing around with python. But your plugin is so good that I'm inclined to just live with it.

Digging, more as why it returns a 404 instead an authorization error when attempting to start the stream, if the token is expired. Will cross-check the API documentation again and if I find a discrepancy, I'll open a bug. They are returning the correct code when I do directory fetch, as if the token is expired, it gets the 401 or 403 response and is getting a new token.

KODI refuses to index playback count and resume point for files that end with .STRM or .M3U. When you playback within the plugin, it uses a unique plugin URL which it indexes just fine. For Amazon and Google Drive, they allow file attributes, so I provide the option to store this directly with the file on the cloud service. So when I fetch the file, I get these attributes for resume and playback count automatically. One Drive doesn't have any direct equivalent. Another option is to use a spreadsheet as a db. Again, easily doable with Google Spreadsheets but no equivalent with OneDrive Excel. Since the spreadsheet is separate, one can use Google Drive Spreadsheets just for this purpose.

Direct access to mysql is not recommended for a plugin, and is obsolete/breaks in latest KODI. A sqllite or dbm file would be alternative solutions, but they have performance implications on under-powered devices.
Reply
Thanks for the explanation, very helpful. I see your point about sqllite. That is exactly what 1channel uses.

There might be a discrepancy in how OneDrive deals with the direct links versus when you are browsing hence the 404. My use case is to have all my videos in the library and never to browse the OneDrive directory. Perhaps that link is tied to the token so when token expires the link rego runs 404. Another thought is to refresh the tokem on a timer while Kodi is running. That would be a sure fire way to keep everything working.

Along your line of storing metadata OneDrive does support description and comments. Storing metadata in file description maybe a bit too intrusive however maybe storing it in comments is an alternative. You should be able to create and delete comments at will. Just a thought. We shouldn't be sharing our videos anyhow so some cryptic comments should be fine.
Reply
(2015-10-21, 14:25)GuyFromOz Wrote: Thanks for the explanation, very helpful. I see your point about sqllite. That is exactly what 1channel uses.

There might be a discrepancy in how OneDrive deals with the direct links versus when you are browsing hence the 404. My use case is to have all my videos in the library and never to browse the OneDrive directory. Perhaps that link is tied to the token so when token expires the link rego runs 404. Another thought is to refresh the tokem on a timer while Kodi is running. That would be a sure fire way to keep everything working.

Along your line of storing metadata OneDrive does support description and comments. Storing metadata in file description maybe a bit too intrusive however maybe storing it in comments is an alternative. You should be able to create and delete comments at will. Just a thought. We shouldn't be sharing our videos anyhow so some cryptic comments should be fine.

I had look at comments and was considering it. I think comments had to be pulled for each file separate (so not practical).

I realized an issue with Google Drive file attributes the other day. I thought each person would have their own set, just like each app can have their own set. But if you have a file shared among different people, the attributes would be the same even if they are marked private. Also, the attributes can't be added if the file is shared with read-only access.
Reply
Perhaps SQLLite might be the only surefire way for this. Even though it may not work on slow devices it would work for some machines so it is better than nothing. At least it is well understood with other plugin's, so it should be easy to implement as an option.

So I've been playing OneDrive content now for a couple of hours. No issue with 404 and it works flawless. With media items in the library I can finally hand this off to less technical family members. I've been waiting a long time for this! Now I can have 1TB+ of content on Android TV.

On a side note I've been trying to import STRM music into Kodi library and it is a mess. Kodi won't do it, even though I have proper .NFO files. What is even more perplexing is if I mock up a .MP3 file and configure Kodi to only scan .NFO files, it still insists on scanning tags. I don't get it. Since I have a version of my library not in OneDrive, I tested the scenario of scanning them into the library and then manipulating the music library to point path and song filenames to the .STRM versions. Surprisingly this worked. Songs are in the library with artwork, information, and streaming from OneDrive.

What about creating a script to pull out music information, change extensions and paths, and merge into new database? This means one could update their master library as required and then update the clients with the music data but instead of .MP3 files it will be STRM files. I think this is doable and I think I'll pursue this (and learn Python along the way). It adds an extra complication but the end result is what I'm looking for; fully tagged streaming media in the Kodi library.
Reply
(2015-10-28, 02:40)GuyFromOz Wrote: Perhaps SQLLite might be the only surefire way for this. Even though it may not work on slow devices it would work for some machines so it is better than nothing. At least it is well understood with other plugin's, so it should be easy to implement as an option.

So I've been playing OneDrive content now for a couple of hours. No issue with 404 and it works flawless. With media items in the library I can finally hand this off to less technical family members. I've been waiting a long time for this! Now I can have 1TB+ of content on Android TV.

On a side note I've been trying to import STRM music into Kodi library and it is a mess. Kodi won't do it, even though I have proper .NFO files. What is even more perplexing is if I mock up a .MP3 file and configure Kodi to only scan .NFO files, it still insists on scanning tags. I don't get it. Since I have a version of my library not in OneDrive, I tested the scenario of scanning them into the library and then manipulating the music library to point path and song filenames to the .STRM versions. Surprisingly this worked. Songs are in the library with artwork, information, and streaming from OneDrive.

What about creating a script to pull out music information, change extensions and paths, and merge into new database? This means one could update their master library as required and then update the clients with the music data but instead of .MP3 files it will be STRM files. I think this is doable and I think I'll pursue this (and learn Python along the way). It adds an extra complication but the end result is what I'm looking for; fully tagged streaming media in the Kodi library.
It's an interesting idea, hacking the db to force cataloging the music. Would work, but highly discouraged by KODI, since they change things between releases, so a hack that works on one version may have issues on other releases. But one just needs to disclose what version it was tested on and let the users ensure they're on the right version of KODI.
Reply
i can not add my one drive video files to my kodi library.
i click on add to library(export.strm) and plugin ask me for Video Library Export Folder....
i tried to link them to my NAS but it does not work.... A valid folder is required...

What i am doing wrong?

sorry about my english....
Reply
  • 1
  • 8
  • 9
  • 10
  • 11(current)
  • 12

Logout Mark Read Team Forum Stats Members Help
[CLOSED] OneDrive (SkyDrive) Video/Music add-on for XBMC / Kodi2