use std::borrow::Cow;
use crate::client::{PlatformClient, RequestProfile};
mod emoji;
mod graphql;
mod live;
mod live_api;
mod live_fetch;
mod profile;
mod profile_fetch;
pub(crate) mod requests;
mod support;
mod value;
mod work;
const KUAISHOU_GRAPHQL_ENDPOINT: &str = "https://www.kuaishou.com/graphql";
const KUAISHOU_LIVE_BASE_URL: &str = "https://live.kuaishou.com";
const EMOJI_LIST_OPERATION_NAME: &str = "visionBaseEmoticons";
const EMOJI_LIST_QUERY: &str =
"query visionBaseEmoticons {\n visionBaseEmoticons {\n iconUrls\n __typename\n }\n}\n";
#[derive(Debug, Clone)]
pub struct KuaishouFetcher {
request_profile: RequestProfile,
graphql_endpoint: Cow<'static, str>,
live_base_url: Cow<'static, str>,
}
impl KuaishouFetcher {
pub fn new(client: PlatformClient) -> Self {
Self {
request_profile: client.request_profile(),
graphql_endpoint: Cow::Borrowed(KUAISHOU_GRAPHQL_ENDPOINT),
live_base_url: Cow::Borrowed(KUAISHOU_LIVE_BASE_URL),
}
}
#[doc(alias = "createBoundKuaishouFetcher")]
pub fn from_cookie(cookie: impl Into<String>, request: crate::client::RequestConfig) -> Self {
Self::new(PlatformClient {
platform: crate::catalog::Platform::Kuaishou,
cookie: Some(cookie.into()),
request,
})
}
pub fn request_profile(&self) -> &RequestProfile {
&self.request_profile
}
}