A script to Copy currently playing song to a favorites folder
#1
First i'd like to explain in a little detail what i'm attempting to do. I'm trying to create a script that will copy not move the currently playing song to a folder called F:\ipod\ so i can then add the songs to my ipod. The reason i need a script to do this so when i hear a song i like i wont have to go thru the filemanger and find the song and then copy it everytime i find a song i like. And i would also like to add a keymap to keymaps.xml to execute the script from the visualization window so i can execute the script with a push of a single button when i'm listening to music with the tv off.
Now i've spent quite a bit of time trying to find out if this is even possible with not much luck. i've found script functions to get certain song info like artist and albumname ect but none for filepath/name and i've had limited success finding and info on how to copy files. So i've come here hoping for someone to maybee help write this or just point me in the right direction.
Reply
#2
Why not tag it as a favourite by rating it highly? This is doable from the visualisation window already.

Then you have a smartplaylist that fetches said favourites, and you can very likely copy said files directly to another folder if you want.
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
#3
untested, check the pydocs in my signature. the info is in them
PHP Code:
import xbmc
import shutil
import os
 
song 
xbmc.Player().getPlayingFile()
ipod_song "f:\\ipod\\" os.path.basenamesong )
 
shutil.copyfilesongipod_song 
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#4
lemme first say thanks for the quick response Jm/nuka.
Jmarshall: as far a setting a song as a favorite i was'nt aware of the options you could do with that. So that maybee something i can do with the songs i put into the ipod folder for more an even more refined selection from the songs i find.
sounds like its definately worth exploring.
that script that nuka wrote does exactly what i was looking for
i've got the whole thing mapped and working correctly as for me not being able to find the copy function i guess i should have done more looking in the python docs.. Thanks a bunch for the help.
Reply

Logout Mark Read Team Forum Stats Members Help
A script to Copy currently playing song to a favorites folder0