Created
July 9, 2018 08:06
-
-
Save vitkhab/26cf42c8eb61f74c9c5191e90bb17dfd 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
#!/usr/bin/env python | |
import requests | |
base_url = "https://example.com/nexus/service/rest/beta/assets" | |
repository = "maven-central" | |
url = "{}?repository={}".format(base_url, repository) | |
links_file = open('links.txt', 'w') | |
while True: | |
r = requests.get(url) | |
data = r.json() | |
for item in data["items"]: | |
links_file.write("{}\n".format(item["downloadUrl"])) | |
if not data["continuationToken"]: | |
break | |
url = "{}?repository={}&continuationToken={}".format(base_url, repository, data["continuationToken"]) | |
links_file.close() | |
#wget -x -i links.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment