mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Update libs
This commit is contained in:
@@ -277,8 +277,7 @@ async fn get_download_keyboard_handler(
|
||||
.map(|item| -> Vec<InlineKeyboardButton> {
|
||||
vec![InlineKeyboardButton {
|
||||
text: {
|
||||
let label = item.clone();
|
||||
format!("📥 {label}")
|
||||
format!("📥 {item}")
|
||||
},
|
||||
kind: InlineKeyboardButtonKind::CallbackData(
|
||||
(DownloadQueryData::DownloadData {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use base64::{engine::general_purpose, Engine};
|
||||
use reqwest::StatusCode;
|
||||
use std::fmt;
|
||||
|
||||
@@ -68,14 +69,23 @@ pub async fn download_file(
|
||||
|
||||
let headers = response.headers();
|
||||
|
||||
let filename =
|
||||
std::str::from_utf8(&base64::decode(headers.get("x-filename-b64").unwrap()).unwrap())
|
||||
.unwrap()
|
||||
.to_string();
|
||||
let caption =
|
||||
std::str::from_utf8(&base64::decode(headers.get("x-caption-b64").unwrap()).unwrap())
|
||||
.unwrap()
|
||||
.to_string();
|
||||
let base64_encoder = general_purpose::STANDARD_NO_PAD;
|
||||
|
||||
let filename = std::str::from_utf8(
|
||||
&base64_encoder
|
||||
.decode(headers.get("x-filename-b64").unwrap())
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap()
|
||||
.to_string();
|
||||
|
||||
let caption = std::str::from_utf8(
|
||||
&base64_encoder
|
||||
.decode(headers.get("x-caption-b64").unwrap())
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap()
|
||||
.to_string();
|
||||
|
||||
Ok(DownloadFile {
|
||||
response,
|
||||
|
||||
Reference in New Issue
Block a user