diff --git a/files/helpers/const.py b/files/helpers/const.py index b204a7670..85fe1ce32 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -472,6 +472,7 @@ elif SITE == 'pcmemes.net': BANNER_THREAD = 28307 elif SITE == 'watchpeopledie.tv': + PIN_LIMIT = 4 WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.tv, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.tv/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! We are on [GitHub](https://github.com/Aevann1/rDrama).\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\nHave fun!""" FEATURES['PATRON_ICONS'] = True @@ -625,7 +626,7 @@ AWARDS = { "description": "Makes flies swarm the post.", "icon": "fas fa-poop", "color": "text-black-50", - "price": 500 + "price": 300 }, "fireflies": { "kind": "fireflies", @@ -633,7 +634,7 @@ AWARDS = { "description": "Makes fireflies swarm the post.", "icon": "fas fa-sparkles", "color": "text-warning", - "price": 500 + "price": 300 }, "train": { "kind": "train", @@ -641,7 +642,7 @@ AWARDS = { "description": "Summons a train on the post.", "icon": "fas fa-train", "color": "text-pink", - "price": 500 + "price": 300 }, "scooter": { "kind": "scooter", @@ -649,7 +650,7 @@ AWARDS = { "description": "Summons a scooter on the post.", "icon": "fas fa-flag-usa", "color": "text-muted", - "price": 500 + "price": 300 }, "wholesome": { "kind": "wholesome", @@ -657,7 +658,7 @@ AWARDS = { "description": "Summons a wholesome marsey on the post.", "icon": "fas fa-smile-beam", "color": "text-yellow", - "price": 500 + "price": 300 }, "firework": { "kind": "firework", @@ -665,7 +666,7 @@ AWARDS = { "description": "Summons fireworks on the post.", "icon": "fas fa-bahai", "color": "text-danger", - "price": 500 + "price": 300 }, "confetti": { "kind": "confetti", @@ -673,7 +674,7 @@ AWARDS = { "description": "Summons confetti to fall on the post.", "icon": "fas fa-party-horn", "color": "text-yellow", - "price": 500 + "price": 300 }, "ricardo": { "kind": "ricardo", @@ -681,7 +682,7 @@ AWARDS = { "description": "Summons Ricardo to dance on the post.", "icon": "fas fa-pinata", "color": "text-pink", - "price": 500 + "price": 300 }, "tilt": { "kind": "tilt", @@ -689,7 +690,7 @@ AWARDS = { "description": "Tilts the post or comment", "icon": "fas fa-car-tilt", "color": "text-blue", - "price": 500 + "price": 300 }, "glowie": { "kind": "glowie", @@ -697,7 +698,7 @@ AWARDS = { "description": "Indicates that the recipient can be seen when driving. Just run them over.", "icon": "fas fa-user-secret", "color": "text-green", - "price": 500 + "price": 300 }, "rehab": { "kind": "rehab", @@ -930,7 +931,7 @@ if SITE_NAME == 'PCM': "description": "Summons Croag on the post.", "icon": "fas fa-head-side", "color": "text-gold", - "price": 500 + "price": 300 }, "toe": { "kind": "toe", @@ -938,7 +939,7 @@ if SITE_NAME == 'PCM': "description": "Summons Blade's toe on the post.", "icon": "fas fa-socks", "color": "text-blue", - "price": 500 + "price": 300 }, "crab": { "kind": "crab", diff --git a/files/helpers/media.py b/files/helpers/media.py index 5cccc4323..07710640b 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -157,29 +157,31 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal if resize: if os.stat(filename).st_size > MAX_IMAGE_SIZE_BANNER_RESIZED_KB * 1024: os.remove(filename) - abort(413, f"Max size for banners, sidebars, and badges is {MAX_IMAGE_SIZE_BANNER_RESIZED_KB} KB") + abort(413, f"Max size for site assets is {MAX_IMAGE_SIZE_BANNER_RESIZED_KB} KB") if filename.startswith('files/assets/images/'): path = filename.rsplit('/', 1)[0] + kind = path.split('/')[-1] - hashes = {} + if kind in ('banners','sidebar','badges'): + hashes = {} - for img in os.listdir(path): - if resize == 400 and img in ('256.webp','585.webp'): continue - img_path = f'{path}/{img}' - if img_path == filename: continue - img = Image.open(img_path) - i_hash = str(imagehash.phash(img)) + for img in os.listdir(path): + if resize == 400 and img in ('256.webp','585.webp'): continue + img_path = f'{path}/{img}' + if img_path == filename: continue + img = Image.open(img_path) + i_hash = str(imagehash.phash(img)) + if i_hash in hashes.keys(): + print(hashes[i_hash], flush=True) + print(img_path, flush=True) + else: hashes[i_hash] = img_path + + i = Image.open(filename) + i_hash = str(imagehash.phash(i)) if i_hash in hashes.keys(): - print(hashes[i_hash], flush=True) - print(img_path, flush=True) - else: hashes[i_hash] = img_path - - i = Image.open(filename) - i_hash = str(imagehash.phash(i)) - if i_hash in hashes.keys(): - os.remove(filename) - abort(409, "Image already exists!") + os.remove(filename) + abort(409, "Image already exists!") db = db or g.db diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index d4abcabcf..4577f6325 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -17,7 +17,7 @@ import requests allowed_tags = ('b','blockquote','br','code','del','em','h1','h2','h3','h4','h5','h6','hr','i', 'li','ol','p','pre','strong','sub','sup','table','tbody','th','thead','td','tr','ul', - 'marquee','a','span','ruby','rp','rt','spoiler','img','lite-youtube','video','source','audio','g') + 'marquee','a','span','ruby','rp','rt','spoiler','img','lite-youtube','video','audio','g') allowed_styles = ['color', 'background-color', 'font-weight', 'text-align', 'filter',] @@ -57,10 +57,8 @@ def allowed_attributes(tag, name, value): if tag == 'video': if name == 'controls' and value == '': return True if name == 'preload' and value == 'none': return True - return False - - if tag == 'source': if name == 'src': return is_safe_url(value) + return False if tag == 'audio': if name == 'src': return is_safe_url(value) diff --git a/files/templates/update_assets.html b/files/templates/update_assets.html index aec180c82..20832d931 100644 --- a/files/templates/update_assets.html +++ b/files/templates/update_assets.html @@ -49,11 +49,11 @@ - + {% if type == "Marsey" %} - + {% endif %}