PDA

View Full Version : Python and Samba


scooba77
2004-02-12, 12:36
hi,
in the last days playd a bit with python and it works really fine. but one thing i couldnīt get work, was to play an mediafile over an samba share.
is it possible to acces samba-shares with python?
i tried this(from the example scrpit): import xbmc, xbmcgui, nt

dir = 'smb:\\user:pass@192.168.x.x\video\'
list = nt.listdir(dir)

dialog = xbmcgui.dialog()
selected = dialog.select('select a song to play, no directory!!!', list)
filename = list[selected]

xbmc.mediaplay(dir + filename)


in xbmc samba is working great, bit with python i did not get it work.

scooba77

darkie
2004-02-12, 13:43
python can't access samba directly, the same goes for relax.

you could use xbmc.player().play("smb://server/share/file.mp3") but that is all for now

scooba77
2004-02-12, 16:08
thanks for your answer, but this does not work.
i tested: xbmc.player().play("smb://192.168.66.7/videoz/01.mpg")
and: xbmc.player().play("smb://xbox:xbox@192.168.66.7/videoz/01.mpg")

192.168.66.7 is the ip of my pc(winxp) and xbox:xbox is user:pass for the xbox-user

or is there any alternative to play an mpg from an other pc with python?

scooba77

Hullebulle
2004-02-14, 23:27
moving to "development". :)

darkie
2004-02-15, 00:46
xbmc.player().play("smb://192.168.66.7/videoz/01.mpg") is only for xbmc after 06-02-2004

before that date you should use xbmc.mediaplay("smb://192.168.66.7/videoz/01.mpg")

and you could always press the info button after running the script to get some more information