lamarios / clipious

Invidious client for android
GNU Affero General Public License v3.0
873 stars 30 forks source link

Proxy setting doesn't function as expected #504

Closed WardPearce closed 5 months ago

WardPearce commented 5 months ago

Describe the bug Greetings, after looking over the Clipious code base. It appears videos aren't proxied correctly if the proxy setting is enabled.

To Reproduce

  1. Enable proxy

Expected behavior For videos to be proxied

Additional context It appears the code base appends '?local=true' to the Google CDN URL, this doesn't actually proxy the video. Or might be that you are passing 'local=true' to the videos API, what doesn't give the proxied video URL (for whatever reason)

Solution should probably look something like this (made for a different project im working on using TS)

if (proxyVideos) {
    const rawSrc = new URL(format.url);
    rawSrc.host = import.meta.env.VITE_DEFAULT_INVIDIOUS_INSTANCE.replace(
        'http://',
        ''
    ).replace('https://', '');

    src = rawSrc.toString();
} else {
    src = format.url;
}

Basically just replacing the Google CDN hostname with my invidious instance.

WardPearce commented 5 months ago

👍