Different actor format

master
Bob Mottram 2019-08-24 10:51:29 +01:00
parent 464f4f0790
commit 4eaaa186a1
1 changed files with 17 additions and 10 deletions

View File

@ -803,6 +803,13 @@ if args.dat:
httpPrefix='dat'
if args.actor:
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()