fix: yt video format

This commit is contained in:
Kristofers Solo 2025-09-19 22:46:29 +03:00
parent 00f0a95d22
commit 4b704cb1f0
Signed by: kristoferssolo
GPG Key ID: 8687F2D3EEE6F0ED
3 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -93,6 +93,8 @@ pub async fn download_ytdlp(url: &str, format: &str) -> Result<DownloadResult> {
"--no-playlist",
"-f",
format,
"--merge-output-format",
"mp4",
"--restrict-filenames",
"-o",
"%(id)s.%(ext)s",

View File

@ -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
}