Jaffa / amazon-music

Provide programmatic access to Amazon Music/Prime Music's streaming service
Apache License 2.0
336 stars 67 forks source link

List history of tracks played #14

Open dufferzafar opened 6 years ago

dufferzafar commented 6 years ago

Is it possible to export the list of songs that I’ve played along with their time stamps?

I didn’t see a mention of this in the readme so not sure if this can be done.

Since there isn’t a last.fm scrobbler that works with Prime Music on iOS, I’d like to use this library to build something that can scrobble to last.fm

Thanks!

danieldaeschle commented 6 years ago

No it doesn't. It can only work if the amazon API support this.

dufferzafar commented 6 years ago

Do you know if the Amazon API supports this? If it does then maybe support could be added here too.

danieldaeschle commented 6 years ago

I don't know it. @Jaffa is very busy and i'm not a reverse engineering pro. Maybe you could create a PR?

Jaffa commented 6 years ago

I may have some time tomorrow to look into it. @dufferzafar - if you can find a way of looking at your history in the web client, that may give us a starting point. When you log in, I think there's a "Recently played", which might help.

When you say "along with their time stamps", do you mean durations, or the exact time you played them?

dufferzafar commented 6 years ago

Okay, I too will have a look at the web version.

And I meant the time that I played them on, not the durations.

On Mon 16 Jul, 2018, 2:41 PM Andrew Flegg, notifications@github.com wrote:

I may have some time tomorrow to look into it. @dufferzafar https://github.com/dufferzafar - if you can find a way of looking at your history in the web client, that may give us a starting point. When you log in, I think there's a "Recently played", which might help.

When you say "along with their time stamps", do you mean durations, or the exact time you played them?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Jaffa/amazon-music/issues/14#issuecomment-405188387, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYeKOEe8mVSO91cmUvN1qFZR4w9PFTWks5uHFjIgaJpZM4VQmkn .

danieldaeschle commented 6 years ago

The datetime when it was played.

Jaffa commented 6 years ago

The homepage's Recently Played uses com.amazon.musicensembleservice.MusicEnsembleService.getHome with the standard parameters, plus:

options=populateRecentlyPlayed,requestShowContent
requestContent=PRIME

This returns a set of blocks for the homepage. [2] is a VerticalTileGroup containing sub-blocks for recently played. Not tracks, unfortunately, but albums/stations/playlists (and individual tracks, maybe)? It does include a timestamp of when it was played, though:

{
    "__type": "VerticalTile:http://internal.amazon.com/coral/com.amazon.layout.music.model/",
    "blockRef": "1|T|0|1|Q3A1166NJA4M7X48VP51|0|0|0|B01JNQ7KTA|-1|null",
    "hint": {
        "__type": "AlbumHint:http://internal.amazon.com/coral/com.amazon.layout.music.model/",
        "albumArtImageUrl": "https://m.media-amazon.com/images/I/91UGw8AzU5L.jpg",
        "artistAsin": "B001E77YC0",
        "artistName": "Green Day",
        "asin": "B01JNQ7KTA",
        "isInLibrary": null,
        "isMusicSubscription": true,
        "isPrime": true,
        "isRecommended": null,
        "languagesOfPerformance": null,
        "recentlyPlayedEntityType": "ALBUM",
        "timeStamp": 1531232643930,
        "title": "Revolution Radio"
    },
    "image": "https://m.media-amazon.com/images/I/91UGw8AzU5L.jpg",
    "playbackTarget": "https://music.amazon.co.uk/home?do=play&albumAsin=B01JNQ7KTA",
    "subTitle": "Green Day",
    "subTitleTarget": "https://music.amazon.co.uk/artists/B001E77YC0",
    "text": "",
    "tileTarget": "https://music.amazon.co.uk/albums/B01JNQ7KTA",
    "title": "Revolution Radio",
    "titleTarget": "https://music.amazon.co.uk/albums/B01JNQ7KTA"
}

There is a page giving Recently Played Tracks too. Just need to find out what's underpinning it.

danieldaeschle commented 6 years ago

Green Day yeah! ;D

dufferzafar commented 5 years ago

Hey, any updates on this? I'm relatively free now, if there's some help you need, please let me know.

All I want to build is a Python script that would use requests to fetch all recently played tracks and dump them into a text file.

Jaffa commented 5 years ago

Not had a lot of chance to work on it I’m afraid, though the above does seem promising. I’m away from a Python-capable machine for the next couple of weeks, unfortunately.

On Fri, 17 Aug 2018 at 09:21, Shadab Zafar notifications@github.com wrote:

Hey, any updates on this? I'm relatively free now, if there's some help you need, please let me know.

All I want to build is a Python script that would use requests to fetch all recently played tracks and dump them into a text file.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Jaffa/amazon-music/issues/14#issuecomment-413780547, or mute the thread https://github.com/notifications/unsubscribe-auth/AASNBb6jcUVzkTeabBjKQhxVBmwVcuNNks5uRm8KgaJpZM4VQmkn .

-- Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org/