[GH-ISSUE #227] videoId is not present for the top result #177

Closed
opened 2026-02-27 22:08:27 +03:00 by kerem · 0 comments
Owner

Originally created by @MrCyjaneK on GitHub (Sep 22, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/227

This is my code ytmusicsearch.py:

#!/usr/bin/env python3
from ytmusicapi import YTMusic
import json
import sys

ytmusic = YTMusic('headers_auth.json')
search_results = ytmusic.search(sys.argv[1])
print(json.dumps(search_results[0]))

I execute it like this: ./ytmusicsearch.py "eminem - we made you" | jq

But all I get in response is:

{
  "resultType": "top resul",
  "title": "We Made You",
  "thumbnails": [
    {
      "url": "https://lh3.googleusercontent.com/IA6sdmqe3uXwtYgNNbi8WDD6LmFcsSRccmHErKlNWh-WvWoyIHcnLrmVlPbdLMT5SDqo2DRHjUbQLU9m=w60-h60-l90-rj",
      "width": 60,
      "height": 60
    },
    {
      "url": "https://lh3.googleusercontent.com/IA6sdmqe3uXwtYgNNbi8WDD6LmFcsSRccmHErKlNWh-WvWoyIHcnLrmVlPbdLMT5SDqo2DRHjUbQLU9m=w120-h120-l90-rj",
      "width": 120,
      "height": 120
    }
  ]
}

There is no videoId in the first result. For other search_results the videoId is present, it is missing only from the top result

Originally created by @MrCyjaneK on GitHub (Sep 22, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/227 This is my code `ytmusicsearch.py`: ```plain #!/usr/bin/env python3 from ytmusicapi import YTMusic import json import sys ytmusic = YTMusic('headers_auth.json') search_results = ytmusic.search(sys.argv[1]) print(json.dumps(search_results[0])) ``` I execute it like this: `./ytmusicsearch.py "eminem - we made you" | jq` But all I get in response is: ```json { "resultType": "top resul", "title": "We Made You", "thumbnails": [ { "url": "https://lh3.googleusercontent.com/IA6sdmqe3uXwtYgNNbi8WDD6LmFcsSRccmHErKlNWh-WvWoyIHcnLrmVlPbdLMT5SDqo2DRHjUbQLU9m=w60-h60-l90-rj", "width": 60, "height": 60 }, { "url": "https://lh3.googleusercontent.com/IA6sdmqe3uXwtYgNNbi8WDD6LmFcsSRccmHErKlNWh-WvWoyIHcnLrmVlPbdLMT5SDqo2DRHjUbQLU9m=w120-h120-l90-rj", "width": 120, "height": 120 } ] } ``` There is no videoId in the first result. For other `search_results` the videoId is present, it is missing only from the top result
kerem 2026-02-27 22:08:27 +03:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#177
No description provided.