iv-org / invidious

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

[Enhancement] Add the option to supply client_config related fields from API #4766

Closed ThaDaVos closed 3 days ago

ThaDaVos commented 3 days ago

Is your enhancement request related to a problem? Please describe.

Since the last issue with youtube not returning the expected video - https://github.com/iv-org/invidious/issues/4498 - my Android Device using the Clipious has stopped playing DASH video's and now since about two/three weeks it's only capable of playing 360p video's - I am guessing this has something to do with my device being Android 7 and not supporting AV1 codec, as checking the DASH manifest returned, it only contains AV1 streams:

<Representation id="299" codecs="avc1.64002a" width="1920" height="1080" startWithSAP="1"
  maxPlayoutRate="1" bandwidth="6509775" frameRate="60">
  <BaseURL>
    https://{INVIDIOUS_INSTANCE}/videoplayback?expire=1719526376&amp;ei=iI99ZtrzKKu46dsPgLOqsA8&amp;ip={IP}&amp;id=o-APptZmsF76T31409U_cMk3jyFTplUYQKr5i0KNIB80HK&amp;itag=299&amp;source=youtube&amp;requiressl=yes&amp;xpc=EgVo2aDSNQ%3D%3D&amp;mh=bP&amp;mm=31%2C29&amp;mn=sn-5hne6ns6%2Csn-5hnekn7s&amp;ms=au%2Crdu&amp;mv=m&amp;mvi=4&amp;pl=20&amp;initcwndbps=1513750&amp;vprv=1&amp;svpuc=1&amp;mime=video%2Fmp4&amp;rqh=1&amp;gir=yes&amp;clen=222717697&amp;ratebypass=yes&amp;dur=303.703&amp;lmt=1719496361239824&amp;mt=1719504308&amp;fvip=3&amp;keepalive=yes&amp;c=ANDROID_TESTSUITE&amp;txp=6309224&amp;sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cvprv%2Csvpuc%2Cmime%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&amp;sig=AJfQdSswRQIhAO1ekkMvd-BDlB_8UFyENJXSd6vSt_HmpuoU3zMK7ZySAiBzToVGBmaISIGCxIIHKQx9XuLdTog5cMA-pa28eQVqtQ%3D%3D&amp;lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&amp;lsig=AHlkHjAwRQIhAMOK5hcEmoBGtXLSSe0X6aCyPhxh4eihazF3IuxLPXfuAiA3KAWDzlFLcmb7lV0MoQ1Nmp_0CvgiGeuzYVnSJU53mg%3D%3D&amp;host=rr4---sn-5hne6ns6.googlevideo.com</BaseURL>
  <SegmentBase indexRange="741-1432">
    <Initialization range="0-740" />
  </SegmentBase>
</Representation>

So I went ahead and starting to go through the code - as nothing has changed on Clipious's side since the issue with Youtube mentioned above - I guess it has something to do with the request made from Invidious itself.

So I started thinking and checking the code - and noticed that for Android Youtube is told it's a Android 12 Device with SDK version 31+ - but my device isn't so I guess that may result in the DASH stream containing AV1 codec:, also based on below information https://www.yahoo.com/tech/recent-just-brought-av1-support-001326669.html?guccounter=1&guce_referrer=aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS8&guce_referrer_sig=AQAAAFAWCK36YZ6DE6ovAof6vIyztoEwAhkeyIHJMDlFfHRE6vy-iKSyj4LRYTu4OB_13Yjl2sXXKU3z1NN-VFyExIrF2EjscBJUILIUQyVN-0zwC6ymvNv_HjIjmM2UWsRiRN1CeP-KrEcc2EbkUTHuqH2pAMAMAfdNLBwsKaJsp5dF

Describe the solution you'd like

I would love to see it possible to pass CLIENT_CONFIG overrides through the Invidious API so Clients can pass this data along to make sure the correct video formats are returned by Youtube.

Describe alternatives you've considered

Coding the change myself and supplying a PR to Invidious - sadly I don't know Crystal and it seems there's a little learning curve before I can supply anything noteworthy

Additional context

https://github.com/lamarios/clipious/issues/559

unixfox commented 3 days ago

https://github.com/iv-org/invidious/issues/3012 https://github.com/iv-org/invidious/issues/3342

Youtube only provides AV1 or VP9 whatever the device info passed to their server.

ThaDaVos commented 3 days ago

Please re-open this - as currently devices with NO AV1 support are getting AV1 results - which I guess is based on the passed Android Version - which seem hardcoded in Invidious.

Also, being able to pass client_specific information from the client to Youtube may also ease testing and resolving of bugs - also probably makes it more resilient.

unixfox commented 3 days ago

Did you read what I wrote:

Youtube only provides AV1 or VP9 whatever the device info passed to their server.

? THE DEVICE INFO DOESN'T MATTER.

Also, there is already an issue opened for having the ability to get VP9 through the dash API: https://github.com/iv-org/invidious/issues/3342

ThaDaVos commented 3 days ago

Sorry - I am not a native English speaker so I misinterpreted the "whatever" as depending on...