liufuhua007

add cookie uploader

......@@ -57,7 +57,7 @@ async def main():
if args.publish_type == 1 and not args.schedule:
parser.error("The schedule must must be specified for scheduled publishing.")
account_file = Path(BASE_DIR / "cookies" / f"{args.platform}_{args.account_name}.json")
account_file = Path(BASE_DIR / "cookies" / f"{args.platform}_uploader" / f"{args.platform}_{args.account_name}.json")
account_file.parent.mkdir(exist_ok=True)
print(account_file)
......
......@@ -35,6 +35,7 @@ async def cookie_auth(account_file):
async def sohu_setup(account_file, handle=False):
account_file = get_absolute_path(account_file, "sohu_uploader")
sohu_logger.info("account_file: {}".format(account_file))
if not os.path.exists(account_file) or not await cookie_auth(account_file):
if not handle:
return False
......@@ -49,7 +50,7 @@ async def get_sohu_cookie(account_file):
'args': [
'--lang en-GB'
],
'headless': True, # Set headless option here
'headless': False, # Set headless option here
}
# Make sure to run headed.
browser = await playwright.chromium.launch(**options)
......