Posts: 1,506
Joined: Nov 2013
sounds like a simple python script (a service). many many examples out there. also you do know you can add ftps directly in xbmc right?
Posts: 23
Joined: Jun 2014
Reputation:
0
thank you.
No, i did not know. The thing is, it file list will change.
So today i download files 1,2,3. and tomorrow i download files 4,5,6 and possibly delete files 1,2,3. So i was hoping to have code that works dynamically.
I have been researching while waiting for a response, and i have come across python script as a solution. How do i add this to the xbmc?
is there a guide/example you can link me to that adds in a simple script for proof of concept?
Also please advise on adding ftps directly in xbmc?
maybe a solution will be for me to set up the ftp to only have files i want to use at that time, and change the files on it for the next day etc - and have xbmc download from the ftp server when needed. But then again, i would like the ability to delete older files
Posts: 23
Joined: Jun 2014
Reputation:
0
ok i got a windows version of xbmc and figured out how to add an ftp server to it.
the files are streamed from the ftp server which is something i don't - i like the files to be download instead.
Just need advice on how to add a script to xbmc
Posts: 1,506
Joined: Nov 2013
there's no guides really, there's only code. grab some service, read it, monkey it.
http://mirrors.xbmc.org/addons/gotham/
Posts: 23
Joined: Jun 2014
Reputation:
0
Sorry for not replying - i've been busy
i have just completed a test script. it works on my pc.
the way i wanted it done was like this.
1 - have ftp server with all the files.
2 - have webservice that returns a ftpurl list of files i want to be downloaded and played.
3 - have a python script that does the following:
- on startup, check if the file directory on the rpi exists(where new list of songs will be saved to). if directory doesn't exist, then create it.
- if directory exists, check if files are in it and delete files on startup.
- contact webservice and retrieve a ftpurl list of files i want downloaded
- download the files to the directory
- automatically play the files once download is completed
now my next step:
setting up xbmc so that this script loads on startup
Posts: 23
Joined: Jun 2014
Reputation:
0
i will look into it now - thank you.
I was trying some stuff, and have been importing xbmc, and then proceeding to use xbmc.Player().play("c:\\test\\iron.mp3") with no results
Posts: 23
Joined: Jun 2014
Reputation:
0
the script worked, but not as desired.
I used the wrong script by mistake, but i don't think it was the issue
This is what happened:
the directory i have set in my script is "c:\\test"
the python script created a directory in the home/pi directory called "c:\\test" - this is the exact folder name lol
then in my script i use this directory and append the file name onto it, in the hope that it saves the file in that directory, but it saves the file in the home/pi directory with this exact name "c:\test\Mr_brightside.mp3"
it does not save into the folder, but adds the folder name to the filename as you can see
Why does it do that? any way around this?
Posts: 16,946
Joined: Feb 2011
Reputation:
256
use special://temp/ on both platforms for saving it to a temp directory which is platform agnostic. Pathes on linux (rbpi) are completely different then the windows crap with c: blahblah...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much:
click here
HowTo setup NFS for Kodi:
NFS (wiki)
HowTo configure avahi (zeroconf):
Avahi_Zeroconf (wiki)
READ THE IOS FAQ!:
iOS FAQ (wiki)