Skip to content

Commit

Permalink
mod下载方法新增存在判断
Browse files Browse the repository at this point in the history
  • Loading branch information
kressety committed Oct 22, 2023
1 parent 15ab43f commit 12c8ddd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modrinth_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from os.path import join
from os.path import join, exists
from urllib.parse import unquote

from requests import get
Expand Down Expand Up @@ -49,5 +49,6 @@ def download_mod(
return False

file_name = file_url.strip().split('/')[-1]
download(file_url, join(mods_path, file_name))
if not exists(join(mods_path, file_name)):
download(file_url, join(mods_path, file_name))
return True

0 comments on commit 12c8ddd

Please sign in to comment.