mirror of https://gitlab.com/bashrc2/epicyon
merge-requests/30/head
commit
1743abf34a
|
@ -168,6 +168,8 @@ def download_conversation_posts(session, http_prefix: str, base_dir: str,
|
||||||
'object': post_json
|
'object': post_json
|
||||||
}
|
}
|
||||||
post_json = wrapped_post
|
post_json = wrapped_post
|
||||||
|
if not post_json['object'].get('published'):
|
||||||
|
break
|
||||||
conversation_view = [post_json] + conversation_view
|
conversation_view = [post_json] + conversation_view
|
||||||
if not post_json['object'].get('inReplyTo'):
|
if not post_json['object'].get('inReplyTo'):
|
||||||
if debug:
|
if debug:
|
||||||
|
|
3
posts.py
3
posts.py
|
@ -173,7 +173,8 @@ def get_user_url(wf_request: {}, source_id: int, debug: bool) -> str:
|
||||||
for link in wf_request['links']:
|
for link in wf_request['links']:
|
||||||
if not (link.get('type') and link.get('href')):
|
if not (link.get('type') and link.get('href')):
|
||||||
continue
|
continue
|
||||||
if link['type'] != 'application/activity+json':
|
if 'application/activity+json' not in link['type'] and \
|
||||||
|
'application/ld+json' not in link['type']:
|
||||||
continue
|
continue
|
||||||
if '/@' not in link['href']:
|
if '/@' not in link['href']:
|
||||||
if debug and not has_users_path(link['href']):
|
if debug and not has_users_path(link['href']):
|
||||||
|
|
|
@ -109,6 +109,8 @@ def _get_json_request(session, url: str, domain_full: str, session_headers: {},
|
||||||
print('WARN: get_json Not Found url: ' + url)
|
print('WARN: get_json Not Found url: ' + url)
|
||||||
elif result.status_code == 410:
|
elif result.status_code == 410:
|
||||||
print('WARN: get_json no longer available url: ' + url)
|
print('WARN: get_json no longer available url: ' + url)
|
||||||
|
elif result.status_code == 303:
|
||||||
|
print('WARN: get_json redirect not permitted: ' + url)
|
||||||
else:
|
else:
|
||||||
session_headers2 = session_headers.copy()
|
session_headers2 = session_headers.copy()
|
||||||
if session_headers2.get('Authorization'):
|
if session_headers2.get('Authorization'):
|
||||||
|
|
5
utils.py
5
utils.py
|
@ -1376,7 +1376,8 @@ def get_user_paths() -> []:
|
||||||
e.g. /users/nickname, /channel/nickname
|
e.g. /users/nickname, /channel/nickname
|
||||||
"""
|
"""
|
||||||
return ('/users/', '/profile/', '/accounts/', '/channel/', '/u/',
|
return ('/users/', '/profile/', '/accounts/', '/channel/', '/u/',
|
||||||
'/c/', '/video-channels/', '/author/', '/activitypub/')
|
'/c/', '/video-channels/', '/author/', '/activitypub/',
|
||||||
|
'/actors/')
|
||||||
|
|
||||||
|
|
||||||
def get_group_paths() -> []:
|
def get_group_paths() -> []:
|
||||||
|
@ -2313,7 +2314,7 @@ def _get_reserved_words() -> str:
|
||||||
'searchemoji', 'catalog', 'conversationId',
|
'searchemoji', 'catalog', 'conversationId',
|
||||||
'mention', 'http', 'https', 'ipfs', 'ipns',
|
'mention', 'http', 'https', 'ipfs', 'ipns',
|
||||||
'ontologies', 'data', 'postedit', 'moved',
|
'ontologies', 'data', 'postedit', 'moved',
|
||||||
'inactive', 'activitypub')
|
'inactive', 'activitypub', 'actors')
|
||||||
|
|
||||||
|
|
||||||
def get_nickname_validation_pattern() -> str:
|
def get_nickname_validation_pattern() -> str:
|
||||||
|
|
|
@ -97,6 +97,8 @@ def _valid_profile_preview_post(post_json_object: {},
|
||||||
"""Returns true if the given post should appear on a person/group profile
|
"""Returns true if the given post should appear on a person/group profile
|
||||||
after searching for a handle
|
after searching for a handle
|
||||||
"""
|
"""
|
||||||
|
if not isinstance(post_json_object, dict):
|
||||||
|
return False, None
|
||||||
is_announced_feed_item = False
|
is_announced_feed_item = False
|
||||||
if is_create_inside_announce(post_json_object):
|
if is_create_inside_announce(post_json_object):
|
||||||
is_announced_feed_item = True
|
is_announced_feed_item = True
|
||||||
|
|
Loading…
Reference in New Issue