Comments (3)
You're referring to songs with a store id, right (which is needed for get_track_info)? I don't think there's a good solution: Google just doesn't send that information to mobile clients for whatever reason.
It's possible to retrieve that information from the web client (eg), but because of the auth situation that doesn't really work outside the context of a Chrome Extension.
from gmusicapi.
Hi, probably I have not written clearly what I was asking for. However I have found a solution to my problem:
songs = mc.get_all_songs()
def get_songs_info(id_song):
for e in songs:
if e['id'] == id_song:
return {
"title": e['title'],
"artist": e['artist'],
"album": e['album']
}
def get_songs_of_playlist(playlist_name):
playlists = mc.get_all_user_playlist_contents()
for p in playlists:
p_dict_list = []
if playlist_name == p["name"]:
for track in p['tracks']:
p_dict_list.append(get_songs_info(track['trackId']))
return p_dict_list
Maybe it's more clear with the code than with my words, but I'm referring to songs that I have personally uploaded on Google Play Music.
My problem was to find information (title, artist etc.) about the songs contained inside a playlist. To do this I have first downloaded all the songs and then search every time with the trackId present inside the playlist.
My suggestion was to provide not only the trackId but also this other useful information inside a playlist dictionary, but for what I'm understanding now, this is not possible due to some Google policy. So I think this may be a good solution to achieve my purpose, otherwise let me know if there is something to improve in this solution or am I using the client in some wrong way.
Thank you.
from gmusicapi.
Ah, yes, I see what you're getting at. User-uploaded song metadata isn't provided inline in playlist responses; it needs to be looked up from the results of get_all_songs. Presumably Google made the apis this way since their own clients are pretty heavy (they run their own databases and everything).
There's some old discussion of this in #232 (comment). I'm more hesitant to automatically do the matching these days since these kinds of relationships happen in a few places and I'd rather not be inconsistent. Updating the docs to explain the situation would be good, though.
from gmusicapi.
Related Issues (20)
- UnicodeEncodeError on Mobileclient.search() HOT 2
- Searching for youtube video hits and info requires a GPM subscription HOT 1
- Mobileclient remove_entries_from_playlist() always returns the input parameters HOT 5
- Gmusicapi install error HOT 10
- ValidationException for GetArtists HOT 1
- get filesize of audiofile HOT 1
- Mac address error HOT 2
- Using dynamic oauth_filepath in Mobileclient HOT 8
- Mobileclient.get_all_songs() not returning all tracks HOT 2
- No Donation Button HOT 2
- Invalid Device id with id's returned from returned valid id's HOT 18
- gmusicapi.exceptions.CallFailure: GetStreamUrl: 403 Client Error: Forbidden for url: https://mclients.googleapis.com/music/mplay ... HOT 4
- Could not retrieve credentials from ... Simon Weber\\gmusicapi\\mobileclient.cred HOT 4
- Invalid artist and album ids on search HOT 3
- UnicodeEncodeError with logging when using Mobileclient Search HOT 1
- TypeError when running Musicmanager.get_uploaded_songs() HOT 4
- Value Error :( HOT 3
- Error while performing local test HOT 3
- Looks like Google Play Music is going away HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmusicapi.