diff options
Diffstat (limited to 'update.py')
-rwxr-xr-x | update.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -5,7 +5,7 @@ import os import sys import hashlib import shutil -import regex as re +import re import requests @@ -98,7 +98,10 @@ def apply_updates(args): f.write("#VERSION " + str(VERSION + 1) + "\n") for mod in mods: print("Fetching {mod[0]}...".format(mod=mod)) - url = find_cdn(ffx, mod[1]) + if 'curseforge' in mod[1]: + url = find_cdn(ffx, mod[1]) + else: + url = requests.get(mod[1]).url if url is None: print('Failed to fetch {mod[0]}!'.format(mod=mod)) continue @@ -126,7 +129,10 @@ def check_updates(args): for mod in latest: print("Checking for updates to {mod[0]}...".format(mod=mod), end="") sys.stdout.flush() # takes care of line-buffered terminals - url = find_cdn(ffx, mod[1]) + if 'curseforge' in mod[1]: + url = find_cdn(ffx, mod[1]) + else: + url = requests.get(mod[1]).url if url in old_urls: print(" No updates") else: |