Tips and tricks

YouTube Download -

Install youtube dl

Get the list of qualities

yt-dlp -F [[YOUTUBE_ID]]

Complete script:

#!/usr/bin/env bash

# Script: merge_video_audio.sh
# Description: Prompts for two IDs, two formats, downloads them, and merges using ffmpeg.

# Prompt the user for the first ID
echo "Enter the first ID (video source) or URL:"
read FIRST_ID

# List available formats for the first ID
yt-dlp "$FIRST_ID" --list-formats

# Prompt the user to select a format for the first ID
echo "Enter the format code for the first ID (video):"
read FIRST_FORMAT

# Download the first ID as vtemp.mp4 using the chosen format
yt-dlp -i -f "$FIRST_FORMAT" "$FIRST_ID" -o "vtemp.mp4"

# Prompt the user to select a format for the second ID
echo "Enter the format code for the second ID (audio):"
read SECOND_FORMAT

# Download the second ID as vtemp.m4a using the chosen format
yt-dlp -i -f "$SECOND_FORMAT" "$FIRST_ID" -o "vtemp.m4a"

# Merge video and audio into output.mp4 using ffmpeg
ffmpeg -i vtemp.mp4 -i vtemp.m4a -c copy output.mp4

# Cleanup prompt (optional)
echo "Merging complete. The merged file is 'output.mp4'."

# Optionally, you might want to remove vtemp files if no longer needed:
# rm vtemp.mp4 vtemp.m4a
{"type":"main_options","images_arr":"'#ffffff'","enable_ajax":"off","soundcloud_apikey":"","bg_isparallax":"off","bg_slideshow_time":"0","bg_transition":"slidedown","site_url":"https:\/\/digitalzoomstudio.net","theme_url":"https:\/\/digitalzoomstudio.net\/wp-content\/themes\/qucreative\/","blur_ammount":"26","width_column":"50","width_section_bg":"","width_gap":"30","border_width":"0","border_color":"#ffffff","translate_cancel_comment":"Cancel reply","translate_leave_a_comment":"Leave a comment","translate_leave_a_comment_to":"Leave a comment to","is_customize_preview":"off","width_blur_margin":"30","gallery_w_thumbs_autoplay_videos":"off","content_enviroment_opacity":"30","menu_enviroment_opacity":"70","base_url":"https:\/\/digitalzoomstudio.net"}
{"type":"darkfull"}