[GH-ISSUE #285] Uploads search not working #224

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

Originally created by @jskills on GitHub (Jul 31, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/285

Running this one line works only when removing the "scope" parameter. If I want to limit my search to files I have uploaded, it fails.

results = ytm.search(query='love', filter='songs', scope='uploads', limit=20)

Traceback (most recent call last):
  File "simple.py", line 5, in <module>
    results = ytm.search(query='love', filter='songs', scope='uploads', limit=20)
  File "/home/jskills/.local/lib/python3.6/site-packages/ytmusicapi/mixins/search.py", line 157, in search
    results = nav(results, SECTION_LIST)
  File "/home/jskills/.local/lib/python3.6/site-packages/ytmusicapi/navigation.py", line 72, in nav
    raise err
  File "/home/jskills/.local/lib/python3.6/site-packages/ytmusicapi/navigation.py", line 66, in nav
    root = root[k]
KeyError: 'contents'
Originally created by @jskills on GitHub (Jul 31, 2022). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/285 Running this one line works only when removing the "scope" parameter. If I want to limit my search to files I have uploaded, it fails. `results = ytm.search(query='love', filter='songs', scope='uploads', limit=20)` ``` Traceback (most recent call last): File "simple.py", line 5, in <module> results = ytm.search(query='love', filter='songs', scope='uploads', limit=20) File "/home/jskills/.local/lib/python3.6/site-packages/ytmusicapi/mixins/search.py", line 157, in search results = nav(results, SECTION_LIST) File "/home/jskills/.local/lib/python3.6/site-packages/ytmusicapi/navigation.py", line 72, in nav raise err File "/home/jskills/.local/lib/python3.6/site-packages/ytmusicapi/navigation.py", line 66, in nav root = root[k] KeyError: 'contents' ```
kerem 2026-02-27 22:08:41 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jskills commented on GitHub (Jul 31, 2022):

This had been working just fine, but stopped a few months ago - presumably to a change on Youtube's end ... ?

<!-- gh-comment-id:1200517735 --> @jskills commented on GitHub (Jul 31, 2022): This had been working just fine, but stopped a few months ago - presumably to a change on Youtube's end ... ?
Author
Owner

@sigma67 commented on GitHub (Aug 2, 2022):

This query can't work because there are no filters for upload search (see web interface). If you remove the filter param it will work fine. Though I guess we could add some sort of exception if filters are used in combination with the "uploads" scope.

<!-- gh-comment-id:1202342424 --> @sigma67 commented on GitHub (Aug 2, 2022): This query can't work because there are no filters for upload search (see web interface). If you remove the filter param it will work fine. Though I guess we could add some sort of exception if filters are used in combination with the "uploads" scope.
Author
Owner

@jskills commented on GitHub (Aug 2, 2022):

Thanks for the (fast!) reply.

I have a set of processes that I have written that locate files I have uploaded to YTMusic to automate playlist building. This same query used to work just fine, so I assume YT changed something on their side.

Anyway, if I wanted to query uploads only, are you saying if I used "scope=uploads" I have to pull them all down (since I cannot filter) and then do any queries locally?

<!-- gh-comment-id:1202861767 --> @jskills commented on GitHub (Aug 2, 2022): Thanks for the (fast!) reply. I have a set of processes that I have written that locate files I have uploaded to YTMusic to automate playlist building. This same query used to work just fine, so I assume YT changed something on their side. Anyway, if I wanted to query uploads only, are you saying if I used "scope=uploads" I have to pull them all down (since I cannot filter) and then do any queries locally?
Author
Owner

@sigma67 commented on GitHub (Aug 3, 2022):

Of course you can filter with a text query, but you cannot filter by the filter param. So while your query may have worked in the past, the filter=songs argument never did anything. I suspect that as a result of some changes to ytmusicapi or YouTube Music the faulty query no longer works. So just leave out filter=songs and you're good.

<!-- gh-comment-id:1203775977 --> @sigma67 commented on GitHub (Aug 3, 2022): Of course you can filter with a text query, but you cannot filter by the `filter` param. So while your query may have worked in the past, the filter=songs argument never did anything. I suspect that as a result of some changes to ytmusicapi or YouTube Music the faulty query no longer works. So just leave out filter=songs and you're good.
Author
Owner

@jskills commented on GitHub (Aug 4, 2022):

Hey this is super helpful. Thank you very much, You do are great job as owner of this repo BTW :)

<!-- gh-comment-id:1205758432 --> @jskills commented on GitHub (Aug 4, 2022): Hey this is super helpful. Thank you very much, You do are great job as owner of this repo BTW :)
Author
Owner

@sigma67 commented on GitHub (Aug 5, 2022):

Thanks! Added a little exception as well.

<!-- gh-comment-id:1206423403 --> @sigma67 commented on GitHub (Aug 5, 2022): Thanks! Added a little exception as well.
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#224
No description provided.