Download file over smb from python plugin
#1
Anyone done anything like this? Ive found a few python libraries for doing it, but I am hesitant to go down that path because of all the platform differences between Samba, XP, Vista, and Windows 7 - I have my doubts that the libraries I have found will reliably work across all platforms well enough to not cause users grief...

My needs are very very simple - download a file from a server with minimal fuss... I currently use urllib to do the fetches over http which works great - but requires the user to setup an http server. I would like to add an option to my plugin to operate in smb mode and just have it grab a file using a unc path.

XBMC has great builtin support for smb - but there doesn't appear to be a way to leverage it from python (or at least I don't see a way to). Is there something I'm missing, or is the library route the way to go?

Any suggestions welcome.
Reply
#2
use shutil lib
Reply
#3
ppic Wrote:use shutil lib

Don't I have to mount the share to do that? I'm trying to do this cross platform, so mount is not an option... Or am I missing somethingHuh
Reply
#4
no need to mount, just past your share "smb://tatata/totot/file.jpg" it will be fine.
just need to copy, not download
Reply
#5
ppic Wrote:no need to mount, just past your share "smb://tatata/totot/file.jpg" it will be fine.
just need to copy, not download

Really? When did that start working... Cool.
Reply
#6
Uhm, we add our vfs to python scripts, you should be able to just use normal file operations in python and get smb support, heck even read zip over samba and all that stuff aswell.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#7
Actually, you probably won't be able to do that, as not everything is wrapped. You might get lucky or you might not, depending on platform.

It would be better if we added a vfs module for python.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Download file over smb from python plugin0