invidious
invidious copied to clipboard
[Bug] sort_by=upload_date does not work
Calling the search endpoint with sort_by=upload_date
does not return the results ordered by upload date.
Examples:
- https://watch.thekitty.zone/api/v1/search/?q=Real+Madrid&sort_by=upload_date
- https://invidious.snopyta.org/api/v1/search/?q=Real+Madrid&sort_by=upload_date
I would expect (maybe I'm wrong?) for the results to be sorted according to the "published" property so that they match the order returned by this equivalent YouTube search:
- https://www.youtube.com/results?search_query=real+madrid&sp=CAI%253D
But #2824 is similar, but not the same, as there is no colon in any of the parameters.
I just noticed that this seems to be a more general problem with sort_by
:
-
sort_by=upload_date
andsort_by=view_count
do not return results in the expected order. -
sort_by=rating
andsort_by=relevance
might or might not work, as I don't know which returned field to check... but in any case they return results in the same order (which is also the same order returned byupload_date
andview_count
).
In other words... it looks like the sort_by
has no effect, no matter the argument used.
Either I'm doing something wrong (quite posible!) or there is a bug or the documentation needs to be updated to remove that parameter if no longer supported. Does this make sense?
Same issue here, sort_by: upload_date doesn't actually sort by date, but private browser window search by upload_date gives different ordered results than normal search so it seems to be a bug with invidious
update: I was looking through the code, it seems the doc is just wrong, param is just sort not sort_by and value is date and not upload_date.
Everything works. I think the issue can be closed, maybe update the doc.
sort=date and sort=views seem to be used instead.
@SamantazFox should the api docs be updated or should the code be updated to support both? The parameter name (sort_by => sort) and some of the values (upload_date => date, view_count => views) in the api docs don't match what is used in Invidious
This issue has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, you just have to post a comment and it will be unmarked.
PR is still open in the docs repo so this can stay open