|
|
@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
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('Начинаем скачивание всех видео...')
|
|
|
|
|
|
|
|
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)
|