fix: handle itemSectionRenderer in recommended videos

This commit is contained in:
ThetaDev 2022-10-11 22:21:32 +02:00
parent c65af48a4b
commit eb9d3680cc
9 changed files with 18121 additions and 69 deletions

View file

@ -4,7 +4,11 @@ pub mod dictionary;
pub use protobuf::ProtoBuilder;
use std::{borrow::Borrow, collections::BTreeMap, str::FromStr};
use std::{
borrow::{Borrow, Cow},
collections::BTreeMap,
str::FromStr,
};
use fancy_regex::Regex;
use once_cell::sync::Lazy;
@ -16,6 +20,11 @@ use crate::{error::Error, error::Result, param::Language};
const CONTENT_PLAYBACK_NONCE_ALPHABET: &[u8; 64] =
b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
/// Internal error
#[derive(thiserror::Error, Debug)]
#[error("mapping error: {0}")]
pub struct MappingError(pub(crate) Cow<'static, str>);
/// Return the given capture group that matches first in a list of regexes
pub fn get_cg_from_regexes<'a, I>(mut regexes: I, text: &str, cg: usize) -> Option<String>
where