Dropbox in Python
#1
Looking for a little help here with the Dropbox Python API. I was hoping to add direct-to-Dropbox functionality to the XBMC Backup addon for writing directly off-site. Their API seems pretty simple to use but I'm having some dependency issues getting it working. Right now I'm getting a failure specifically on

Code:
No module named pkg_resources

When trying to import the Dropbox library. I did a little searching and see that the pkg_resources import is something included with the setuptools. Is there a way to include this package in XBMC? More importantly has anyone attempted to use the Dropbox class files with XBMC before? I'm slightly worried that the python version bundled with XBMC just won't be able to support it. If that's the case I'd rather not muck around with it for too long.

Any tips in the right direction would be helpful.
Reply
#2
A couple of ways you could go. If the stuff being imported isn't something you need, you can just create a dummy file to make the drop box package think it's there. Just making a pkg_resources.py file might be enough, or you might have to go in and create dummy functions for some stuff.

If that's not an option, grab the source version of setup Todd. Then copy pkg_resources into your addon's directory. It'll either be a folder or a .py file
Reply
#3
In the case of the dropbox api "pkg_resources" is only used to fill the "TRUSTED_CERT_FILE"-constant. This isn't really needed.

You can do like Bstrdsmkr said:
- add a dummy module with a simple function (def resource_filename(*args): return 'where_your_cert_file_is')

File: pkg_resources.py
PHP Code:
def resource_filename(*args): 
    return 
'absolute_path_of_your_cert_file' 

regards,
sphere
My GitHub. My Add-ons:
Image
Reply
#4
Thanks for the tips. I added the dummy file as suggested and now the API appears to be working. Going to walk through the online examples and see what I can make it do. Appreciate the help.
Reply
#5
Does anyone have a pluggin or addon for dropbox on xbmc? I am looking for such pluggin, basically I have some photos on my dropbox folder as well as movies and I would like to be able to have a plugin that will let me login into my dropbox account and navigate through the folders and view movies or see my photos..... does such a pluggin exist I couldn't find anything. any hell appreciated.
Reply
#6
(2012-11-08, 03:53)moshtagh Wrote: any hell appreciated.
Angel

I was thinking about creating a dropbox plugin - but after thinking about it I discarded the idea because you can just install a dropbox client which can sync all your dropbox data to your harddisk and play your media from there.
My GitHub. My Add-ons:
Image
Reply
#7
(2012-11-09, 19:58)sphere Wrote:
(2012-11-08, 03:53)moshtagh Wrote: any hell appreciated.
Angel

I was thinking about creating a dropbox plugin - but after thinking about it I discarded the idea because you can just install a dropbox client which can sync all your dropbox data to your harddisk and play your media from there.

Thanks for the reply, I thought I read some posts that sugggested you can stream from dropbox, basically you need to embed in html5...sorry about the typoSmile
Reply
#8
I've been thinking about this and the streaming piece is something I just can't figure out based on how the API functions. Maybe someone else can see something I can't here but it is not like web videos with a URL you could stream. The python API returns a raw http response.

I think installing the dropbox client is probably much easier, especially since you then don't have to worry about the bandwidth of steaming a large file. everything will just be local.
Reply
#9
but a backup is for uploading to drop box? That would be a great plugin, in my opinion
Reply
#10
(2012-11-10, 04:55)Robotica Wrote: but a backup is for uploading to drop box? That would be a great plugin, in my opinion

Check out this thread:

http://forum.xbmc.org/showthread.php?tid...pid1232335
Reply
#11
The thing is if you have xbmc setup on apple tv you can not have the client sync a 700 meg movie onto it as of the space limitation etc.... That's one of the reasons I wanted a plugin to stream from dropbox OR even slide show my photos directly from dropbox.
Reply

Logout Mark Read Team Forum Stats Members Help
Dropbox in Python0