diff options
Diffstat (limited to 'util.py')
-rw-r--r-- | util.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -173,7 +173,7 @@ def threaded_find_url(homepage_url, game_version): return final_url -def find_updated_urls(forge_urls, game_version, threads=20): +def find_updated_urls(forge_urls, game_version, threads=8): """ Given a list of mod homepage URLs, find all of their direct download links in parallel. """ @@ -252,7 +252,10 @@ def find_cdn(ffx, url, version): try: game_version = tuple([int(x) for x in entry_cells[4].find_element_by_class_name("mr-2").text.split(".")]) # get game version and convert to tuple except: - game_version = (0, 0, 0) + if ".".join(map(str, version)) in filename: + game_version = version + else: + game_version = (2, 0, 0) cdn_id = entry_cells[1].find_element_by_tag_name("a").get_property("href").split("/")[-1] #TODO make this configurable @@ -280,7 +283,7 @@ def find_cdn(ffx, url, version): except: # import traceback; traceback.print_exc() - print(f"[!] Failed to retrieve valid CDN URL for {url}") + print(f"\n[!] Failed to retrieve valid CDN URL for {url}") return None |