iv-org / invidious

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

[Enhancement] API: links to profile images and/or banners are not redirected #3796

Open Moonstone3010 opened 1 year ago

Moonstone3010 commented 1 year ago

Describe the bug

Via the developer API, URLs to profile images and/or banners are not redirected to Invidious instances, but connect to yt3.ggpht.com or yt3.googleusercontent.com instead. Connection is made both with proxy function turned on and of. Problem does not occur while using web interface.

Steps to Reproduce

Thanks, I have replicated this and it seems as though this is an upstream issue. I have tested multiple instances and they all return yt3.googleusercontent.com or domain of Google ownership.

To reproduce (as the app would send the request - using v1.17.7): curl -H 'user-agent: Dart/2.19 (dart:io)' -H 'content-type: application/json; charset=utf-16' --compressed https://inv.vern.cc/api/v1/channels/UCuAXFkgsw1L7xaCfnd5JJOw

It also happens when loading a video: curl -H 'user-agent: Dart/2.19 (dart:io)' -H 'content-type: application/json; charset=utf-16' --compressed -H 'host: inv.vern.cc' 'https://inv.vern.cc/api/v1/videos/o-YBDTqX_ZU?local=true'

Originally posted by @Outlet7493 in https://github.com/lamarios/clipious/issues/165#issuecomment-1539079470

Logs

Example response for channel request

```json { "author": "Rick Astley", "authorId": "UCuAXFkgsw1L7xaCfnd5JJOw", "authorUrl": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw", "authorBanners": [ { "url": "https://yt3.googleusercontent.com/bwf6FFMO4jUiJBfM-8SPQid-GaocQ2yktkSZt-J8T-pFnzyVP0OJWQ78qW3jyDOIFyQO9RVWVQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "width": 2560, "height": 424 }, { "url": "https://yt3.googleusercontent.com/bwf6FFMO4jUiJBfM-8SPQid-GaocQ2yktkSZt-J8T-pFnzyVP0OJWQ78qW3jyDOIFyQO9RVWVQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "width": 2120, "height": 351 }, { "url": "https://yt3.googleusercontent.com/bwf6FFMO4jUiJBfM-8SPQid-GaocQ2yktkSZt-J8T-pFnzyVP0OJWQ78qW3jyDOIFyQO9RVWVQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "width": 1060, "height": 175 }, { "url": "https://yt3.googleusercontent.com/bwf6FFMO4jUiJBfM-8SPQid-GaocQ2yktkSZt-J8T-pFnzyVP0OJWQ78qW3jyDOIFyQO9RVWVQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "width": 512, "height": 288 } ], "authorThumbnails": [ { "url": "https://yt3.googleusercontent.com/BbWaWU-qyR5nfxxXclxsI8zepppYL5x1agIPGfRdXFm5fPEewDsRRWg4x6P6fdKNhj84GoUpUI4=s32-c-k-c0x00ffffff-no-rj", "width": 32, "height": 32 }, { "url": "https://yt3.googleusercontent.com/BbWaWU-qyR5nfxxXclxsI8zepppYL5x1agIPGfRdXFm5fPEewDsRRWg4x6P6fdKNhj84GoUpUI4=s48-c-k-c0x00ffffff-no-rj", "width": 48, "height": 48 }, { "url": "https://yt3.googleusercontent.com/BbWaWU-qyR5nfxxXclxsI8zepppYL5x1agIPGfRdXFm5fPEewDsRRWg4x6P6fdKNhj84GoUpUI4=s76-c-k-c0x00ffffff-no-rj", "width": 76, "height": 76 }, { "url": "https://yt3.googleusercontent.com/BbWaWU-qyR5nfxxXclxsI8zepppYL5x1agIPGfRdXFm5fPEewDsRRWg4x6P6fdKNhj84GoUpUI4=s100-c-k-c0x00ffffff-no-rj", "width": 100, "height": 100 }, { "url": "https://yt3.googleusercontent.com/BbWaWU-qyR5nfxxXclxsI8zepppYL5x1agIPGfRdXFm5fPEewDsRRWg4x6P6fdKNhj84GoUpUI4=s176-c-k-c0x00ffffff-no-rj", "width": 176, "height": 176 }, { "url": "https://yt3.googleusercontent.com/BbWaWU-qyR5nfxxXclxsI8zepppYL5x1agIPGfRdXFm5fPEewDsRRWg4x6P6fdKNhj84GoUpUI4=s512-c-k-c0x00ffffff-no-rj", "width": 512, "height": 512 } ], "subCount": 3680000, "totalViews": 1806183311, "joined": 1422748800, "autoGenerated": false, "isFamilyFriendly": true, "description": "Official YouTube channel for Rick Astley.", "descriptionHtml": "Official YouTube channel for Rick Astley.
", "allowedRegions": [ "CR", "VN", "AI", [CUT] "BA", "JP" ], "tabs": [ "home", "videos", "streams", "releases", "playlists", "community", "store", "channels", "about" ], "authorVerified": true, "latestVideos": [ { "type": "video", "title": "Rick Astley - When I Fall In Love (Official Video, HD Remaster)", "videoId": "Zoedy_5fLmE", "author": "Rick Astley", "authorId": "UCuAXFkgsw1L7xaCfnd5JJOw", "authorUrl": "/channel/UCuAXFkgsw1L7xaCfnd5JJOw", "authorVerified": true, "videoThumbnails": [ { "quality": "maxres", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/maxres.jpg", "width": 1280, "height": 720 }, { "quality": "maxresdefault", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/maxresdefault.jpg", "width": 1280, "height": 720 }, { "quality": "sddefault", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/sddefault.jpg", "width": 640, "height": 480 }, { "quality": "high", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/hqdefault.jpg", "width": 480, "height": 360 }, { "quality": "medium", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/mqdefault.jpg", "width": 320, "height": 180 }, { "quality": "default", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/default.jpg", "width": 120, "height": 90 }, { "quality": "start", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/1.jpg", "width": 120, "height": 90 }, { "quality": "middle", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/2.jpg", "width": 120, "height": 90 }, { "quality": "end", "url": "https://inv.vern.cc/vi/Zoedy_5fLmE/3.jpg", "width": 120, "height": 90 } ], "description": "'When I Fall In Love' Official Video, HD Remaster (2022). Taken from the album 'Whenever You Need Somebody'. Buy/listen here - https://rickastley.lnk.to/WYNS2022ID\nBuy the limited edition red...", "descriptionHtml": "'When I Fall In Love' Official Video, HD Remaster (2022). Taken from the album 'Whenever You Need Somebody'. Buy/listen here - https://rickastley.lnk.to/WYNS2022ID
Buy the limited edition red...", "viewCount": 316659, "published": 1670533892, "publishedText": "5 months ago", "lengthSeconds": 183, "liveNow": false, "premium": false, "isUpcoming": false }, { "type": "video", "title": "Rick Astley - Either Way (Chris Stapleton Cover)", "videoId": "zN_GNb_QXKk", "author": "Rick Astley", "authorId": "UCuAXFkgsw1L7xaCfnd5JJOw", "authorUrl": "/channel/UCuAXFkgsw1L7xaCfnd5JJOw", "authorVerified": true, "videoThumbnails": [ { "quality": "maxres", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/maxres.jpg", "width": 1280, "height": 720 }, { "quality": "maxresdefault", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/maxresdefault.jpg", "width": 1280, "height": 720 }, { "quality": "sddefault", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/sddefault.jpg", "width": 640, "height": 480 }, { "quality": "high", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/hqdefault.jpg", "width": 480, "height": 360 }, { "quality": "medium", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/mqdefault.jpg", "width": 320, "height": 180 }, { "quality": "default", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/default.jpg", "width": 120, "height": 90 }, { "quality": "start", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/1.jpg", "width": 120, "height": 90 }, { "quality": "middle", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/2.jpg", "width": 120, "height": 90 }, { "quality": "end", "url": "https://inv.vern.cc/vi/zN_GNb_QXKk/3.jpg", "width": 120, "height": 90 } ], "description": "Rick performing 'Either Way' by Chris Stapleton from his studio.\n\nSubscribe to the official Rick Astley YouTube channel: https://RickAstley.lnk.to/YTSubID \n\nFollow Rick Astley:\nFacebook: https://Ri...", "descriptionHtml": "Rick performing 'Either Way' by Chris Stapleton from his studio.

Subscribe to the official Rick Astley YouTube channel: https://RickAstley.lnk.to/YTSubID

Follow Rick Astley:
Facebook: https://Ri...", "viewCount": 343027, "published": 1662671492, "publishedText": "8 months ago", "lengthSeconds": 173, "liveNow": false, "premium": false, "isUpcoming": false }, { "type": "video", "title": "Rick Astley - Never Gonna Give You Up (Official Animated Video)", "videoId": "LLFhKaqnWwk", "author": "Rick Astley", "authorId": "UCuAXFkgsw1L7xaCfnd5JJOw", "authorUrl": "/channel/UCuAXFkgsw1L7xaCfnd5JJOw", "authorVerified": true, "videoThumbnails": [ { "quality": "maxres", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/maxres.jpg", "width": 1280, "height": 720 }, { "quality": "maxresdefault", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/maxresdefault.jpg", "width": 1280, "height": 720 }, { "quality": "sddefault", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/sddefault.jpg", "width": 640, "height": 480 }, { "quality": "high", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/hqdefault.jpg", "width": 480, "height": 360 }, { "quality": "medium", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/mqdefault.jpg", "width": 320, "height": 180 }, { "quality": "default", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/default.jpg", "width": 120, "height": 90 }, { "quality": "start", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/1.jpg", "width": 120, "height": 90 }, { "quality": "middle", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/2.jpg", "width": 120, "height": 90 }, { "quality": "end", "url": "https://inv.vern.cc/vi/LLFhKaqnWwk/3.jpg", "width": 120, "height": 90 } ], [CUT] } ```

Screenshots 2023-05-09 23_40_45-Window

unixfox commented 1 year ago

Switched to enhancement as we never stated that the API automatically support the ability to convert every resources to proxified requests.

There are probably other resources apart from the images where we do not support the ability to proxy.