biliget 0.6.8

简单的B站视频下载工具 支持免登录下载B站高清视频
1
2
3
4
5
6
7
8
9
use regex::Regex;

lazy_static::lazy_static! {
    static ref BVID_REGEX: Regex = Regex::new(r"\bBV\w{10}\b").unwrap();
}

pub fn get_bvid_from_url(url: &str) -> Option<String> {
    BVID_REGEX.find(url).map(|mat| mat.as_str().to_string())
}