index: fix GitLab Raw URLs with gitlab.com and recent versions

GitLab seems to be moving to always having "-" as the first path segment in
all the project URLs.  So the URL without a "-" is now a redirect.
This commit is contained in:
Hans-Christoph Steiner 2020-12-08 19:44:39 +01:00
parent 0232df0113
commit 1f3d8b70e7

View file

@ -682,8 +682,8 @@ def get_mirror_service_urls(url):
# Gitlab-like Pages segments "https://user.gitlab.io/repo/folder" # Gitlab-like Pages segments "https://user.gitlab.io/repo/folder"
gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder] gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder]
urls.append('/'.join(gitlab_pages)) urls.append('/'.join(gitlab_pages))
# Gitlab Raw "https://gitlab.com/user/repo/raw/branch/folder" # GitLab Raw "https://gitlab.com/user/repo/-/raw/branch/folder"
gitlab_raw = segments + ['raw', branch, folder] gitlab_raw = segments + ['-', 'raw', branch, folder]
urls.append('/'.join(gitlab_raw)) urls.append('/'.join(gitlab_raw))
return urls return urls