iv-org / invidious

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

[Bug] /api/v1/search/ - missing protocol names in channel thumbnail URLs #4895

Open brunteless opened 3 weeks ago

brunteless commented 3 weeks ago

Describe the bug Links that point to a channel thumbnail from the search endpoint have missing https: or http: protocol name. 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. See the URLs start with //yt.image.provider/... instead of https://yt.image.provider/... or http://yt.image.provider/...

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 What I presume should be the correct behavior:

[  
   {  
       "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": 32,  
               "height": 32  
           },  
           {  
               "url": "https://yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 48,  
               "height": 48  
           },  
           {  
               "url": "https://yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 76,  
               "height": 76  
           },  
           {  
               "url": "https://yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 100,  
               "height": 100  
           },  
           {  
               "url": "https://yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 176,  
               "height": 176  
           },  
           {  
               "url": "https://yt3.ggpht.com/fxGKYucJAVme-Yz4fsdCroCFCrANWqw0ql4GYuvx8Uq4l_euNJHgE-w9MTkLQA805vWCi-kE0g=s88-c-k-c0x00ffffff-no-rj-mo",  
               "width": 512,  
               "height": 512  
           }  
       ]  
   },
   ...  
]

Note If the current behavior is correct (e.g. to give developers a choice between http and https), it should be reflected in the documentation more clearly.