xmtv_api

Crates.ioxmtv_api
lib.rsxmtv_api
version0.1.7
sourcesrc
created_at2024-08-12 03:47:44.282427
updated_at2024-09-16 00:54:55.382645
description一个封装好的自用库
homepage
repository
max_upload_size
id1333837
size13,982
(vintcessun)

documentation

README

解析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

}

Commit count: 0

cargo fmt