mirror of https://gitlab.com/bashrc2/epicyon
Handle https://domain/@nick searches
parent
c7f6e888e6
commit
58f78f1751
8
utils.py
8
utils.py
|
@ -65,6 +65,12 @@ def getNicknameFromActor(actor: str) -> str:
|
||||||
"""Returns the nickname from an actor url
|
"""Returns the nickname from an actor url
|
||||||
"""
|
"""
|
||||||
if '/users/' not in actor:
|
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
|
return None
|
||||||
nickStr=actor.split('/users/')[1].replace('@','')
|
nickStr=actor.split('/users/')[1].replace('@','')
|
||||||
if '/' not in nickStr:
|
if '/' not in nickStr:
|
||||||
|
@ -78,6 +84,8 @@ def getDomainFromActor(actor: str) -> (str,int):
|
||||||
port=None
|
port=None
|
||||||
if '/users/' not in actor:
|
if '/users/' not in actor:
|
||||||
domain = actor.replace('https://','').replace('http://','').replace('dat://','')
|
domain = actor.replace('https://','').replace('http://','').replace('dat://','')
|
||||||
|
if '/' in actor:
|
||||||
|
domain=domain.split('/')[0]
|
||||||
else:
|
else:
|
||||||
domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('dat://','')
|
domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('dat://','')
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
|
|
Loading…
Reference in New Issue