mirror of
https://github.com/kristoferssolo/tg-relay-rs.git
synced 2025-12-20 11:04:41 +00:00
fix: yt resolution
This commit is contained in:
parent
4b704cb1f0
commit
3cc7fbb541
@ -88,11 +88,9 @@ pub async fn download_instaloader(shortcode: &str) -> Result<DownloadResult> {
|
|||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// - Propagates `run_command_in_tempdir` errors.
|
/// - Propagates `run_command_in_tempdir` errors.
|
||||||
pub async fn download_ytdlp(url: &str, format: &str) -> Result<DownloadResult> {
|
pub async fn download_ytdlp(url: &str) -> Result<DownloadResult> {
|
||||||
let args = [
|
let args = [
|
||||||
"--no-playlist",
|
"--no-playlist",
|
||||||
"-f",
|
|
||||||
format,
|
|
||||||
"--merge-output-format",
|
"--merge-output-format",
|
||||||
"mp4",
|
"mp4",
|
||||||
"--restrict-filenames",
|
"--restrict-filenames",
|
||||||
|
|||||||
@ -44,7 +44,7 @@ impl SocialHandler for YouTubeShortsHandler {
|
|||||||
|
|
||||||
async fn handle(&self, bot: &Bot, chat_id: ChatId, url: String) -> Result<()> {
|
async fn handle(&self, bot: &Bot, chat_id: ChatId, url: String) -> Result<()> {
|
||||||
info!(handler = %self.name(), url = %url, "handling youtube code");
|
info!(handler = %self.name(), url = %url, "handling youtube code");
|
||||||
let dr = download_ytdlp(&url, "best").await?;
|
let dr = download_ytdlp(&url).await?;
|
||||||
process_download_result(bot, chat_id, dr).await
|
process_download_result(bot, chat_id, dr).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user