Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacherr committed Aug 1, 2024
1 parent 99adec4 commit a7cc0db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assyst-core/src/command/services/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ flag_parse_argument! { DownloadFlags }
)]
pub async fn download(ctxt: CommandCtxt<'_>, url: Word, options: DownloadFlags) -> anyhow::Result<()> {
let mut opts =
WebDownloadOpts::from_download_flags(options, ctxt.assyst().rest_cache_handler.get_web_download_urls_copied());
WebDownloadOpts::from_download_flags(options, ctxt.assyst().rest_cache_handler.get_web_download_urls());

if url.0.to_ascii_lowercase().contains("youtube.com/playlist") {
let videos = get_youtube_playlist_entries(&url.0).await?;
Expand Down
9 changes: 5 additions & 4 deletions assyst-core/src/rest/web_media_download.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::sync::Arc;
use std::time::{Duration, Instant};

use anyhow::{bail, Context};
Expand Down Expand Up @@ -26,11 +27,11 @@ pub static TEST_URL_TIMEOUT: Duration = Duration::from_secs(15);
pub struct WebDownloadOpts {
pub audio_only: Option<bool>,
pub quality: Option<String>,
pub urls: Vec<String>,
pub urls: Vec<Arc<String>>,
pub verbose: bool,
}
impl WebDownloadOpts {
pub fn from_download_flags(flags: DownloadFlags, urls: Vec<String>) -> Self {
pub fn from_download_flags(flags: DownloadFlags, urls: Vec<Arc<String>>) -> Self {
Self {
audio_only: Some(flags.audio),
quality: if flags.quality != 0 {
Expand Down Expand Up @@ -84,7 +85,7 @@ async fn test_route(client: &Client, url: &str) -> bool {
let opts = WebDownloadOpts {
audio_only: Some(false),
quality: Some("144".to_owned()),
urls: vec![url.to_owned()],
urls: vec![Arc::new(url.to_owned())],
verbose: false,
};

Expand Down Expand Up @@ -182,7 +183,7 @@ pub async fn download_web_media(client: &Client, url: &str, opts: WebDownloadOpt
debug!("trying url: {route} for web media {url}");

let res = client
.post(route)
.post((*route).clone())
.header("accept", "application/json")
.header("User-Agent", "Assyst Discord Bot (https://github.com/jacherr/assyst2)")
.json(&json!({
Expand Down

0 comments on commit a7cc0db

Please sign in to comment.