From fc3d6ac553870a0c1812cc158df4119ebcf64878 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 13:43:58 +0200 Subject: [PATCH 001/100] fd --- drama/classes/submission.py | 2 +- drama/helpers/aws.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drama/classes/submission.py b/drama/classes/submission.py index 23ea2e97b..8f0c208f4 100644 --- a/drama/classes/submission.py +++ b/drama/classes/submission.py @@ -421,7 +421,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): elif self.url: if v and not v.oldreddit: return self.url.replace("old.reddit.com", "reddit.com") if self.url: return self.url - return "" + return "" @property def body(self): diff --git a/drama/helpers/aws.py b/drama/helpers/aws.py index 24eb7bd78..06b3eb51f 100644 --- a/drama/helpers/aws.py +++ b/drama/helpers/aws.py @@ -68,6 +68,8 @@ def upload_file(name, file, resize=None): print(e) print(req) print(req.text) + return + else: req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {imgurkey}"}, data = {'image': base64.b64encode(file.read())}) try: resp = req.json()['data'] @@ -75,11 +77,14 @@ def upload_file(name, file, resize=None): print(e) print(req) print(req.text) + return + try: url = resp['link'].replace(".png", "_d.png").replace(".jpg", "_d.jpg").replace(".jpeg", "_d.jpeg") + "?maxwidth=9999" except Exception as e: print(e) print(req) print(req.text) + return new_image = Image( text=url, From 6957ed68445f855590c3c38af8ce305e5a17ff71 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 14:11:25 +0200 Subject: [PATCH 002/100] fdfd --- pushcss.sh | 5 +++++ snappy.txt | 45 ++++++--------------------------------------- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/pushcss.sh b/pushcss.sh index 3c04f18ff..6759ca1bb 100644 --- a/pushcss.sh +++ b/pushcss.sh @@ -1,3 +1,8 @@ +git pull +git add . +git commit -m "sneed" +git push + sass ./drama/assets/style/dark.scss D:/#D/drama/assets/style/dark_ff66ac.css sass ./drama/assets/style/light.scss D:/#D/drama/assets/style/light_ff66ac.css sass ./drama/assets/style/coffee.scss D:/#D/drama/assets/style/coffee_ff66ac.css diff --git a/snappy.txt b/snappy.txt index 618d633ba..37b0138a1 100644 --- a/snappy.txt +++ b/snappy.txt @@ -745,8 +745,6 @@ And you can thank America for my attitude. {[para]} No. {[para]} -
KKEK
EE
KEKEK
EE
KEKK
-{[para]} The fucking army? Are you serious? As somebody who was once in the US military, but got the fuck out as soon as possible, let me tell you about how truly evil and depraved the military is. During Basic Training, we were forced to this chant before shooting at the rifle range : "If they're brown, shoot them down!" At the rifle range, we fired at both adult sized targets and child sized targets. Half the targets were painted as being armed, and half the targets we were supposed to shoot at were painted as innocent civilians holding flowers. We were supposed to shoot at any target, regardless of whether it was armed or unarmed, whether it was an adult or a child. The only time in Basic Training we were allowed to watch tv was when the news showed reports of Muslim civilians being "accidentally killed" in air strikes. We were forced to scream "yes!" every time the news mentioned an innocent brown person being killed. As soon as I saw how truly evil and depraved the US military was, I GOT THE FUCK OUT. I went straight to the Drill Sergeants and told them I didn't want to be part of their right wing terrorist organization. I told them that I REFUSED to kill innocent people of color, and take part in unjustified wars of aggression. The Drill Sergeants responded by tying me up and beating my with their machine guns for ten minutes straight. They told me that I wasn't leaving and that if I ever tried to speak up against their hate and bigotry again, they would murder me. I took matters into my own hands, and jumped out the window at night while the Drill sergeants were asleep. This was the second floor, and fortunately I landed in some bushes. I ran the fuck away from the base I was at, and have not returned to this day. Every Time any American expresses admiration for the military, I fucking VOMIT. I was in for long enough to see that the US military is a white supremacist terrorist organization, just as bad as Daesh. {[para]} You’re gonna need to go home after this one. Certainly laughed though! Had a great time! You gotta go though, they don’t allow this kinda shit here. To be honest it’s kinda fucked up in a way too. Anyway, just get better. Spend some time reflecting, but most certainly get this Tom Foolery out of here. @@ -1141,28 +1139,6 @@ Y⭕️u're 👊👐✋just 🅱🅾rℹ️ng🙄😣. {[para]} The only thing more pathetic than this post is how you think people actually actually care. {[para]} -⣿⣿⣿⣿⣿⣿⣿⣿⠟⠛⢉⢉⠉⠉⠻⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⣿⣿⣿⣿⣿⠟⠠⡰⣕⣗⣷⣧⣀⣅⠘⣿⣿⣿⣿⣿ -⣿⣿⣿⣿⣿⣿⠃⣠⣳⣟⣿⣿⣷⣿⡿⣜⠄⣿⣿⣿⣿⣿ -⣿⣿⣿⣿⡿⠁⠄⣳⢷⣿⣿⣿⣿⡿⣝⠖⠄⣿⣿⣿⣿⣿ -⣿⣿⣿⣿⠃⠄⢢⡹⣿⢷⣯⢿⢷⡫⣗⠍⢰⣿⣿⣿⣿⣿ -⣿⣿⣿⡏⢀⢄⠤⣁⠋⠿⣗⣟⡯⡏⢎⠁⢸⣿⣿⣿⣿⣿ -⣿⣿⣿⠄⢔⢕⣯⣿⣿⡲⡤⡄⡤⠄⡀⢠⣿⣿⣿⣿⣿⣿ -⣿⣿⠇⠠⡳⣯⣿⣿⣾⢵⣫⢎⢎⠆⢀⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⠄⢨⣫⣿⣿⡿⣿⣻⢎⡗⡕⡅⢸⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⠄⢜⢾⣾⣿⣿⣟⣗⢯⡪⡳⡀⢸⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⠄⢸⢽⣿⣷⣿⣻⡮⡧⡳⡱⡁⢸⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⡄⢨⣻⣽⣿⣟⣿⣞⣗⡽⡸⡐⢸⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⡇⢀⢗⣿⣿⣿⣿⡿⣞⡵⡣⣊⢸⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⣿⡀⡣⣗⣿⣿⣿⣿⣯⡯⡺⣼⠎⣿⣿⣿⣿⣿⣿⣿ -⣿⣿⣿⣧⠐⡵⣻⣟⣯⣿⣷⣟⣝⢞⡿⢹⣿⣿⣿⣿⣿⣿ -⣿⣿⣿⣿⡆⢘⡺⣽⢿⣻⣿⣗⡷⣹⢩⢃⢿⣿⣿⣿⣿⣿ -⣿⣿⣿⣿⣷⠄⠪⣯⣟⣿⢯⣿⣻⣜⢎⢆⠜⣿⣿⣿⣿⣿ -⣿⣿⣿⣿⣿⡆⠄⢣⣻⣽⣿⣿⣟⣾⡮⡺⡸⠸⣿⣿⣿⣿ -⣿⣿⡿⠛⠉⠁⠄⢕⡳⣽⡾⣿⢽⣯⡿⣮⢚⣅⠹⣿⣿⣿ -⡿⠋⠄⠄⠄⠄⢀⠒⠝⣞⢿⡿⣿⣽⢿⡽⣧⣳⡅⠌⠻⣿ -⠁⠄⠄⠄⠄⠄⠐⡐⠱⡱⣻⡻⣝⣮⣟⣿⣻⣷⣏⣾⢰⣈ -{[para]} Eat shit {[para]} Lolis are for headpats and feed them healthy food, not for lewd. @@ -1427,20 +1403,6 @@ Educated adults of Earth have no choice but to accept the truth of Time Cube. {[para]} skrrt skrrt my heart hurt {[para]} -😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂 -😂🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒😂 -😂🆒💯🆒🆒🆒💯🆒💯💯💯🆒🆒🆒😂 -😂🆒💯💯🆒💯💯🆒💯🆒💯💯🆒🆒😂 -😂🆒🆒💯🆒💯🆒🆒💯🆒🆒💯💯🆒😂 -😂🆒🆒💯💯💯🆒🆒💯🆒🆒🆒💯🆒😂 -😂🆒🆒🆒💯🆒🆒🆒💯🆒🆒🆒💯🆒😂 -😂🆒🆒💯💯💯🆒🆒💯🆒🆒🆒💯🆒😂 -😂🆒🆒💯🆒💯🆒🆒💯🆒🆒💯💯🆒😂 -😂🆒💯💯🆒💯💯🆒💯🆒💯💯🆒🆒😂 -😂🆒💯🆒🆒🆒💯🆒💯💯💯🆒🆒🆒😂 -😂🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒🆒😂 -😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂 -{[para]} We are contacting users interested in mass-marketing for their poop-chutes. Our team operates large-scale promotional campaigns here on Reddit, and we are able to increase the exposure of any brown eye significantly. We specialize in reviews, likes, comments, posts, upvotes, installations, ratings, articles, and pictures of men's anuses. @@ -2148,4 +2110,9 @@ Don't mock my community. Don't mock Harry Potter fans or those winning with Auti I cut my fucking ASSHOLE open shaving it because I wanted a nice, pretty, presentable hole. I’m not talking like a little baby papercut but like, DEEP, hemorrhaging squirting GASH and now 10 hours later I am laying in bed with the most unimaginable throbbing pain you can imagine emanating from my boypucci lips every time I give it a lil squeeze but I need to take a mega shit now and this is literally worse than childbirth help me please {[para]} 'bussy' (boy pussy) should be a transmasculine exclusive term, not a term for cisgays to describe their assholes. -edit: oh dear god stop the madness I didn't realize it was AAVE don't crucify me \ No newline at end of file +edit: oh dear god stop the madness I didn't realize it was AAVE don't crucify me +{[para]} +Lots of people trying to explain to me that this is a joke, and look, I looked at the timeline, and it did seem to contain other racist material that may have been intended to be edgy and funny. But look, your racist “satire” is still racist, and you make lots of racist satire? Kinda makes me think you‘re actually a racist. +I promise whatever satirical aim you think this person has, they could TOTALLY exercise it in a way that wasn’t horribly racist. They’re being racist because they know that will get a rise out of people. And at that point, that’s not actually satire. +Hey, notice how this tweet acknowledges that I understand what the person is trying to accomplish? That means you don’t need to explain the “joke” to me. The problem with trying to be so absurdly racist that it’s satire is that you’re still being absurdly racist. If we’ve learned anything from the last four years, it’s that absurd racism does not in fact highlight how absurd racism is. It just makes absurd racism more common. +I don’t like it. I’m not going to start liking it. Saying the exact same things that absurdly racist people do but then saying it’s satire just makes me not trust you at all. \ No newline at end of file From e9456253e44fc38e96015e9006bbd020b9ee0dec Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 14:11:51 +0200 Subject: [PATCH 003/100] hg --- pushcss.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pushcss.sh b/pushcss.sh index 6759ca1bb..3c04f18ff 100644 --- a/pushcss.sh +++ b/pushcss.sh @@ -1,8 +1,3 @@ -git pull -git add . -git commit -m "sneed" -git push - sass ./drama/assets/style/dark.scss D:/#D/drama/assets/style/dark_ff66ac.css sass ./drama/assets/style/light.scss D:/#D/drama/assets/style/light_ff66ac.css sass ./drama/assets/style/coffee.scss D:/#D/drama/assets/style/coffee_ff66ac.css From 70e00e43fce3464cc769c0457d0cda4c51dec3b7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 14:26:28 +0200 Subject: [PATCH 004/100] fd --- drama/routes/votes.py | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/drama/routes/votes.py b/drama/routes/votes.py index 68039f870..9eef957c1 100644 --- a/drama/routes/votes.py +++ b/drama/routes/votes.py @@ -13,12 +13,10 @@ from .users import leaderboard @validate_formkey def api_vote_post(post_id, x, v): - if x not in ["-1", "0", "1"]: - abort(400) + if x not in ["-1", "0", "1"]: abort(400) # disallow bots - if request.headers.get("X-User-Type","") == "Bot": - abort(403) + if request.headers.get("X-User-Type","") == "Bot": abort(403) x = int(x) @@ -37,41 +35,27 @@ def api_vote_post(post_id, x, v): post = get_post(post_id) - if post.is_banned: - return jsonify({"error":"That post has been removed."}), 403 - elif post.deleted_utc > 0: - return jsonify({"error":"That post has been deleted."}), 403 - elif post.is_archived: - return jsonify({"error":"That post is archived and can no longer be voted on."}), 403 - # check for existing vote - existing = g.db.query(Vote).filter_by( - user_id=v.id, submission_id=post.id).first() + existing = g.db.query(Vote).filter_by(user_id=v.id, submission_id=post.id).first() + if existing: existing.change_to(x) g.db.add(existing) - else: vote = Vote(user_id=v.id, vote_type=x, submission_id=base36decode(post_id), - creation_ip=request.remote_addr, app_id=v.client.application.id if v.client else None ) g.db.add(vote) - try: - g.db.flush() - except: - return jsonify({"error":"Vote already exists."}), 422 + g.db.flush() - posts = [] - posts.append(post) - post.upvotes = post.ups post.downvotes = post.downs g.db.add(post) + g.db.commit() users1, users2 = leaderboard() return "", 204 From 397b0ae4d9c8a46910e4476334e7ddac3c945a4f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 16:18:12 +0200 Subject: [PATCH 005/100] fd --- drama/classes/user.py | 3 +-- drama/helpers/wrappers.py | 9 +++------ drama/routes/admin.py | 12 ++++-------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drama/classes/user.py b/drama/classes/user.py index c6855858b..4e39fca98 100644 --- a/drama/classes/user.py +++ b/drama/classes/user.py @@ -388,8 +388,7 @@ class User(Base, Stndrd, Age_times): @property def formkey(self): - if "session_id" not in session: - session["session_id"] = token_hex(16) + if "session_id" not in session: session["session_id"] = token_hex(16) msg = f"{session['session_id']}+{self.id}+{self.login_nonce}" diff --git a/drama/helpers/wrappers.py b/drama/helpers/wrappers.py index 9efcf94ef..2b8801de0 100644 --- a/drama/helpers/wrappers.py +++ b/drama/helpers/wrappers.py @@ -375,14 +375,11 @@ def validate_formkey(f): if not request.path.startswith("/api/v1"): - submitted_key = request.values.get("formkey", "none") + submitted_key = request.values.get("formkey", None) - if not submitted_key: + if not submitted_key: abort(401) - abort(401) - - elif not v.validate_formkey(submitted_key): - abort(401) + elif not v.validate_formkey(submitted_key): abort(401) return f(*args, v=v, **kwargs) diff --git a/drama/routes/admin.py b/drama/routes/admin.py index 6a6e8717a..e87403dce 100644 --- a/drama/routes/admin.py +++ b/drama/routes/admin.py @@ -275,28 +275,24 @@ def admin_vote_info_get(v): ups = g.db.query(Vote ).options(joinedload(Vote.user) ).filter_by(submission_id=thing.id, vote_type=1 - ).order_by(Vote.creation_ip.asc() - ).all() + ).all() downs = g.db.query(Vote ).options(joinedload(Vote.user) ).filter_by(submission_id=thing.id, vote_type=-1 - ).order_by(Vote.creation_ip.asc() - ).all() + ).all() elif isinstance(thing, Comment): ups = g.db.query(CommentVote ).options(joinedload(CommentVote.user) ).filter_by(comment_id=thing.id, vote_type=1 - ).order_by(CommentVote.creation_ip.asc() - ).all() + ).all() downs = g.db.query(CommentVote ).options(joinedload(CommentVote.user) ).filter_by(comment_id=thing.id, vote_type=-1 - ).order_by(CommentVote.creation_ip.asc() - ).all() + ).all() else: abort(400) From f86236a27efa73cdad96c9810f4bfcb26aa8cd8e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 16:49:03 +0200 Subject: [PATCH 006/100] fgfg --- drama/classes/user.py | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/drama/classes/user.py b/drama/classes/user.py index 4e39fca98..4e6a5e3db 100644 --- a/drama/classes/user.py +++ b/drama/classes/user.py @@ -177,12 +177,8 @@ class User(Base, Stndrd, Age_times): @property @lazy def dramacoins(self): - posts = sum([x[0] - 1 for x in - g.db.query(Submission.score).options(lazyload('*')).filter_by(author_id=self.id, is_banned=False, - deleted_utc=0).all()]) - comments = sum([x[0] - 1 for x in - g.db.query(Comment.score).options(lazyload('*')).filter_by(author_id=self.id, is_banned=False, - deleted_utc=0).all()]) + posts = sum([x.upvotes + x.downvotes - 1 for x in g.db.query(Submission).options(lazyload('*')).filter_by(author_id=self.id, is_banned=False, deleted_utc=0).all()]) + comments = sum([x.upvotes + x.downvotes - 1 for x in g.db.query(Comment).options(lazyload('*')).filter_by(author_id=self.id, is_banned=False, deleted_utc=0).all()]) return int(posts + comments) def has_block(self, target): @@ -781,8 +777,8 @@ class User(Base, Stndrd, Age_times): # Takes care of all functions needed for account reinstatement. - self.is_banned = None - self.unban_utc = None + self.is_banned = 0 + self.unban_utc = 0 g.db.add(self) @@ -882,34 +878,6 @@ class User(Base, Stndrd, Age_times): return [x[0] for x in comments.offset(25 * (page - 1)).limit(26).all()] - def guild_rep(self, guild, recent=0): - - posts = g.db.query(Submission.score).filter_by( - is_banned=False, - original_board_id=guild.id) - - if recent: - cutoff = int(time.time()) - 60 * 60 * 24 * recent - posts = posts.filter(Submission.created_utc > cutoff) - - posts = posts.all() - - post_rep = sum([x[0] for x in posts]) - len(list(sum([x[0] for x in posts]))) - - comments = g.db.query(Comment.score).filter_by( - is_banned=False, - original_board_id=guild.id) - - if recent: - cutoff = int(time.time()) - 60 * 60 * 24 * recent - comments = comments.filter(Comment.created_utc > cutoff) - - comments = comments.all() - - comment_rep = sum([x[0] for x in comments]) - len(list(sum([x[0] for x in comments]))) - - return int(post_rep + comment_rep) - @property def has_premium(self): From ece2c11a8387a14ae6a152c9c746d6bc6f8c71aa Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 17:32:01 +0200 Subject: [PATCH 007/100] fg --- drama/templates/submission.html | 2 +- drama/templates/submission_listing.html | 8 ++++---- drama/templates/viewers.html | 2 +- snappy.txt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drama/templates/submission.html b/drama/templates/submission.html index 27ea3c3a6..7ee6c1469 100644 --- a/drama/templates/submission.html +++ b/drama/templates/submission.html @@ -236,7 +236,7 @@ {% if p.is_nsfl %}nsfl{% endif %} {% if p.private %}unlisted{% endif %} {% if p.is_repost %}repost{% endif %} - {% if p.active_flags %}{{p.active_flags}} Flags{% endif %} + {% if p.active_flags %}{{p.active_flags}} Flags{% endif %} {% if p.author.is_deleted %}[deleted account]{% else %}   {{p.author.username}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %}{% endif %}  {{p.age_string}} ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) diff --git a/drama/templates/submission_listing.html b/drama/templates/submission_listing.html index 4754d2387..da6d2229e 100644 --- a/drama/templates/submission_listing.html +++ b/drama/templates/submission_listing.html @@ -124,7 +124,7 @@ -
+ -