mirror of
https://github.com/kristoferssolo/tg-relay-rs.git
synced 2025-12-20 11:04:41 +00:00
fix: yt video format
This commit is contained in:
parent
00f0a95d22
commit
4b704cb1f0
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user