I wanted to watch the Olympics on a non-NBC channel. CBC was easy to get working in a browser with a Canadian proxy, but I wanted to use a proper media player, so I wrote this.
This is quick and very dirty. I don't intend to expand it beyond watching the Olympics or fix it if it breaks once I'm done watching them. (Update: Fixed for Beijing 2022.) (Update: Fixed for Paris 2024.)
- Install streamlink and configure it
- Build from source (
cargo install --git https://github.com/AlyoshaVasilieva/cbc-sl
) or download a pre-built binary - Run
cbc-sl --list
orcbc-sl --replays
to see what you can watch - Run
cbc-sl ID
to call streamlink. (The IDs look like9.6441556
).
You can also use URLs, such as cbc-sl https://www.cbc.ca/player/play/video/9.6441556
Use -p scheme://IP:port
to specify a proxy. Supports HTTP, SOCKS4a, SOCKS5H proxies.
Streamlink must be set to handle the stream itself (via e.g. player-continuous-http
),
not to allow the player to handle it (such as using player-passthrough=http,hls
).
As an example, here's my config file on Windows:
player=C:\path\to\mpv.exe
player-continuous-http
ffmpeg-ffmpeg=C:\Program Files\Streamlink\ffmpeg\ffmpeg.exe
# download multiple segments at once:
stream-segment-threads=2
# reduce latency, increase chance of buffering:
hls-live-edge=2
You're probably running into the geo-blocking. CBC tries to block VPNs. If you can't watch the stream/replay on CBC.ca, it's probably this. (Note that the CBC player may report a "timeout", rather than saying you're blocked.)
If you can watch streams on the website, but can't with this tool, open an issue.
- If your player fails to detect audio, look for a configuration option like "Stream Analysis Duration" and increase it.
- You can't seek, even in replays, unless your player has its own cache. Limitation of streamlink.
- CBC's streams are 1080p30.