iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.46k stars 1.85k forks source link

[Bug] /api/v1/search/ - channel thumbnails are the same size #4896

Open brunteless opened 2 months ago

brunteless commented 2 months ago

Describe the bug During the writing of #4895, I noticed that the URLs are all identical the common image has size of 88 pixels, while the response reports 32, 48, 76, 100, 176, 512 pixels. This doesn't appear to be the case with the /api/v1/channels/:id endpoint.

Steps to Reproduce

  1. Go to https://your-instance-of.choice/api/v1/search?q=known-channel
  2. Find the given channel
  3. Scroll down to the authorThumbnails list
  4. Compare the thumbnails and their links

Example Search result consistent across multiple public API instances:

[  
   {  
       "type": "channel",  
       "author": "MrBeast",  
       "authorId": "UCX6OQ3DkcsbYNE6H8uQQuVA",  
       "authorUrl": "/channel/UCX6OQ3DkcsbYNE6H8uQQuVA",  
       "authorVerified": true,  
       "authorThumbnails": [  
           {  
               "url": "//yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 32,  
               "height": 32  
           },  
           {  
               "url": "//yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 48,  
               "height": 48  
           },  
           {  
               "url": "//yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 76,  
               "height": 76  
           },  
           {  
               "url": "//yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 100,  
               "height": 100  
           },  
           {  
               "url": "//yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 176,  
               "height": 176  
           },  
           {  
               "url": "//yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 512,  
               "height": 512  
           }  
       ]  
   },
   ...  
]

Possible Fix Either the use of the same logic that powers the /api/v1/channels/:id endpoint or a simple adjustment in the search response, similar to this one:

[  
   {  
       "type": "channel",  
       "author": "MrBeast",  
       "authorId": "UCX6OQ3DkcsbYNE6H8uQQuVA",  
       "authorUrl": "/channel/UCX6OQ3DkcsbYNE6H8uQQuVA",  
       "authorVerified": true,  
       "authorThumbnails": [  
           {  
               "url": "https://yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 88,  
               "height": 88  
           }  
       ]  
   },
   ...  
]

Note These are my first two bug reports ever, so I have no idea what I'm doing. If I've done something wrong, please don't hesitate to correct me.