mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-19 11:42:43 +00:00
fix URL construction
This commit is contained in:
parent
4e8488e5f3
commit
f34a59810c
@ -63,11 +63,12 @@ def main():
|
||||
name = substitute_vars(args.repo_name, vardict)
|
||||
url = substitute_vars(args.base_url, vardict)
|
||||
try:
|
||||
r = requests.head((url+"/repodata/repomd.xml").replace("//", "/"), timeout=(7,7))
|
||||
probe_url = url + ('' if url.endswith('/') else '/') + "repodata/repomd.xml"
|
||||
r = requests.head(probe_url, timeout=(7,7))
|
||||
if r.status_code < 400 or r.status_code == 403:
|
||||
yield (name, url)
|
||||
else:
|
||||
print(url, "->", r.status_code)
|
||||
print(probe_url, "->", r.status_code)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user