master
Bob Mottram 2019-08-21 17:23:06 +01:00
parent c7f6e888e6
commit 58f78f1751
1 changed files with 8 additions and 0 deletions

View File

@ -65,6 +65,12 @@ def getNicknameFromActor(actor: str) -> str:
"""Returns the nickname from an actor url
"""
if '/users/' not in actor:
# https://domain/@nick
if '/@' in actor:
nickStr=actor.split('/@')[1]
if '/' in nickStr:
nickStr=nickStr.split('/')[0]
return nickStr
return None
nickStr=actor.split('/users/')[1].replace('@','')
if '/' not in nickStr:
@ -78,6 +84,8 @@ def getDomainFromActor(actor: str) -> (str,int):
port=None
if '/users/' not in actor:
domain = actor.replace('https://','').replace('http://','').replace('dat://','')
if '/' in actor:
domain=domain.split('/')[0]
else:
domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('dat://','')
if ':' in domain: