Reformat; Handle AuthorizationTimeout for p2g presentations
This commit is contained in:
@@ -57,11 +57,18 @@ impl Presentation {
|
||||
|
||||
match *self {
|
||||
Presentation::PublishToGo { ref download_url, .. } => {
|
||||
let mut response = try_to_get_valid_response(
|
||||
let response_res = try_to_get_valid_response(
|
||||
|client| client.get(download_url).header(construct_cookie()),
|
||||
|resp| resp.headers().get::<ContentDisposition>().is_some(),
|
||||
);
|
||||
|
||||
if response_res.is_err() {
|
||||
// Appears to be the reason...
|
||||
return Err(DownloadError::AuthorizationTimeout);
|
||||
}
|
||||
|
||||
let mut response = response_res.unwrap();
|
||||
|
||||
let filename = {
|
||||
let content_disposition =
|
||||
response.headers().get::<ContentDisposition>().unwrap();
|
||||
@@ -130,7 +137,7 @@ impl Presentation {
|
||||
let mut response = try_to_get_valid_response(
|
||||
|client| client.get(download_url).header(construct_cookie()),
|
||||
|resp| resp.status() == &StatusCode::Ok,
|
||||
);
|
||||
).unwrap();
|
||||
// TODO: Support formats besides mp4
|
||||
// extract extension from url or somewehre else...
|
||||
let filename = format!("{} - {}.mp4", fix_filename(self.name()), i + 1);
|
||||
|
Reference in New Issue
Block a user