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.
 
 
 
 
 
 
smol_scriptz/import_zik.py

31 lines
470 B

# /bin/python2
import mechanize
from time import sleep
br = mechanize.Browser()
# url here
br.open('')
# file type here
filetypes = ['.ogg', '.mp3']
my_files = []
for l in br.links():
for t in filetypes:
if t in str(l):
my_files.append(l)
def download_link(l):
f = open(l.text, 'w')
br.click_link(l)
f.write(br.response().read())
print(l.text, "has been downloaded")
for l in my_files:
sleep(1)
download_link(l)