Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mk_mirror(target):
'''Make the mirror'''
target = 'collection:' + target
print("Attempting to download collection: " + target)
search = ia.Search(target)
## Because the internetarchive module won't return us a list
## we'll have to make our own.
current_item = 1
total_item = 0
collection = []
for entry in search:
collection.append(entry)
total_item += 1
## Go through all items of the collection and download
for entry in collection:
item_id = entry['identifier']
print('Downloading ' + str(current_item) + '/' + str(total_item) + '\t'\
+ item_id)