Please someone share a basic working code for scrobbling a
particular track using pylast. How do i scrobble the "track1" Track
object using Scrobbler class? Pls tell the code. I dont think the code
would be more than a few lines.
#Code starts here
import pylast
API_KEY="something here"
API_SECRET="something here"
username = "shadyabhi"
password_hash = pylast.md5("mypassword")
network = pylast.get_lastfm_network(api_key = API_KEY, api_secret =
API_SECRET, username = username, password_hash = password_hash)
track1 = network.get_track("Breaking Benjamin","Firefly")
#Code Ends here
Thanx
--
Abhijeet Rastogi
(shadyabhi)
http://www.google.com/profiles/abhijeet.1989
-- Amr
> --
> You received this message because you are subscribed to the pylast mailing
> list.
> To post to this mailing list, send email to pyl...@googlegroups.com
> To unsubscribe from this group, send email to
> pylast+un...@googlegroups.com
> pylast is a python wrapper around last.fm's api. the project is hosted at
> http://code.google.com/p/pylast/ and the mailing list/group is at
> http://groups.google.com/group/pylast
I'm trying to read from a file that has an artist, track and utc date
code on each line, and scrobble them
....
import pylast
API_KEY="something here"
API_SECRET="something here"
username = "shadyabhi"
password_hash = pylast.md5("mypassword")
network = pylast.get_lastfm_network(api_key = API_KEY, api_secret =
API_SECRET, username = username, password_hash = password_hash)
network = pylast.get_lastfm_network(api_key = API_KEY, api_secret =
API_SECRET, username = username, password_hash = password_hash)
scrobbler = network.get_scrobbler("tst", "1.0")
def main():
scrobbler = network.get_scrobbler("tst", "1.0")
fin = open(FILE)
for line in fin:
raw = line.strip()
trackinfo = raw.split("\t")
track = network.get_track(trackinfo[0], trackinfo[1])
artist = track.get_artist()
title = track.title
time_started = trackinfo[2]
source = 'SCROBBLE_SOURCE_UNKNOWN'
mode = 'SCROBBLE_MODE_PLAYED'
duration = track.get_duration()
album = track.get_album()
track_number = '1'
mbid = track.get_mbid()
scrobbler.scrobble(artist, title, time_started, source, mode,
duration, album, track_number, mbid)
if __name__ == "__main__":
main()
I'm trying to migrate my scrobbles from one account to a new one (sick
of my username, can't change it). If a tool like this already exists,
please tell me, but I'd still like to finish working on this script.
On Feb 25, 8:55 am, Amr Hassan <amr.has...@gmail.com> wrote:
> to scrobble you need a Scrobbler object. use network.get_scrobbler()
> and then use its methods for scrobbling or reporting the nowplaying
> track.
>
> -- Amr
>
> >http://code.google.com/p/pylast/and the mailing list/group is at
> >http://groups.google.com/group/pylast
I filled out an issue report, that's here: http://code.google.com/p/pylast/issues/detail?id=36
> > >http://code.google.com/p/pylast/andthe mailing list/group is at
> > >http://groups.google.com/group/pylast
[...]
> I'm trying to migrate my scrobbles from one account to a new one (sick
> of my username, can't change it). If a tool like this already exists,
> please tell me, but I'd still like to finish working on this script.
That sounds very useful. Did you get it working? I'd be interested in
using it.
Best wishes,
Dan
On Mar 28, 10:59 am, Dan Davison <davi...@stats.ox.ac.uk> wrote:
> >> >http://code.google.com/p/pylast/andthe mailing list/group is at
> >> >http://groups.google.com/group/pylast