Links to channels:
python run.py or python3 run.py
import subprocess
from concurrent.futures import ThreadPoolExecutor
def download_video(url):
command = [
"yt-dlp",
"-o", "%(uploader)s/%(playlist)s/%(title).70s [%(id)s]",
"--add-metadata",
"--write-description",
"--concurrent-fragments", "30",
"--embed-thumbnail",
"--embed-metadata",
"--embed-subs",
"--all-subs",
"--merge-output-format", "mp4",
url
]
with open("errors.log", "a") as error_log:
subprocess.run(command, stderr=error_log)
with open("urls.txt", "r") as file:
urls = [line.strip() for line in file if line.strip()]
# Adjust max_workers for the number of parallel downloads
with ThreadPoolExecutor(max_workers=8) as executor:
executor.map(download_video, urls)
.aileen
Comments - 0