8 releases

0.1.7 Sep 16, 2024
0.1.6 Aug 21, 2024

#658 in Database interfaces

Download history 394/week @ 2024-08-11 235/week @ 2024-08-18 14/week @ 2024-08-25 216/week @ 2024-09-15 15/week @ 2024-09-22 7/week @ 2024-09-29

464 downloads per month

MIT/Apache

14KB
331 lines

解析xmtv的一个库

内部实现了sql库的链接,按照日期划分,每日sql过期

接口

get_video_list.rs

pub fn get()->Result<Vec> 获取具体视频地址(分享地址),如果错误会无限重试

pub fn get_video_url(url:&String)->Result 从分享地址获取具体视频地址(每个)

pub fn resort (urls:Vec)->Vec 按照日期分类视频

pub fn get_video_to_url(mut videos:Vec)->Result<Vec> 一组视频获取

pub fn get_random_url_list(videos:&[Video])->Result<Vec> 获取随机一组视频

其中struct的定义

pub struct Videoplay{

pub name:String,

pub url:String

}

pub struct Video{

pub title:String,

pub range:Vec

}

pub struct VideoUrl{

pub title:String,

pub name:String,

pub url:String,

pub time:u32

}

sql.rs

默认保存位置const DB:&str = "urls.db";

pub fn update()->Result<()> 更新db

pub fn get_exact()->Result<Vec> 封装好的一键获取视频(具体mp4)库

pub fn get()->Result<Vec>获取视频地址

lib.rs

impl Videos{

pub fn get(&mut self)->Result<()>

pub fn random(&self)->Result<Vec>

pub fn index(&self, index: usize)->Video

}

Dependencies

~29–42MB
~700K SLoC