mirror of https://gitlab.com/bashrc2/epicyon
import csv accounts can be actor urls or handles
parent
ffd7ce2476
commit
8c522a78b7
|
@ -11,6 +11,8 @@ import os
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
from utils import is_account_dir
|
from utils import is_account_dir
|
||||||
|
from utils import get_nickname_from_actor
|
||||||
|
from utils import get_domain_from_actor
|
||||||
from follow import is_following_actor
|
from follow import is_following_actor
|
||||||
from follow import send_follow_request
|
from follow import send_follow_request
|
||||||
from session import create_session
|
from session import create_session
|
||||||
|
@ -60,9 +62,13 @@ def _update_import_following(base_dir: str,
|
||||||
line = line.split(',')[0].strip()
|
line = line.split(',')[0].strip()
|
||||||
if line.startswith('#'):
|
if line.startswith('#'):
|
||||||
continue
|
continue
|
||||||
if '@' not in line:
|
following_nickname = get_nickname_from_actor(line)
|
||||||
|
if not following_nickname:
|
||||||
continue
|
continue
|
||||||
following_handle = line
|
following_domain, following_port = get_domain_from_actor(line)
|
||||||
|
if not following_domain:
|
||||||
|
continue
|
||||||
|
following_handle = following_nickname + '@' + following_domain
|
||||||
if is_following_actor(base_dir,
|
if is_following_actor(base_dir,
|
||||||
nickname, domain, following_handle):
|
nickname, domain, following_handle):
|
||||||
# remove the followed handle from the import list
|
# remove the followed handle from the import list
|
||||||
|
@ -80,10 +86,7 @@ def _update_import_following(base_dir: str,
|
||||||
curr_domain = domain
|
curr_domain = domain
|
||||||
curr_port = httpd.port
|
curr_port = httpd.port
|
||||||
curr_http_prefix = httpd.http_prefix
|
curr_http_prefix = httpd.http_prefix
|
||||||
following_nickname = following_handle.split('@')[0]
|
|
||||||
following_domain = following_handle.split('@')[1]
|
|
||||||
following_actor = following_handle
|
following_actor = following_handle
|
||||||
following_port = httpd.port
|
|
||||||
if ':' in following_domain:
|
if ':' in following_domain:
|
||||||
following_port = following_handle.split(':')[1]
|
following_port = following_handle.split(':')[1]
|
||||||
following_domain = following_domain.split(':')[0]
|
following_domain = following_domain.split(':')[0]
|
||||||
|
|
Loading…
Reference in New Issue