# 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: constants/dataTypes.py

# 
# Path: helpers/binaryHelper.py
# def uleb128Encode(num):
# def packData(__data, __dataType):
# def binaryWrite(structure = None):
# 
# Path: helpers/s3.py
# def getWriteReplayBucketName():
# def getReadReplayBucketName(scoreID):
# def clientFactory(*, region, endpoint, accessKeyId, secretAccessKey):
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# ACHIEVEMENTS_VERSION = 1
# DATADOG_PREFIX = "lets"


import io
import os
from botocore.exceptions import ClientError
from timeout_decorator import timeout
from common import generalUtils
from common.log import logUtils as log
from common.sentry import sentry
from constants import exceptions
from constants import dataTypes
from helpers import binaryHelper
from helpers import s3
from objects import glob




def toDotTicks(unixTime):
	"""
	:param unixTime: Unix timestamp
	"""
	return (10000000*unixTime) + 621355968000000000


def _getRawReplayFailedLocal(scoreID):

# 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: constants/dataTypes.py

# 
# Path: helpers/binaryHelper.py
# def uleb128Encode(num):
# def packData(__data, __dataType):
# def binaryWrite(structure = None):
# 
# Path: helpers/s3.py
# def getWriteReplayBucketName():
# def getReadReplayBucketName(scoreID):
# def clientFactory(*, region, endpoint, accessKeyId, secretAccessKey):
# 
# Path: objects/glob.py
# 		VERSION = f.read().strip()
# 	VERSION = "Unknown"
# ACHIEVEMENTS_VERSION = 1
# DATADOG_PREFIX = "lets"


# Path: helpers/replayHelper.py
import io
import os
from botocore.exceptions import ClientError
from timeout_decorator import timeout
from common import generalUtils
from common.log import logUtils as log
from common.sentry import sentry
from constants import exceptions
from constants import dataTypes
from helpers import binaryHelper
from helpers import s3
from objects import glob





def toDotTicks(unixTime):
	"""
	:param unixTime: Unix timestamp
	"""
	return (10000000*unixTime) + 621355968000000000


def _getRawReplayFailedLocal(scoreID):

	with open(os.path.join(glob.conf["FAILED_REPLAYS_FOLDER"], "replay_{}.osr".format(scoreID)), "rb") as f: