Skip to content

Commit

Permalink
[mod] 全局化 USER_AGENT
Browse files Browse the repository at this point in the history
  • Loading branch information
Borber committed Jan 8, 2023
1 parent f8fdd93 commit f6f6ba2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use once_cell::sync::Lazy;
use reqwest::Client;

pub const USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54";

pub static CLIENT: Lazy<Client> = Lazy::new(Client::new);
3 changes: 1 addition & 2 deletions src/live/bilibili.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use crate::{
common::CLIENT,
common::{CLIENT, USER_AGENT},
modle::{Node, ShowType},
};

use anyhow::{Ok, Result};

const INIT_URL: &str = "https://api.live.bilibili.com/room/v1/Room/room_init";
const URL: &str = "https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo";
const USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54";

/// bilibili直播
///
Expand Down

0 comments on commit f6f6ba2

Please sign in to comment.