From 4eaaa186a121a2fe73d17cce5594572cf14c29bf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 24 Aug 2019 10:51:29 +0100 Subject: [PATCH] Different actor format --- epicyon.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/epicyon.py b/epicyon.py index bd0a49698..c90b47edc 100644 --- a/epicyon.py +++ b/epicyon.py @@ -803,16 +803,23 @@ if args.dat: httpPrefix='dat' if args.actor: - if '@' not in args.actor: - print('Syntax: --actor nickname@domain') - sys.exit() - if args.actor.startswith('@'): - args.actor=args.actor[1:] - if '@' not in args.actor: - print('Syntax: --actor nickname@domain') - sys.exit() - nickname=args.actor.split('@')[0] - domain=args.actor.split('@')[1].replace('\n','') + if '/@' in args.actor or '/users/' in args.actor or args.actor.startswith('http') or args.actor.startswith('dat'): + # format: https://domain/@nick + args.actor=args.actor.replace('https://','').replace('http://','').replace('dat://','').replace('/@','/users/') + nickname=args.actor.split('/users/')[1].replace('\n','') + domain=args.actor.split('/users/')[0] + else: + # format: @nick@domain + if '@' not in args.actor: + print('Syntax: --actor nickname@domain') + sys.exit() + if args.actor.startswith('@'): + args.actor=args.actor[1:] + if '@' not in args.actor: + print('Syntax: --actor nickname@domain') + sys.exit() + nickname=args.actor.split('@')[0] + domain=args.actor.split('@')[1].replace('\n','') wfCache={} if args.http or domain.endswith('.onion'): httpPrefix='http'