mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[GH-ISSUE #305] [get_watch_playlist] Counterpart key always missing #235
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#235
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 @JibayMcs on GitHub (Oct 4, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/305
ytmusicapi version: 0.23
Hi,
After months of using this great api, I'm unable to get the counterpart key to fetch "audio only" videos without video clip.
Refering to the documentation the key is optional, and it's ok.
But, in any way I want to fetch a video or a playlist with
get_watch_playlistcounterpart is missing.It is due to authentication ?
I've tested with this music: https://music.youtube.com/watch?v=fa5IWHDbftI (audio edit only)
and it's counterpart: https://music.youtube.com/watch?v=FGBhQbmPwH8 (video clip)
I use this simple line of code:
Thanks for your help !
Best regards,
@sigma67 commented on GitHub (Oct 4, 2022):
It works fine for me.
counterpartis only present on authenticated requests. Did you verify that your credentials still work?@JibayMcs commented on GitHub (Oct 4, 2022):
I used an authenticated request, and my json seems to be correct, here it is
headers.json
Detailed code used
File Tree representation
After replacing my "Cookies" properties fetched with firefox, it still not working
Output json
@sigma67 commented on GitHub (Oct 4, 2022):
Not sure what to tell you, I just tried with your headers and the counterpart was there for every song.
What does it look like on the web interface for you? It seems your response only contains videos, no songs (each result has a views key).
Perhaps it's related to your country of origin? What's the playlistId you're passing in? I just used the videoId.
output for first track for me
@JibayMcs commented on GitHub (Oct 4, 2022):
In the web interface I can switch between "Title" and "Video"
Interface screenshot
But yes, my country origin is France so my headers have some keys like fr, fr_FR, etc.
This feature is maybe only available for country code en, en_US ?
(I don't really know how it's handled)
On writing this comment I've made some tests in the headers.json
But no changes,
Updated headers.json
(this json will not work, i've removed and edited some parts to hide sensible tokens)
@sigma67 commented on GitHub (Oct 4, 2022):
No it should be available for you, as you can also switch on the web interface. If the data is available there it should be available in ytmusicapi, provided you're using the same credentials. Are other authenticated endpoints like
get_library_songsworking fine?
@JibayMcs commented on GitHub (Oct 4, 2022):
Yep it work nicely !
Just tested with ordered
get_library_songs(order='recently_added')Web interface
Json results
@sigma67 commented on GitHub (Oct 4, 2022):
Ok perhaps you can send me your valid
headers.jsontoytmusicapi@gmail.comso I can debug this.@JibayMcs commented on GitHub (Oct 4, 2022):
Sended !
Thanks for your help and your time !
@JibayMcs commented on GitHub (Oct 4, 2022):
Ooooookay !
I've found the issue !
It's because I copied the Cookie value directly on the debugger of firefox, and not the complete Right click on the request -> Copy -> Copy request headers.
In the debugger the cookie is truncated.. and I have not paid attention...
And with the right copy method:
I'm so sorry for the inconvenience !
Thank your for your help !
Best regards !
@sigma67 commented on GitHub (Oct 4, 2022):
Ah okay I see this was the resolution, glad you found the issue :)
@JibayMcs commented on GitHub (Oct 4, 2022):
Thanks for your help ! And sorry for my miss reading documentation !