mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-24 23:06:13 +03:00
[GH-ISSUE #806] Views from get_song do not match those visible on YouTube Music. #505
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#505
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 @Matp21 on GitHub (Aug 22, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/806
Hi!
I'm trying to retrieve the music view counter using the
get_song()function, but the result I get never matches the counter displayed on YouTube Music, sometimes by a long shot.For example, I use this code to retrieve the values for this song : https://music.youtube.com/watch?v=M7X8W1HbtRQ&si=3e-jE30n1GGjP3Ff.
The function gives me 53,670,696 views, but on the website it says 539 million views.
`from ytmusicapi import YTMusic, OAuthCredentials
import json
with open("credentials.json",'r') as f :
credentials = json.load(f)
client_id = credentials["installed"]["client_id"]
client_secret = credentials["installed"]["client_secret"]
yt_music = YTMusic("oauth.json", oauth_credentials=OAuthCredentials(client_id=client_id, client_secret=client_secret))
results = yt_music.get_song("M7X8W1HbtRQ")
print(results["videoDetails"]['viewCount'])`
Thanks!
@sigma67 commented on GitHub (Aug 30, 2025):
No idea to be honest. Looks like a server-side issue.
You're also comparing two different data sources here.
get_songoccurs when you press play, what you're showing is the result fromget_album(where it should also show 539M with ytmusicapi).