Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/mrgnw/scripts.
Something went wrong. Try again.
scripts dp
631 B · 25 lines
1234567891011121314151617181920212223242526#!/usr/bin/env zsh
local input_file=${1:-inputs.txt}
# Check if input file existsif [[ ! -f "$input_file" ]]; then echo "Input file '$input_file' not found." return 1fi
# Read URLs and count themlocal urls=("${(@f)"$(<"$input_file")"}")local num_urls=${#urls[@]}
# Set concurrency to the number of URLslocal concurrency=$num_urls
# Determine the output filename from the first URL (default to basename of the URL)local output_file="${urls[1]##*/}"
# Run aria2c with parallel downloadsaria2c -j "$concurrency" -i "$input_file" -o "$output_file" \ --allow-overwrite=true --file-allocation=none
return 0