Compare commits
2 commits
43ed52daf9
...
d78fa371e9
Author | SHA1 | Date | |
---|---|---|---|
d78fa371e9 | |||
43ef8d15c4 |
3 changed files with 11 additions and 3 deletions
|
@ -393,7 +393,7 @@ async fn main() {
|
||||||
|
|
||||||
let mut storage_dir = dirs::data_dir().expect("no data dir");
|
let mut storage_dir = dirs::data_dir().expect("no data dir");
|
||||||
storage_dir.push("rustypipe");
|
storage_dir.push("rustypipe");
|
||||||
_ = std::fs::create_dir(&storage_dir);
|
std::fs::create_dir_all(&storage_dir).expect("could not create data dir");
|
||||||
|
|
||||||
let mut rp = RustyPipe::builder().storage_dir(storage_dir);
|
let mut rp = RustyPipe::builder().storage_dir(storage_dir);
|
||||||
if cli.report {
|
if cli.report {
|
||||||
|
|
|
@ -458,7 +458,12 @@ impl RustyPipeBuilder {
|
||||||
|
|
||||||
/// Return a new, configured RustyPipe instance.
|
/// Return a new, configured RustyPipe instance.
|
||||||
pub fn build(self) -> Result<RustyPipe, Error> {
|
pub fn build(self) -> Result<RustyPipe, Error> {
|
||||||
let mut client_builder = ClientBuilder::new()
|
self.build_with_client(ClientBuilder::new())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Return a new, configured RustyPipe instance using a Reqwest client builder.
|
||||||
|
pub fn build_with_client(self, mut client_builder: ClientBuilder) -> Result<RustyPipe, Error> {
|
||||||
|
client_builder = client_builder
|
||||||
.user_agent(self.user_agent.unwrap_or_else(|| DEFAULT_UA.to_owned()))
|
.user_agent(self.user_agent.unwrap_or_else(|| DEFAULT_UA.to_owned()))
|
||||||
.gzip(true)
|
.gzip(true)
|
||||||
.brotli(true)
|
.brotli(true)
|
||||||
|
|
|
@ -15,7 +15,10 @@ pub(crate) struct ResolvedUrl {
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub(crate) enum NavigationEndpoint {
|
pub(crate) enum NavigationEndpoint {
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
Watch { watch_endpoint: WatchEndpoint },
|
Watch {
|
||||||
|
#[serde(alias = "reelWatchEndpoint")]
|
||||||
|
watch_endpoint: WatchEndpoint,
|
||||||
|
},
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
Browse {
|
Browse {
|
||||||
browse_endpoint: BrowseEndpoint,
|
browse_endpoint: BrowseEndpoint,
|
||||||
|
|
Loading…
Reference in a new issue