Skip to content

Instantly share code, notes, and snippets.

@infinity0
Last active July 19, 2020 19:12
Show Gist options
  • Save infinity0/e1c339389797634968cf218a934b3ebe to your computer and use it in GitHub Desktop.
Save infinity0/e1c339389797634968cf218a934b3ebe to your computer and use it in GitHub Desktop.
Chromecast Spotify on Debian Chromium, via a proxy

Tested 2020-07-19 chromium 83

You need to do:

  • chrome://flags and enable load-media-router-component-extension, might have to restart 1-2 times to take effect
  • download libwidevinecdm.so, see README.debian for details, restart to take effect
  • ublock filters (not whitelist, those are something else):
    • @@||www.gstatic.com/cast/*$script,domain=open.spotify.com
    • @@||www.gstatic.com/cv/js/sender/v1/cast_sender.js$script,domain=open.spotify.com
  • umatrix rules:
    • spotify.com scdn.co * allow
    • add gcaptcha rules on spotify.com, you can do this via the nice UI. alternatively via the technical UI:
      • spotify.com www.google.com * allow
      • spotify.com www.google.com frame allow
      • spotify.com www.gstatic.com * allow
  • directly after doing all of this, spotify will still complain about "enable secure content". just restart chromium then it will go away

You don't need to do:

  • no need to switch off HTTPS everywhere
  • no need to change user agent
  • no need to set --proxy-bypass-list=192.168.*, the cast extension will bypass the proxy automatically

Notes & debugging

  • This does not hide your chromecast IP address, you will need another solution for that (e.g. proxy in your router)
  • If your proxy is high-latency like tor:
    • give each web UI action a few seconds to take effect before doing the next thing
    • occasionally (due to sloppy coding in spotify) the page will load things in the wrong order and you will get errors in the console like "could not do X before cast is defined" when trying to select your chromecast as the listening device. just reload the page patiently, and maybe switch to another tor circuit, and this will eventually fix itself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment