Created
July 27, 2019 11:09
-
-
Save 11philip22/1188204abeb3b3bc392d5e18899b1b4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from multiprocessing import Pool | |
def download(link): | |
os.system("youtube-dl "+"\""+link+"\"") | |
def get_list(): | |
print("Enter/Paste your links") | |
contents = [] | |
while True: | |
line = input() | |
if line: | |
contents.append(line) | |
else: | |
break | |
if contents: | |
return contents | |
else: | |
print("Enter/Paste urls") | |
exit(1) | |
if not os.path.exists('vids'): | |
os.mkdir("vids") | |
os.chdir("vids") | |
index = get_list() | |
p = Pool(processes=20) | |
p.map(download, index) | |
p.close() | |
p.join() | |
# with open('list.txt','r') as lijst: | |
# for item in lijst: | |
# print(item) | |
# thread = threading.Thread(target=download, args=(item,)) | |
# thread.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment