forked from rDrama/rDrama
Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost
commit
c8324f87ff
|
@ -472,6 +472,7 @@ elif SITE == 'pcmemes.net':
|
||||||
|
|
||||||
BANNER_THREAD = 28307
|
BANNER_THREAD = 28307
|
||||||
elif SITE == 'watchpeopledie.tv':
|
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!"""
|
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
|
FEATURES['PATRON_ICONS'] = True
|
||||||
|
@ -625,7 +626,7 @@ AWARDS = {
|
||||||
"description": "Makes flies swarm the post.",
|
"description": "Makes flies swarm the post.",
|
||||||
"icon": "fas fa-poop",
|
"icon": "fas fa-poop",
|
||||||
"color": "text-black-50",
|
"color": "text-black-50",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"fireflies": {
|
"fireflies": {
|
||||||
"kind": "fireflies",
|
"kind": "fireflies",
|
||||||
|
@ -633,7 +634,7 @@ AWARDS = {
|
||||||
"description": "Makes fireflies swarm the post.",
|
"description": "Makes fireflies swarm the post.",
|
||||||
"icon": "fas fa-sparkles",
|
"icon": "fas fa-sparkles",
|
||||||
"color": "text-warning",
|
"color": "text-warning",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"train": {
|
"train": {
|
||||||
"kind": "train",
|
"kind": "train",
|
||||||
|
@ -641,7 +642,7 @@ AWARDS = {
|
||||||
"description": "Summons a train on the post.",
|
"description": "Summons a train on the post.",
|
||||||
"icon": "fas fa-train",
|
"icon": "fas fa-train",
|
||||||
"color": "text-pink",
|
"color": "text-pink",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"scooter": {
|
"scooter": {
|
||||||
"kind": "scooter",
|
"kind": "scooter",
|
||||||
|
@ -649,7 +650,7 @@ AWARDS = {
|
||||||
"description": "Summons a scooter on the post.",
|
"description": "Summons a scooter on the post.",
|
||||||
"icon": "fas fa-flag-usa",
|
"icon": "fas fa-flag-usa",
|
||||||
"color": "text-muted",
|
"color": "text-muted",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"wholesome": {
|
"wholesome": {
|
||||||
"kind": "wholesome",
|
"kind": "wholesome",
|
||||||
|
@ -657,7 +658,7 @@ AWARDS = {
|
||||||
"description": "Summons a wholesome marsey on the post.",
|
"description": "Summons a wholesome marsey on the post.",
|
||||||
"icon": "fas fa-smile-beam",
|
"icon": "fas fa-smile-beam",
|
||||||
"color": "text-yellow",
|
"color": "text-yellow",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"firework": {
|
"firework": {
|
||||||
"kind": "firework",
|
"kind": "firework",
|
||||||
|
@ -665,7 +666,7 @@ AWARDS = {
|
||||||
"description": "Summons fireworks on the post.",
|
"description": "Summons fireworks on the post.",
|
||||||
"icon": "fas fa-bahai",
|
"icon": "fas fa-bahai",
|
||||||
"color": "text-danger",
|
"color": "text-danger",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"confetti": {
|
"confetti": {
|
||||||
"kind": "confetti",
|
"kind": "confetti",
|
||||||
|
@ -673,7 +674,7 @@ AWARDS = {
|
||||||
"description": "Summons confetti to fall on the post.",
|
"description": "Summons confetti to fall on the post.",
|
||||||
"icon": "fas fa-party-horn",
|
"icon": "fas fa-party-horn",
|
||||||
"color": "text-yellow",
|
"color": "text-yellow",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"ricardo": {
|
"ricardo": {
|
||||||
"kind": "ricardo",
|
"kind": "ricardo",
|
||||||
|
@ -681,7 +682,7 @@ AWARDS = {
|
||||||
"description": "Summons Ricardo to dance on the post.",
|
"description": "Summons Ricardo to dance on the post.",
|
||||||
"icon": "fas fa-pinata",
|
"icon": "fas fa-pinata",
|
||||||
"color": "text-pink",
|
"color": "text-pink",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"tilt": {
|
"tilt": {
|
||||||
"kind": "tilt",
|
"kind": "tilt",
|
||||||
|
@ -689,7 +690,7 @@ AWARDS = {
|
||||||
"description": "Tilts the post or comment",
|
"description": "Tilts the post or comment",
|
||||||
"icon": "fas fa-car-tilt",
|
"icon": "fas fa-car-tilt",
|
||||||
"color": "text-blue",
|
"color": "text-blue",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"glowie": {
|
"glowie": {
|
||||||
"kind": "glowie",
|
"kind": "glowie",
|
||||||
|
@ -697,7 +698,7 @@ AWARDS = {
|
||||||
"description": "Indicates that the recipient can be seen when driving. Just run them over.",
|
"description": "Indicates that the recipient can be seen when driving. Just run them over.",
|
||||||
"icon": "fas fa-user-secret",
|
"icon": "fas fa-user-secret",
|
||||||
"color": "text-green",
|
"color": "text-green",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"rehab": {
|
"rehab": {
|
||||||
"kind": "rehab",
|
"kind": "rehab",
|
||||||
|
@ -930,7 +931,7 @@ if SITE_NAME == 'PCM':
|
||||||
"description": "Summons Croag on the post.",
|
"description": "Summons Croag on the post.",
|
||||||
"icon": "fas fa-head-side",
|
"icon": "fas fa-head-side",
|
||||||
"color": "text-gold",
|
"color": "text-gold",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"toe": {
|
"toe": {
|
||||||
"kind": "toe",
|
"kind": "toe",
|
||||||
|
@ -938,7 +939,7 @@ if SITE_NAME == 'PCM':
|
||||||
"description": "Summons Blade's toe on the post.",
|
"description": "Summons Blade's toe on the post.",
|
||||||
"icon": "fas fa-socks",
|
"icon": "fas fa-socks",
|
||||||
"color": "text-blue",
|
"color": "text-blue",
|
||||||
"price": 500
|
"price": 300
|
||||||
},
|
},
|
||||||
"crab": {
|
"crab": {
|
||||||
"kind": "crab",
|
"kind": "crab",
|
||||||
|
|
|
@ -157,29 +157,31 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal
|
||||||
if resize:
|
if resize:
|
||||||
if os.stat(filename).st_size > MAX_IMAGE_SIZE_BANNER_RESIZED_KB * 1024:
|
if os.stat(filename).st_size > MAX_IMAGE_SIZE_BANNER_RESIZED_KB * 1024:
|
||||||
os.remove(filename)
|
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/'):
|
if filename.startswith('files/assets/images/'):
|
||||||
path = filename.rsplit('/', 1)[0]
|
path = filename.rsplit('/', 1)[0]
|
||||||
|
kind = path.split('/')[-1]
|
||||||
|
|
||||||
hashes = {}
|
if kind in ('banners','sidebar','badges'):
|
||||||
|
hashes = {}
|
||||||
|
|
||||||
for img in os.listdir(path):
|
for img in os.listdir(path):
|
||||||
if resize == 400 and img in ('256.webp','585.webp'): continue
|
if resize == 400 and img in ('256.webp','585.webp'): continue
|
||||||
img_path = f'{path}/{img}'
|
img_path = f'{path}/{img}'
|
||||||
if img_path == filename: continue
|
if img_path == filename: continue
|
||||||
img = Image.open(img_path)
|
img = Image.open(img_path)
|
||||||
i_hash = str(imagehash.phash(img))
|
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():
|
if i_hash in hashes.keys():
|
||||||
print(hashes[i_hash], flush=True)
|
os.remove(filename)
|
||||||
print(img_path, flush=True)
|
abort(409, "Image already exists!")
|
||||||
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!")
|
|
||||||
|
|
||||||
db = db or g.db
|
db = db or g.db
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import requests
|
||||||
|
|
||||||
allowed_tags = ('b','blockquote','br','code','del','em','h1','h2','h3','h4','h5','h6','hr','i',
|
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',
|
'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',]
|
allowed_styles = ['color', 'background-color', 'font-weight', 'text-align', 'filter',]
|
||||||
|
|
||||||
|
@ -57,10 +57,8 @@ def allowed_attributes(tag, name, value):
|
||||||
if tag == 'video':
|
if tag == 'video':
|
||||||
if name == 'controls' and value == '': return True
|
if name == 'controls' and value == '': return True
|
||||||
if name == 'preload' and value == 'none': return True
|
if name == 'preload' and value == 'none': return True
|
||||||
return False
|
|
||||||
|
|
||||||
if tag == 'source':
|
|
||||||
if name == 'src': return is_safe_url(value)
|
if name == 'src': return is_safe_url(value)
|
||||||
|
return False
|
||||||
|
|
||||||
if tag == 'audio':
|
if tag == 'audio':
|
||||||
if name == 'src': return is_safe_url(value)
|
if name == 'src': return is_safe_url(value)
|
||||||
|
|
|
@ -49,11 +49,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="mt-3" for="name">Name</label>
|
<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" %}
|
{% if type == "Marsey" %}
|
||||||
<label class="mt-3" for="tags">Tags</label>
|
<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 %}
|
{% endif %}
|
||||||
<div class="footer mt-4">
|
<div class="footer mt-4">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
|
|
Loading…
Reference in New Issue