mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[GH-ISSUE #351] get_library_upload_songs returning nothing #279
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#279
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rderidder-lda on GitHub (Feb 13, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/351
Hello!
I am able to connect and create playlists, and they appear in yt under the right account, etc.
However when I call get_library_upload_songs, it returns nothing - though I have many songs.
This was working for me perfectly just less than a month ago.
I tried tracing it, and it seems like something around the fact that the SESSION_LIST has no 'contents', or, in the nav function it gets 2 items named contents, so the second one fails.. really not sure - but maybe that helps.
Basically, an exception is raised when it gets to the second 'contents' in the items parameter during the loop within the nav function (navigation.py).
I don't *think its my side - maybe something changed with yt's API?
else, let me know what it might be..
Thanks!
@sigma67 commented on GitHub (Feb 14, 2023):
It works just fine, make sure you've configured the correct account.
https://ytmusicapi.readthedocs.io/en/stable/usage.html#brand-accounts
@rderidder-lda commented on GitHub (Feb 14, 2023):
weird.. what circumstances would allow it to create a playlist, but not get the uploads?
Also curious how it was working until I left it for awhile, and had to update the cookie. Could it be something with the cookie? Again, not sure what is specific about the uploads vs the ability to create a playlist..
As mentioned.. I stepped through the code in debug.. and I see the response get tons of songs back.. but then the nav function returns nothing due to an exception with the second Contents item
@rderidder-lda commented on GitHub (Feb 14, 2023):
response has lots of songs within in:
response = self._send_request(endpoint, body)
but
results = get_library_contents(response, MUSIC_SHELF)
returns nothing due to an exception within
contents = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST, True)
it gets the exception when it hits the second Contents item (which is part of SECTION_LIST. The first Contents is in SINGLE_COLUMN_TAB)
@sigma67 commented on GitHub (Feb 14, 2023):
Again, do you have any brand accounts? Please check as instructed. https://myaccount.google.com/
And recreate your authentication credentials. Seeing that it has worked for you before it's unlikely to be a ytmusicapi issue.
@rderidder-lda commented on GitHub (Feb 14, 2023):
trying it out.. same issue.. but now I don't think its seeing the songs like it was with the credentials above.. So original way has the songs in the response, but something doesn't quite work.. This Brand way doesn't show the songs, so maybe i need to play with it to get to the right account. They have some strange account things going on it seems.
@rderidder-lda commented on GitHub (Feb 15, 2023):
So from what i can understand, I do have a brand account - but this account is not the one with my music library. If I enter ytmusic with it, i have to 'change accounts' under my profile image, and switch to the non brand account to see my library.
So that aligns with the above. When I use credentials without the brand account #, it does get the songs in the response (I literally see the songs in the response object after the self._send_request call in uploads.py), but something seems to be malformed and the nav function throws an exception inside the results = get_library_contents(response, MUSIC_SHELF) call.
When I use the brand account #, it doesn't have any songs in the response.. but it also gets the exception at the second Contents item.
SO not sure if that gives any hints.. but from what i see, it connects correctly using the credentials. Note that to further the point, I can create playlists with the yt object.. I just cant get_library_contents.
Let me know if there is anything more I can provide.. Could it be something else with the headers_auth.json contents that only effects getting library contents?
@rderidder-lda commented on GitHub (Feb 15, 2023):
got it working.. was on version 0.24.1 of the ytmusicapi library.. I upgraded to 0.25.0 and its working now .
(not using Branded account)
I see there was a change to the nav call.. its now
contents = nav(response, SINGLE_COLUMN + TAB_1_CONTENT + SECTION_LIST_ITEM + renderer,
True)