Feat: Show a specific message when a playlist is unviewable - #9759
Feat: Show a specific message when a playlist is unviewable#9759Shadorc wants to merge 3 commits into
Conversation
|
HTTP 400 means invalid/incorrect payload, so while yes that is returned if the user enters rubbish, it will also be returned if YouTube ever changes how playlists are fetched (e.g. requiring a real session like they did with threaded comments or adding other extra request parameters/making existing ones mandatory) so if you don't want to do a fallback you should at the very least still log the error and show the error toast for that. Hiding real errors is generally a bad idea (while there are some valid reasons for it, none of those apply to FreeTube) as it just makes it makes debugging harder and trying to get useful information out of users in bug reports is already hard enough as it is. |
|
I was hesitant to add it, and you're right, it's better not to interpret a 400 error. |
Pull Request Type
Related issue
closes #9518
Description
Show a specific message, remove view count and video count when a playlist is private or does not exist.
I was wondering about removing the share button too but it can still make sense if someone wants to open it in YouTube instead.
Invidious message is a bit fragile because it's a parsing error rather than a handled edge case. I implemented it because the only regression that I can see is the same as with youtube.js, i.e. the message changes and we fallback to "This playlist currently has no videos"
Screenshots
Before:

After:

Testing
// removed from MR, do not test, kept as a reference
Desktop
Additional context
Errors thrown:
Private playlist
Could not extract playlistSidebarRenderer.The playlist does not exist.Invalid playlist:
Could not extract playlistSidebarRenderer.This playlist type is unviewable.// removed from MR, kept as a reference
Private playlist + invalid chars:
Error: non 200 status code. Youtube API returned status code 400. See <a href="https://docs.invidious.io/youtube-errors-explained/"> https://docs.invidious.io/youtube-errors-explained/</a> for troubleshooting.Request to https://www.youtube.com/youtubei/v1/browse?prettyPrint=false&alt=json failed with status code 400