missav fix
This commit is contained in:
@@ -6,6 +6,7 @@ use crate::status::*;
|
|||||||
use crate::util::cache::VideoCache;
|
use crate::util::cache::VideoCache;
|
||||||
use crate::util::discord::{format_error_chain, send_discord_error_report};
|
use crate::util::discord::{format_error_chain, send_discord_error_report};
|
||||||
use crate::util::requester::Requester;
|
use crate::util::requester::Requester;
|
||||||
|
use crate::videos::VideoFormat;
|
||||||
use crate::videos::ServerOptions;
|
use crate::videos::ServerOptions;
|
||||||
use crate::videos::VideoItem;
|
use crate::videos::VideoItem;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
@@ -422,13 +423,15 @@ impl MissavProvider {
|
|||||||
})()
|
})()
|
||||||
.ok_or_else(|| ErrorKind::ParsingError(format!("video_url\n{:?}", vid).to_string()))?;
|
.ok_or_else(|| ErrorKind::ParsingError(format!("video_url\n{:?}", vid).to_string()))?;
|
||||||
|
|
||||||
let video_item =
|
let mut format = VideoFormat::new(video_url.clone(), "auto".to_string(), "m3u8".to_string());
|
||||||
VideoItem::new(id, title, video_url, "missav".to_string(), thumb, duration)
|
format.add_http_header("Referer".to_string(), "https://missav.ws/".to_string());
|
||||||
.tags(tags)
|
let video_item = VideoItem::new(id, title, video_url, "missav".to_string(), thumb, duration)
|
||||||
.preview(format!(
|
.formats(vec![format])
|
||||||
"https://fourhoi.com/{}/preview.mp4",
|
.tags(tags)
|
||||||
url_str.split('/').last().unwrap_or_default()
|
.preview(format!(
|
||||||
));
|
"https://fourhoi.com/{}/preview.mp4",
|
||||||
|
url_str.split('/').last().unwrap_or_default()
|
||||||
|
));
|
||||||
|
|
||||||
// 5. Cache to DB
|
// 5. Cache to DB
|
||||||
if let Ok(mut conn) = pool.get() {
|
if let Ok(mut conn) = pool.get() {
|
||||||
|
|||||||
Reference in New Issue
Block a user