up fix to sitenotimplementedexception
This commit is contained in:
@ -78,6 +78,7 @@ class MasterService:
|
||||
parser_mapping = {
|
||||
"my.mail.ru": MyMailParser(params),
|
||||
"www.youtube.com": BaseParser(params),
|
||||
"youtu.be": BaseParser(params),
|
||||
"vk.com": BaseParser(params),
|
||||
"ok.ru": BaseParser(params),
|
||||
"likee.video": BaseParser(params),
|
||||
@ -98,13 +99,18 @@ class MasterService:
|
||||
"status": "done"
|
||||
})
|
||||
except FileAlreadyExistException as ex:
|
||||
# TODO: сделать так, чтобы грузился обычный, нам не нужно записывать что-то в редис
|
||||
return Result(result_type=ResultTypeEnum.EXIST, value={
|
||||
"link": video_params["link"],
|
||||
"result": ex.message,
|
||||
"status": "exist"
|
||||
})
|
||||
except SiteNotImplementedException as ex:
|
||||
return Result(result_type=ResultTypeEnum.EXCEPTION, value=ex.default_message)
|
||||
return Result(result_type=ResultTypeEnum.EXCEPTION, value={
|
||||
"link": video_params["link"],
|
||||
"result": ex.default_message,
|
||||
"status": "error"
|
||||
})
|
||||
# TODO upload to server
|
||||
|
||||
|
||||
|
@ -7,6 +7,8 @@ class RedisClient:
|
||||
SET_NAME = "queue"
|
||||
TASKS_NAME = "tasks_working"
|
||||
TASKS_DONE_NAME = "tasks_done"
|
||||
|
||||
# TODO: переписать всё вазимодействие редиса обратно на ключ-значение
|
||||
|
||||
def __init__(self):
|
||||
self.connection = redis.Redis(host="localhost", port=6379, db=0)
|
||||
|
Reference in New Issue
Block a user