Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-23 10:07:14 -05:00
commit c8324f87ff
4 changed files with 37 additions and 36 deletions

View File

@ -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",

View File

@ -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

View File

@ -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)

View File

@ -49,11 +49,11 @@
</div>
<label class="mt-3" for="name">Name</label>
<input autocomplete="off" type="text" id="name" class="form-control" name="name" maxlength="30" placeholder="Required" value="{{name}}" required>
<input autocomplete="off" type="text" id="name" class="form-control" name="name" maxlength="30" placeholder="Required" required>
{% if type == "Marsey" %}
<label class="mt-3" for="tags">Tags</label>
<input autocomplete="off" type="text" id="name" class="form-control" name="tags" maxlength="200" placeholder="Required" value="{{tags}}" required>
<input autocomplete="off" type="text" id="name" class="form-control" name="tags" maxlength="200" placeholder="Leave empty to keep current tags">
{% endif %}
<div class="footer mt-4">
<div class="d-flex">
@ -107,4 +107,4 @@
}
})
</script>
{% endblock %}
{% endblock %}