diff --git a/Dockerfile b/Dockerfile index 3038c76..9c34a81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,10 @@ RUN useradd --create-home --shell /bin/bash app WORKDIR /home/app USER app -RUN uv tool install instaloader yt-dlp \ - && instaloader --version \ +RUN uv tool install instaloader \ + && instaloader --version + +RUN uv tool install yt-dlp \ && yt-dlp --version COPY --from=builder /app/target/release/tg-relay-rs /usr/local/bin/tg-relay-rs diff --git a/src/download.rs b/src/download.rs index ba262de..f9a4bd5 100644 --- a/src/download.rs +++ b/src/download.rs @@ -93,6 +93,8 @@ pub async fn download_ytdlp(url: &str, format: &str) -> Result { "--no-playlist", "-f", format, + "--merge-output-format", + "mp4", "--restrict-filenames", "-o", "%(id)s.%(ext)s", diff --git a/src/handlers/youtube.rs b/src/handlers/youtube.rs index fae1ce6..770318f 100644 --- a/src/handlers/youtube.rs +++ b/src/handlers/youtube.rs @@ -44,8 +44,7 @@ impl SocialHandler for YouTubeShortsHandler { async fn handle(&self, bot: &Bot, chat_id: ChatId, url: String) -> Result<()> { info!(handler = %self.name(), url = %url, "handling youtube code"); - let format = "bestvideo[ext=mp4]+bestaudio/best"; - let dr = download_ytdlp(&url, format).await?; + let dr = download_ytdlp(&url, "best").await?; process_download_result(bot, chat_id, dr).await }