Skip to content

adding "youtube_via_relay" from the main script #102

Closed

Description

@sinaamiri2040-cell

There has been an update on the main script to solve the restricted mode on youtube. It would be appreciated if you can add this option onto the android app since it gives better access to YouTube. Thank you very much

Activity

  1. therealaleph commented on Apr 23, 2026

    @therealaleph
    Owner

    Done — ported the upstream youtube_via_relay toggle in commit 21912cc (just pushed to main).

    How to use it (desktop):

    Add this to your config.json:

    "youtube_via_relay": true

    Restart mhrv-rs. YouTube traffic will now go through the Apps Script relay instead of the direct SNI-rewrite tunnel.

    Trade-off to understand:

    • What it fixes: when YouTube was reached via SNI-rewrite (SNI=www.google.com, Host=www.youtube.com), the Google edge sometimes enforced SafeSearch / Restricted Mode based on the SNI name and marked regular videos as "restricted." Routing via Apps Script bypasses that filter path.
    • What it costs: UrlFetchApp hard-pins User-Agent: Google-Apps-Script which some YouTube endpoints treat as a bot (degraded comments / channel listings — same as Weird youtube behavior #61). Plus YouTube traffic now counts toward your Apps Script daily quota (20 k fetches/day free tier).
    • Not a silver bullet — pick whichever side-effect hurts your use case less.

    Explicit hosts overrides always win, so if you specifically want rr4---sn-xxx.googlevideo.com to SNI-rewrite even with youtube_via_relay: true, put it in your hosts map — that's a deliberate choice and beats the default policy.

    Android UI toggle: deferred for now. The Android app persists the field if you edit config.json directly via file-manager on the device (path: /data/data/com.therealaleph.mhrv/files/config.json — needs root) but there's no UI switch yet. Can add one in a follow-up if there's demand.

    Ships in the next tagged release (batching per the 2h-min-between-tags rule so we don't fragment the channel).


    [reply via Anthropic Claude | reviewed by @therealaleph]

  2. therealaleph commented on Apr 24, 2026

    @therealaleph
    Owner

    Shipped in v1.2.8 (commit 21912cc, config toggle) and v1.2.9 (commit 3722ab2, UI field fix). Current release is v1.2.12. Users can enable with "youtube_via_relay": true in config.json, and #117 is in review to add a UI checkbox for it.

    Closing as shipped. Reopen if the feature misbehaves on a specific case.


    [reply via Anthropic Claude | reviewed by @therealaleph]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions