# Setting Up Bilistream: System Requirements, Installation, and Configuration Guide

> Learn how to set up Bilistream. Discover the system requirements, including FFmpeg, Python 3, yt-dlp, config.yaml with Bilibili cookies, and Docker or Rust. Get started today!

- Repository: [InitCool/bilistream](https://github.com/limitcool/bilistream)
- Tags: getting-started
- Published: 2026-03-06

---

**Setting up Bilistream requires FFmpeg, Python 3 with yt-dlp, a valid [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) with Bilibili authentication cookies, and either Docker or the Rust toolchain to run the application.**

Bilistream is a Rust-based relay tool that automatically streams content from Twitch or YouTube (including preview-type live streams) to Bilibili. Before you can launch the application from the `limitcool/bilistream` repository, you must satisfy several system-level dependencies and provide specific authentication credentials.

## System Requirements

Bilistream operates as a bridge between external streaming platforms and Bilibili, which necessitates specific binaries and runtime environments for stream processing and API communication.

### Core Dependencies

Regardless of your deployment method, the following must be present on your host system:

- **FFmpeg** – Handles the actual stream ingestion from source platforms and RTMP push to Bilibili servers.
- **Python 3 and pip** – Required to install `yt-dlp`, which Bilistream uses internally to extract direct stream URLs from Twitch and YouTube.
- **yt-dlp** – Install via `pip3 install -U yt-dlp` to enable platform-specific stream URL extraction.

If building from source rather than using Docker, you also need the **Rust toolchain**. According to [`Cargo.toml`](https://github.com/limitcool/bilistream/blob/main/Cargo.toml) in the repository root, the project requires `cargo` version 1.56 or higher and uses the Rust 2021 edition.

### Optional Components

- **Docker and Docker Compose** – Provides the simplest deployment path via the pre-built image `ghcr.io/limitcool/bilistream:latest`.
- **Gotify server** – Required only if you want push notifications when streams start.
- **Netscape-format cookies.txt** – Optional file exported from your browser to authenticate with Twitch or YouTube for restricted content.

## Installation Methods

You can deploy Bilistream either as a containerized application or as a native binary compiled from the Rust source.

### Docker Deployment (Recommended)

The Docker approach eliminates the need to install Rust or manage Python dependencies manually. Create a [`docker-compose.yaml`](https://github.com/limitcool/bilistream/blob/main/docker-compose.yaml) file that mounts your configuration:

```yaml
services:
  bilistream:
    image: ghcr.io/limitcool/bilistream:latest
    container_name: bilistream
    volumes:
      - ./config.yaml:/app/config.yaml:ro
      - ./cookies.txt:/app/cookies.txt:ro
    restart: unless-stopped
    environment:
      - TZ=Asia/Shanghai
      # Uncomment if you need an HTTP proxy for FFmpeg outside China

      # - http_proxy=http://host.docker.internal:7890

```

This configuration mounts [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) as read-only and optionally includes a cookies file for platform authentication.

### Building from Source

To compile the binary yourself, first ensure FFmpeg and Python 3 are installed, then execute:

```bash

# Install Rust via rustup if not present

# Clone the repository

git clone https://github.com/limitcool/bilistream.git
cd bilistream

# Build release binary

cargo build --release

# Install Python dependency

pip3 install -U yt-dlp

# Run the binary

./target/release/bilistream

```

The entry point at [`src/main.rs`](https://github.com/limitcool/bilistream/blob/main/src/main.rs) orchestrates configuration loading, live-status polling, and FFmpeg process management.

## Configuration File Structure

Bilistream expects a [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) file in the working directory. The structure is defined in [`src/config.rs`](https://github.com/limitcool/bilistream/blob/main/src/config.rs), which parses the YAML into a `Config` struct at runtime.

### Required Bilibili Credentials

You must extract specific cookie values from your Bilibili account and provide your target room details:

```yaml
Interval: 60
Platform: Twitch
BiliLive:
  SESSDATA: "<your_sessdata_cookie>"
  bili_jct: "<your_bili_jct_cookie>"
  DedeUserID: "2235894"
  DedeUserID__ckMd5: "<hash_value>"
  Room: 660428
  BiliRtmpUrl: "rtmp://live-push.bilivideo.com/live-bvc/"
  BiliRtmpKey: "?streamname=live_0000000_0000000&key=xxxxxxxxxx..."

```

The `SESSDATA`, `bili_jct`, `DedeUserID`, and `DedeUserID__ckMd5` fields are mandatory for Bilibili authentication, while `Room` identifies your target live room ID.

### Platform-Specific Settings

Configure the source platform under the respective key:

- **Twitch**: Set `Twitch.Room` to your channel name.
- **YouTube**: Use `Platform: Youtube` or `YoutubePreviewLive` for specific stream types.

### Network Proxy and Notifications

If your server resides outside mainland China, configure the `FfmpegProxy` field to route FFmpeg traffic through an accessible HTTP proxy:

```yaml
FfmpegProxy: "http://127.0.0.1:7890"

```

For Gotify notifications, include:

```yaml
Gotify:
  Url: "https://example.com/gotify"
  Token: "your_application_token"

```

Optionally specify a cookies file path for YouTube or Twitch authentication:

```yaml
Cookies: "/app/cookies.txt"

```

## Summary

- **Setting up Bilistream** requires FFmpeg, Python 3 with yt-dlp, and a properly structured [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) containing Bilibili session cookies.
- The application supports two deployment paths: Docker (recommended for simplicity) or building from source with Cargo (requires Rust toolchain ≥ 1.56).
- Critical configuration fields in [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) include `SESSDATA`, `bili_jct`, `Room`, `BiliRtmpUrl`, and `BiliRtmpKey` under the `BiliLive` section.
- External servers may need `FfmpegProxy` configured to successfully pull streams from Twitch or YouTube.
- Optional features include Gotify push notifications and browser cookie files for platform authentication.

## Frequently Asked Questions

### Do I need Rust installed if using Docker?

No. The Docker image `ghcr.io/limitcool/bilistream:latest` contains a pre-compiled binary, so you only need Docker and Docker Compose. Rust is only required when building from source using `cargo build --release` as specified in [`Cargo.toml`](https://github.com/limitcool/bilistream/blob/main/Cargo.toml).

### What format should the cookies.txt file use?

Bilistream expects a **Netscape HTTP Cookie File** format. You can export this format from most browsers using extensions like "Get cookies.txt" or similar tools. Place the file at the path specified in the `Cookies` field of your [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) and mount it into the Docker container if applicable.

### How do I obtain the required Bilibili cookies?

Log into Bilibili via web browser, open developer tools (F12), navigate to Application/Storage > Cookies, and copy the values for `SESSDATA`, `bili_jct`, `DedeUserID`, and `DedeUserID__ckMd5`. Paste these into the `BiliLive` section of [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) as defined in [`src/config.rs`](https://github.com/limitcool/bilistream/blob/main/src/config.rs).

### Can I run Bilistream on a server outside China?

Yes, but you will likely need to configure `FfmpegProxy` in [`config.yaml`](https://github.com/limitcool/bilistream/blob/main/config.yaml) with a China-accessible HTTP proxy. This allows the FFmpeg process to successfully establish connections to Bilibili's RTMP push servers, which may have connectivity issues from certain international networks.