forked from indymedia/epicyon
Parse actors with 'profile' instead of 'user;
parent
d217762b5e
commit
d5a660cb8b
9
utils.py
9
utils.py
|
@ -79,6 +79,12 @@ def getNicknameFromActor(actor: str) -> str:
|
|||
"""Returns the nickname from an actor url
|
||||
"""
|
||||
if '/users/' not in actor:
|
||||
if '/profile/' in actor:
|
||||
nickStr=actor.split('/profile/')[1].replace('@','')
|
||||
if '/' not in nickStr:
|
||||
return nickStr
|
||||
else:
|
||||
return nickStr.split('/')[0]
|
||||
# https://domain/@nick
|
||||
if '/@' in actor:
|
||||
nickStr=actor.split('/@')[1]
|
||||
|
@ -96,6 +102,9 @@ def getDomainFromActor(actor: str) -> (str,int):
|
|||
"""Returns the domain name from an actor url
|
||||
"""
|
||||
port=None
|
||||
if '/profile/' in actor:
|
||||
domain = actor.split('/profile/')[0].replace('https://','').replace('http://','').replace('dat://','')
|
||||
else:
|
||||
if '/users/' not in actor:
|
||||
domain = actor.replace('https://','').replace('http://','').replace('dat://','')
|
||||
if '/' in actor:
|
||||
|
|
Loading…
Reference in New Issue