You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

print('---------------------------------')
print('Скрипт создал для Linux и может на других ОС не работать.')
print('Должен быть установлен yt-dlp')
print('Для продолжения нажмите любую enter...')
print('---------------------------------')
pause = input()
from os import system
from os.path import exists
from threading import Thread
from time import sleep
system('clear')
print('Введите ссылку на канал / id плейлиста')
link = input('>> ')
print('Получаем список видео...')
system(f"yt-dlp -j --flat-playlist {link} | jq -r '.id' | sed 's_^_https://youtu.be/_' > links.txt")
print('Начинаем скачивание всех видео...')
if not exists('downloads'):
system('mkdir downloads')
def down(link):
system(f'yt-dlp {link} -f best -ciw -o "downloads/%(title)s.%(ext)s" ')
# Читаем список ссылок
with open('links.txt') as f:
raw_links = f.read()
f.close()
links = raw_links.split()
# Запускаем потоки скачивания
for i in links:
th = Thread(target=down, args=(i,))
th.start()
sleep(1)