@ -7,6 +7,7 @@ import requests
from re import sub
import parsers . paperMC
import parsers . modrinth
import parsers . curseforge
import argparse
import shutil
import hashlib
@ -116,11 +117,26 @@ def modrinth(project, action, subAction):
download ( project , parsers . modrinth . getLatestVersion ( project ) )
#print(parsers.modrinth.getForMinecraftVersion(project, args.v))
# CurseForge command functions
def curseforge ( project , action , subAction ) :
import json
if action == " get " :
if subAction == " games " :
print ( parsers . curseforge . get_games ( ) )
if subAction == " mod " :
print ( json . dumps ( parsers . curseforge . get_mod ( project ) , indent = 4 ) )
if action == " search " :
if subAction == " mod " :
print ( json . dumps ( parsers . curseforge . search_mods ( project ) , indent = 4 ) )
if action == " download " :
if subAction == " latest " :
print ( parsers . curseforge . download ( project ) )
# Determine which API parser to use:
if args . api == " paperMC " :
paperMC ( args . project , args . action , args . subAction )
elif args . api == " modrinth " :
modrinth ( args . project , args . action , args . subAction )
elif args . api == " curseforge " :
curseforge ( args . project , args . action , args . subAction )
else :
print ( " Error: Unknown API: " + args . api )