Skip to content

Instantly share code, notes, and snippets.

@11philip22
Created July 27, 2019 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 11philip22/1188204abeb3b3bc392d5e18899b1b4d to your computer and use it in GitHub Desktop.
Save 11philip22/1188204abeb3b3bc392d5e18899b1b4d to your computer and use it in GitHub Desktop.
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