fixed warnings
This commit is contained in:
@@ -68,7 +68,6 @@ enum Target {
|
|||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
struct ListStub {
|
struct ListStub {
|
||||||
slug: String,
|
|
||||||
detail_url: String,
|
detail_url: String,
|
||||||
title: String,
|
title: String,
|
||||||
thumb: String,
|
thumb: String,
|
||||||
@@ -78,7 +77,6 @@ struct ListStub {
|
|||||||
#[derive(Debug, Clone, Default)]
|
#[derive(Debug, Clone, Default)]
|
||||||
struct DetailMetadata {
|
struct DetailMetadata {
|
||||||
title: Option<String>,
|
title: Option<String>,
|
||||||
description: Option<String>,
|
|
||||||
thumb: Option<String>,
|
thumb: Option<String>,
|
||||||
studio: Option<(String, String)>,
|
studio: Option<(String, String)>,
|
||||||
categories: Vec<(String, String)>,
|
categories: Vec<(String, String)>,
|
||||||
@@ -762,18 +760,17 @@ impl Pornhd3xProvider {
|
|||||||
.map(|value| self.normalize_url(value))
|
.map(|value| self.normalize_url(value))
|
||||||
.filter(|value| !value.is_empty());
|
.filter(|value| !value.is_empty());
|
||||||
|
|
||||||
let slug = detail_url
|
if detail_url
|
||||||
.trim_end_matches('/')
|
.trim_end_matches('/')
|
||||||
.rsplit('/')
|
.rsplit('/')
|
||||||
.next()
|
.next()
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.to_string();
|
.is_empty()
|
||||||
if slug.is_empty() {
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
items.push(ListStub {
|
items.push(ListStub {
|
||||||
slug,
|
|
||||||
detail_url,
|
detail_url,
|
||||||
title,
|
title,
|
||||||
thumb,
|
thumb,
|
||||||
@@ -812,7 +809,6 @@ impl Pornhd3xProvider {
|
|||||||
fn parse_detail_metadata(&self, html: &str) -> Result<DetailMetadata> {
|
fn parse_detail_metadata(&self, html: &str) -> Result<DetailMetadata> {
|
||||||
let document = Html::parse_document(html);
|
let document = Html::parse_document(html);
|
||||||
let title_selector = Self::selector(".mvic-desc h3")?;
|
let title_selector = Self::selector(".mvic-desc h3")?;
|
||||||
let description_selector = Self::selector("meta[name=\"description\"]")?;
|
|
||||||
let og_image_selector = Self::selector("meta[property=\"og:image\"]")?;
|
let og_image_selector = Self::selector("meta[property=\"og:image\"]")?;
|
||||||
let studio_selector = Self::selector("#bread a[href*=\"/studio/\"]")?;
|
let studio_selector = Self::selector("#bread a[href*=\"/studio/\"]")?;
|
||||||
let category_selector = Self::selector(".mvici-left a[href*=\"/category/\"]")?;
|
let category_selector = Self::selector(".mvici-left a[href*=\"/category/\"]")?;
|
||||||
@@ -826,13 +822,6 @@ impl Pornhd3xProvider {
|
|||||||
.map(|value| Self::text_of(&value))
|
.map(|value| Self::text_of(&value))
|
||||||
.filter(|value| !value.is_empty());
|
.filter(|value| !value.is_empty());
|
||||||
|
|
||||||
let description = document
|
|
||||||
.select(&description_selector)
|
|
||||||
.next()
|
|
||||||
.and_then(|value| value.value().attr("content"))
|
|
||||||
.map(Self::decode_html)
|
|
||||||
.filter(|value| !value.is_empty());
|
|
||||||
|
|
||||||
let thumb = document
|
let thumb = document
|
||||||
.select(&og_image_selector)
|
.select(&og_image_selector)
|
||||||
.next()
|
.next()
|
||||||
@@ -886,7 +875,6 @@ impl Pornhd3xProvider {
|
|||||||
Ok(DetailMetadata {
|
Ok(DetailMetadata {
|
||||||
uploaded_at: title.as_deref().and_then(Self::parse_uploaded_at),
|
uploaded_at: title.as_deref().and_then(Self::parse_uploaded_at),
|
||||||
title,
|
title,
|
||||||
description,
|
|
||||||
thumb,
|
thumb,
|
||||||
studio,
|
studio,
|
||||||
categories,
|
categories,
|
||||||
|
|||||||
@@ -974,14 +974,14 @@ impl ShooshtimeProvider {
|
|||||||
.map(|value| self.normalize_url(&value));
|
.map(|value| self.normalize_url(&value));
|
||||||
|
|
||||||
let mut formats = Vec::new();
|
let mut formats = Vec::new();
|
||||||
if let Some(url) = &primary_url {
|
if primary_url.is_some() {
|
||||||
let format_url = self.proxied_video(options, page_url, Some(&primary_quality));
|
let format_url = self.proxied_video(options, page_url, Some(&primary_quality));
|
||||||
formats.push(
|
formats.push(
|
||||||
VideoFormat::new(format_url, primary_quality.clone(), "mp4".to_string())
|
VideoFormat::new(format_url, primary_quality.clone(), "mp4".to_string())
|
||||||
.format_id(primary_quality.clone()),
|
.format_id(primary_quality.clone()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if let Some(url) = &alt_url {
|
if alt_url.is_some() {
|
||||||
let format_url = self.proxied_video(options, page_url, Some(&alt_quality));
|
let format_url = self.proxied_video(options, page_url, Some(&alt_quality));
|
||||||
formats.push(
|
formats.push(
|
||||||
VideoFormat::new(format_url, alt_quality.clone(), "mp4".to_string())
|
VideoFormat::new(format_url, alt_quality.clone(), "mp4".to_string())
|
||||||
|
|||||||
@@ -18,10 +18,6 @@ struct SourceCandidate {
|
|||||||
pub struct ShooshtimeProxy {}
|
pub struct ShooshtimeProxy {}
|
||||||
|
|
||||||
impl ShooshtimeProxy {
|
impl ShooshtimeProxy {
|
||||||
pub fn new() -> Self {
|
|
||||||
Self {}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn normalize_detail_request(endpoint: &str) -> Option<(String, Option<String>)> {
|
fn normalize_detail_request(endpoint: &str) -> Option<(String, Option<String>)> {
|
||||||
let endpoint = endpoint.trim().trim_start_matches('/');
|
let endpoint = endpoint.trim().trim_start_matches('/');
|
||||||
if endpoint.is_empty() {
|
if endpoint.is_empty() {
|
||||||
|
|||||||
Reference in New Issue
Block a user