mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Merge branch 'main' of gitlab.com:bashrc2/epicyon
						commit
						4b92a03da0
					
				
							
								
								
									
										31
									
								
								inbox.py
								
								
								
								
							
							
						
						
									
										31
									
								
								inbox.py
								
								
								
								
							|  | @ -637,21 +637,22 @@ def save_post_to_inbox_queue(base_dir: str, http_prefix: str, | ||||||
|                                   reply_nickname + '@' + reply_domain) |                                   reply_nickname + '@' + reply_domain) | ||||||
|                         return None |                         return None | ||||||
| 
 | 
 | ||||||
|         if post_json_object['object'].get('content'): |     # filter on the content of the post | ||||||
|             content_str = \ |     content_str = \ | ||||||
|                 get_base_content_from_post(post_json_object, system_language) |         get_base_content_from_post(post_json_object, system_language) | ||||||
|             if content_str: |     if content_str: | ||||||
|                 summary_str = \ |         summary_str = \ | ||||||
|                     get_summary_from_post(post_json_object, |             get_summary_from_post(post_json_object, | ||||||
|                                           system_language, []) |                                   system_language, []) | ||||||
|                 media_descriptions = \ |         media_descriptions = \ | ||||||
|                     get_media_descriptions_from_post(post_json_object) |             get_media_descriptions_from_post(post_json_object) | ||||||
|                 content_all = \ |         content_all = \ | ||||||
|                     summary_str + ' ' + content_str + ' ' + media_descriptions |             summary_str + ' ' + content_str + ' ' + media_descriptions | ||||||
|                 if is_filtered(base_dir, nickname, domain, content_all): |         if is_filtered(base_dir, nickname, domain, content_all): | ||||||
|                     if debug: |             if debug: | ||||||
|                         print('WARN: post was filtered out due to content') |                 print('WARN: post was filtered out due to content') | ||||||
|                     return None |             return None | ||||||
|  | 
 | ||||||
|     original_post_id = None |     original_post_id = None | ||||||
|     if post_json_object.get('id'): |     if post_json_object.get('id'): | ||||||
|         if not isinstance(post_json_object['id'], str): |         if not isinstance(post_json_object['id'], str): | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								utils.py
								
								
								
								
							
							
						
						
									
										1
									
								
								utils.py
								
								
								
								
							|  | @ -792,7 +792,6 @@ def load_json_onionify(filename: str, domain: str, onion_domain: str, | ||||||
|                 if data: |                 if data: | ||||||
|                     data = data.replace(domain, onion_domain) |                     data = data.replace(domain, onion_domain) | ||||||
|                     data = data.replace('https:', 'http:') |                     data = data.replace('https:', 'http:') | ||||||
|                     print('*****data: ' + data) |  | ||||||
|                 json_object = json.loads(data) |                 json_object = json.loads(data) | ||||||
|                 break |                 break | ||||||
|         except BaseException: |         except BaseException: | ||||||
|  |  | ||||||
|  | @ -1125,7 +1125,7 @@ def _is_nsfw(content: str) -> bool: | ||||||
|     content_lower = content.lower() |     content_lower = content.lower() | ||||||
|     nsfw_tags = ( |     nsfw_tags = ( | ||||||
|         'nsfw', 'porn', 'pr0n', 'explicit', 'lewd', |         'nsfw', 'porn', 'pr0n', 'explicit', 'lewd', | ||||||
|         'nude', 'boob', 'erotic' |         'nude', 'boob', 'erotic', 'sex' | ||||||
|     ) |     ) | ||||||
|     for tag_name in nsfw_tags: |     for tag_name in nsfw_tags: | ||||||
|         if tag_name in content_lower: |         if tag_name in content_lower: | ||||||
|  |  | ||||||
|  | @ -501,6 +501,7 @@ def webfinger_update(base_dir: str, nickname: str, domain: str, | ||||||
| 
 | 
 | ||||||
|     filename = base_dir + wf_subdir + '/' + handle + '.json' |     filename = base_dir + wf_subdir + '/' + handle + '.json' | ||||||
|     onionify = False |     onionify = False | ||||||
|  |     i2pify = False | ||||||
|     if onion_domain: |     if onion_domain: | ||||||
|         if onion_domain in handle: |         if onion_domain in handle: | ||||||
|             handle = handle.replace(onion_domain, domain) |             handle = handle.replace(onion_domain, domain) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue