diff options
author | RaindropsSys <contact@minteck.org> | 2023-07-28 20:59:47 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-07-28 20:59:47 +0200 |
commit | 167f212ffb69d40a84ce39e0f00d5262781b644e (patch) | |
tree | 8bf5f116690329f1f0357018b364ee608d07ecdf | |
parent | d95cd0875006a2e02676a3ba53b15a39ce01b91a (diff) | |
download | derp-167f212ffb69d40a84ce39e0f00d5262781b644e.tar.gz derp-167f212ffb69d40a84ce39e0f00d5262781b644e.tar.bz2 derp-167f212ffb69d40a84ce39e0f00d5262781b644e.zip |
Updated main.py and added .idea/vcs.xml (automated)
-rw-r--r-- | .idea/vcs.xml | 6 | ||||
-rw-r--r-- | main.py | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + </component> +</project>
\ No newline at end of file @@ -50,10 +50,7 @@ def get_thumbnail(image_url, censor, resolution, target_post): thumb = ImageEnhance.Brightness(thumb).enhance(0.5) if censor: - image.filter(ImageFilter.GaussianBlur(40)) - - #image = ImageOps.pad(image, config.resolution, color=(0, 0, 0, 0)) - #thumb.paste(image, (0, 0), image) + image = image.filter(ImageFilter.GaussianBlur(40)) image = ImageOps.contain(image, resolution) thumb.paste(image, ((resolution[0] - image.size[0]) // 2, 0)) @@ -86,14 +83,14 @@ def get_notify_data(target_post, thumb_res, trigger_tags): height = target_post["height"] tags = target_post["tags"] censor_tags = get_censored_tags(set(tags), trigger_tags) - artists = get_artists(tags) + censor = "safe" not in tags + artists = get_artists(tags) prefix = get_prefix(censor_tags) description = get_description(target_post) title = f"#{post_id} - by {artists}" message = f"{prefix} - {width}x{height}" - censor = len(censor_tags) > 0 if description: message += f" - {description}" @@ -132,4 +129,4 @@ with open(config.sent_list_path, "r+") as f: print(post['id']) sent.append(post['id']) - f.write(f"{post['id']}\n") + f.write(f"{post['id']}\n")
\ No newline at end of file |