# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# ACHIEVEMENTS_VERSION = 1
# DATADOG_PREFIX = "lets"
# 
# Path: constants/exceptions.py
# class invalidArgumentsException(Exception):
# class loginFailedException(Exception):
# class userBannedException(Exception):
# class userLockedException(Exception):
# class noBanchoSessionException(Exception):
# class osuApiFailException(Exception):
# class fileNotFoundException(Exception):
# class invalidBeatmapException(Exception):
# class unsupportedGameModeException(Exception):
# class beatmapTooLongException(Exception):
# class need2FAException(Exception):
# class noAPIDataError(Exception):
# class scoreNotFoundError(Exception):
# class ppCalcException(Exception):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, handler):
# 	def __init__(self, handler, f):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, exception):


import json
import requests
from urllib.parse import quote
from common.log import logUtils as log
from common import generalUtils
from objects import glob
from constants import exceptions




def osuApiRequest(request, params, getFirst=True):
	"""
	Send a request to osu!api.

	request -- request type, string (es: get_beatmaps)
	params -- GET parameters, without api key or trailing ?/& (es: h=a5b99395a42bd55bc5eb1d2411cbdf8b&limit=10)
	return -- dictionary with json response if success, None if failed or empty response.
	"""
	# Make sure osuapi is enabled

# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# ACHIEVEMENTS_VERSION = 1
# DATADOG_PREFIX = "lets"
# 
# Path: constants/exceptions.py
# class invalidArgumentsException(Exception):
# class loginFailedException(Exception):
# class userBannedException(Exception):
# class userLockedException(Exception):
# class noBanchoSessionException(Exception):
# class osuApiFailException(Exception):
# class fileNotFoundException(Exception):
# class invalidBeatmapException(Exception):
# class unsupportedGameModeException(Exception):
# class beatmapTooLongException(Exception):
# class need2FAException(Exception):
# class noAPIDataError(Exception):
# class scoreNotFoundError(Exception):
# class ppCalcException(Exception):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, handler):
# 	def __init__(self, handler, f):
# 	def __init__(self, handler):
# 	def __init__(self, handler, who, ip):
# 	def __init__(self, exception):


# Path: helpers/osuapiHelper.py
import json
import requests
from urllib.parse import quote
from common.log import logUtils as log
from common import generalUtils
from objects import glob
from constants import exceptions





def osuApiRequest(request, params, getFirst=True):
	"""
	Send a request to osu!api.

	request -- request type, string (es: get_beatmaps)
	params -- GET parameters, without api key or trailing ?/& (es: h=a5b99395a42bd55bc5eb1d2411cbdf8b&limit=10)
	return -- dictionary with json response if success, None if failed or empty response.
	"""
	# Make sure osuapi is enabled

	if not glob.conf["OSU_API_ENABLE"]: