Spaces:
Zeuscloud
/
m
Sleeping

Eluza133 commited on
Commit
0201d68
·
verified ·
1 Parent(s): d03c30b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +455 -721
app.py CHANGED
@@ -12,7 +12,7 @@ import random
12
  app = Flask(__name__)
13
  app.secret_key = 'supersecretkey' # Replace with a secure key in production
14
  DATA_FILE = 'data_adusis.json'
15
- REPO_ID = "Eluza133/w1f9"
16
  HF_TOKEN_WRITE = os.getenv("HF_TOKEN") # Write token
17
  HF_TOKEN_READ = os.getenv("HF_TOKEN_READ") or HF_TOKEN_WRITE
18
 
@@ -87,28 +87,28 @@ def periodic_backup():
87
  upload_db_to_hf()
88
  time.sleep(15)
89
 
90
- # Updated base style with new color palette
91
  BASE_STYLE = '''
92
  :root {
93
  --primary: #ff6b6b; /* Bright coral */
94
  --secondary: #4ecdc4; /* Turquoise */
95
- --background-light: #fff5e6; /* Light peach */
96
- --background-dark: #2d1b3d; /* Deep purple */
97
- --card-bg-light: rgba(255, 245, 230, 0.95);
98
- --card-bg-dark: rgba(60, 40, 80, 0.95);
 
99
  --text-light: #2d1b3d;
100
- --text-dark: #fff5e6;
101
- --shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
102
- --glass-bg: rgba(255, 245, 230, 0.15);
103
- --transition: all 0.4s ease;
104
- --gradient: linear-gradient(135deg, #ff6b6b, #4ecdc4);
105
  }
106
  * { margin: 0; padding: 0; box-sizing: border-box; }
107
  body {
108
  font-family: 'Inter', sans-serif;
109
  background: var(--background-light);
110
  color: var(--text-light);
111
- line-height: 1.6;
112
  transition: var(--transition);
113
  overflow-x: hidden;
114
  }
@@ -120,48 +120,51 @@ BASE_STYLE = '''
120
  position: fixed;
121
  top: 0;
122
  left: 0;
123
- width: 300px;
124
  height: 100%;
125
  background: var(--glass-bg);
126
- backdrop-filter: blur(20px);
127
- padding: 30px;
128
  box-shadow: var(--shadow);
129
  z-index: 1000;
 
130
  transition: var(--transition);
131
  }
132
  .sidebar-header {
133
- margin-bottom: 40px;
134
  display: flex;
135
  align-items: center;
136
  gap: 15px;
 
137
  }
138
  .nav-brand {
139
- font-size: 1.8em;
140
- font-weight: 700;
141
- background: var(--gradient);
142
  -webkit-background-clip: text;
143
  color: transparent;
144
  }
145
  .logo {
146
- width: 40px;
147
- height: 40px;
148
- border-radius: 50%;
 
149
  }
150
  .nav-links {
151
  display: flex;
152
  flex-direction: column;
153
- gap: 20px;
154
  }
155
  .nav-link {
156
  display: flex;
157
  align-items: center;
158
- gap: 15px;
159
- padding: 18px;
160
  background: var(--card-bg-light);
161
  color: var(--text-light);
162
  text-decoration: none;
163
- border-radius: 15px;
164
- font-size: 1.1em;
 
165
  transition: var(--transition);
166
  }
167
  body.dark .nav-link {
@@ -169,73 +172,78 @@ BASE_STYLE = '''
169
  color: var(--text-dark);
170
  }
171
  .nav-link:hover {
172
- transform: translateX(15px);
173
  background: var(--primary);
174
  color: white;
 
175
  }
176
  .logout-btn {
177
  background: var(--secondary);
178
  color: white;
179
  }
180
  .logout-btn:hover {
181
- background: #45b7b0;
182
  }
183
  .menu-btn {
184
  display: none;
185
- font-size: 32px;
186
  background: var(--glass-bg);
187
  border: none;
188
  color: var(--primary);
189
  cursor: pointer;
190
  position: fixed;
191
- top: 20px;
192
- left: 20px;
193
  z-index: 1001;
194
- padding: 12px;
195
  border-radius: 50%;
196
  box-shadow: var(--shadow);
197
  }
198
  .container {
199
- margin: 30px auto 30px 330px;
200
  max-width: 1200px;
201
- padding: 30px;
202
  transition: var(--transition);
203
  }
204
  .btn {
205
- padding: 14px 28px;
206
  background: var(--primary);
207
  color: white;
208
  border: none;
209
- border-radius: 15px;
210
  cursor: pointer;
211
- font-size: 1.1em;
 
212
  transition: var(--transition);
213
- display: inline-block;
214
- margin: 10px 0;
 
 
215
  }
216
  .btn:hover {
217
- transform: scale(1.08);
218
  background: #e65b5b;
 
219
  }
220
  input, textarea, select {
221
  width: 100%;
222
- padding: 14px;
223
- margin: 15px 0;
224
- border: 2px solid rgba(0, 0, 0, 0.1);
225
- border-radius: 15px;
226
  background: var(--glass-bg);
227
  color: var(--text-light);
228
- font-size: 1.1em;
229
  transition: var(--transition);
 
230
  }
231
  body.dark input, body.dark textarea, body.dark select {
232
- border: 2px solid rgba(255, 255, 255, 0.1);
233
  color: var(--text-dark);
234
  }
235
  input:focus, textarea:focus, select:focus {
236
  outline: none;
237
- border-color: var(--primary);
238
- background: rgba(255, 245, 230, 0.2);
239
  }
240
  .modal {
241
  display: none;
@@ -244,35 +252,46 @@ BASE_STYLE = '''
244
  left: 0;
245
  width: 100%;
246
  height: 100%;
247
- background: rgba(0, 0, 0, 0.85);
248
  z-index: 2000;
249
  justify-content: center;
250
  align-items: center;
 
251
  }
252
- .modal img {
253
- max-width: 95%;
254
- max-height: 95%;
255
  object-fit: contain;
256
  border-radius: 15px;
257
  box-shadow: var(--shadow);
 
258
  }
259
  .theme-toggle {
260
  position: fixed;
261
- top: 20px;
262
- right: 20px;
263
  background: var(--glass-bg);
264
  border: none;
265
- padding: 12px;
266
  border-radius: 50%;
267
  cursor: pointer;
268
- font-size: 24px;
269
  box-shadow: var(--shadow);
270
  transition: var(--transition);
271
  }
 
 
 
 
 
 
 
 
 
272
  @media (max-width: 768px) {
273
  .sidebar {
274
  transform: translateX(-100%);
275
- width: 280px;
276
  }
277
  .sidebar.active {
278
  transform: translateX(0);
@@ -281,17 +300,13 @@ BASE_STYLE = '''
281
  display: block;
282
  }
283
  .container {
284
- margin: 80px 15px 30px 15px;
285
  max-width: calc(100% - 30px);
286
  }
287
  .theme-toggle {
288
- top: 80px;
289
  right: 15px;
290
  }
291
- .btn, input, textarea, select {
292
- font-size: 1em;
293
- padding: 12px;
294
- }
295
  }
296
  '''
297
 
@@ -299,7 +314,7 @@ NAV_HTML = '''
299
  <aside class="sidebar" id="sidebar">
300
  <div class="sidebar-header">
301
  <img src="https://cdn-avatars.huggingface.co/v1/production/uploads/673b00f35373479538ac373c/W_dumUND8K6IlMxVmpUgS.jpeg" alt="Logo" class="logo">
302
- <span class="nav-brand">ADUSIS QosHUB</span>
303
  </div>
304
  <nav class="nav-links">
305
  <a href="{{ url_for('feed') }}" class="nav-link"><span>📜</span> Feed</a>
@@ -345,45 +360,47 @@ def register():
345
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
346
  <meta name="google-site-verification" content="V6EqDTA9Oj9V1OfNbnBHj5RKrdcXlABD8tqfEFVUHJY" />
347
  <title>Register - Content Hub</title>
348
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
349
  <style>
350
  ''' + BASE_STYLE + '''
351
  .container {
352
- max-width: 550px;
353
  background: var(--card-bg-light);
354
- backdrop-filter: blur(20px);
355
- padding: 50px;
356
- border-radius: 25px;
357
  box-shadow: var(--shadow);
 
358
  }
359
  body.dark .container {
360
  background: var(--card-bg-dark);
361
  }
362
  h1 {
363
- font-size: 2.2em;
364
- font-weight: 600;
365
  text-align: center;
366
- margin-bottom: 30px;
367
- background: var(--gradient);
368
  -webkit-background-clip: text;
369
  color: transparent;
370
  }
371
  .flash {
372
  color: var(--secondary);
373
  text-align: center;
374
- margin-bottom: 20px;
375
- font-size: 1.1em;
376
- font-weight: 500;
377
  }
378
  .link {
379
  text-align: center;
380
- margin-top: 25px;
381
  color: var(--primary);
382
- font-size: 1.1em;
383
  text-decoration: none;
 
384
  }
385
  .link:hover {
386
- text-decoration: underline;
387
  }
388
  </style>
389
  </head>
@@ -449,45 +466,47 @@ def login():
449
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
450
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
451
  <title>Login - Content Hub</title>
452
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
453
  <style>
454
  ''' + BASE_STYLE + '''
455
  .container {
456
- max-width: 550px;
457
  background: var(--card-bg-light);
458
- backdrop-filter: blur(20px);
459
- padding: 50px;
460
- border-radius: 25px;
461
  box-shadow: var(--shadow);
 
462
  }
463
  body.dark .container {
464
  background: var(--card-bg-dark);
465
  }
466
  h1 {
467
- font-size: 2.2em;
468
- font-weight: 600;
469
  text-align: center;
470
- margin-bottom: 30px;
471
- background: var(--gradient);
472
  -webkit-background-clip: text;
473
  color: transparent;
474
  }
475
  .flash {
476
  color: var(--secondary);
477
  text-align: center;
478
- margin-bottom: 20px;
479
- font-size: 1.1em;
480
- font-weight: 500;
481
  }
482
  .link {
483
  text-align: center;
484
- margin-top: 25px;
485
  color: var(--primary);
486
- font-size: 1.1em;
487
  text-decoration: none;
 
488
  }
489
  .link:hover {
490
- text-decoration: underline;
491
  }
492
  </style>
493
  </head>
@@ -542,48 +561,9 @@ def increment_view(post_id):
542
  if post:
543
  post['views'] = post.get('views', 0) + 1
544
  save_data(data)
545
- return '', 204 # Empty response with code 204 (No Content)
546
- return 'Post not found', 404
547
-
548
- # Like post
549
- @app.route('/like_post/<post_id>', methods=['POST'])
550
- def like_post(post_id):
551
- if 'username' not in session:
552
- return 'Login required', 401
553
-
554
- data = load_data()
555
- post = next((p for p in data['posts'] if p['id'] == post_id), None)
556
- if post:
557
- username = session['username']
558
- if username not in post.get('likes', []):
559
- post['likes'] = post.get('likes', []) + [username]
560
- else:
561
- post['likes'] = [user for user in post.get('likes', []) if user != username]
562
- save_data(data)
563
  return '', 204
564
  return 'Post not found', 404
565
 
566
- # Comment on post from feed
567
- @app.route('/comment_post/<post_id>', methods=['POST'])
568
- def comment_post(post_id):
569
- if 'username' not in session:
570
- return 'Login required', 401
571
-
572
- data = load_data()
573
- post = next((p for p in data['posts'] if p['id'] == post_id), None)
574
- if post:
575
- comment_text = request.form.get('comment')
576
- if comment_text:
577
- username = session['username']
578
- post['comments'] = post.get('comments', []) + [{
579
- 'user': username,
580
- 'text': comment_text,
581
- 'date': datetime.now().strftime('%Y-%m-%d %H:%M:%S')
582
- }]
583
- save_data(data)
584
- return redirect(url_for('feed'))
585
- return 'Post not found', 404
586
-
587
  # Feed
588
  @app.route('/', methods=['GET', 'POST'])
589
  def feed():
@@ -592,7 +572,7 @@ def feed():
592
  is_authenticated = 'username' in session
593
  username = session.get('username', None)
594
 
595
- search_query = request.form.get('search', '').strip().lower() if request.method == 'POST' and 'search' in request.form else request.args.get('search', '').strip().lower()
596
  if search_query:
597
  posts = [post for post in posts if search_query in post['title'].lower() or search_query in post['description'].lower()]
598
 
@@ -604,27 +584,27 @@ def feed():
604
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
605
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
606
  <meta name="google-site-verification" content="V6EqDTA9Oj9V1OfNbnBHj5RKrdcXlABD8tqfEFVUHJY" />
607
- <title>Adusis - QoS , BBC , BNWO HUB</title>
608
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
609
  <style>
610
  ''' + BASE_STYLE + '''
611
  h1 {
612
- font-size: 2.8em;
613
- font-weight: 700;
614
- margin-bottom: 40px;
615
- background: var(--gradient);
616
  -webkit-background-clip: text;
617
  color: transparent;
618
  }
619
  .search-container {
620
- max-width: 600px;
621
- margin: 0 auto 40px;
622
  position: relative;
623
  }
624
  .search-input {
625
- padding-right: 60px;
626
  background: var(--card-bg-light);
627
- border: none;
628
  box-shadow: var(--shadow);
629
  }
630
  body.dark .search-input {
@@ -636,122 +616,67 @@ def feed():
636
  top: 50%;
637
  transform: translateY(-50%);
638
  background: var(--primary);
639
- padding: 10px 20px;
640
- border-radius: 12px;
641
- font-size: 1em;
642
  box-shadow: none;
643
  }
644
  .search-btn:hover {
645
  background: #e65b5b;
646
  }
647
- .post-list {
648
- display: flex;
649
- flex-direction: column;
650
- gap: 40px;
651
  }
652
  .post-item {
653
  background: var(--card-bg-light);
 
 
654
  border-radius: 20px;
655
- overflow: hidden;
656
  box-shadow: var(--shadow);
657
  transition: var(--transition);
 
658
  color: var(--text-light);
659
- backdrop-filter: blur(10px);
660
- padding: 20px;
661
  }
662
  body.dark .post-item {
663
  background: var(--card-bg-dark);
664
  color: var(--text-dark);
665
  }
666
  .post-item:hover {
667
- transform: translateY(-10px);
668
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
669
  }
670
  .post-preview {
671
  width: 100%;
672
- max-height: 400px;
673
- object-fit: contain;
674
  border-radius: 15px;
675
- margin-bottom: 20px;
676
  transition: var(--transition);
677
  }
678
- .post-item:hover .post-preview {
679
- filter: brightness(1.1);
680
- }
681
- .post-content {
682
- padding: 0 20px 20px;
683
- }
684
  .post-item h2 {
685
- font-size: 1.8em;
686
  font-weight: 600;
687
- margin-bottom: 15px;
688
- background: var(--gradient);
689
- -webkit-background-clip: text;
690
- color: transparent;
691
  }
692
  .post-item p {
693
- font-size: 1.1em;
694
- margin-bottom: 20px;
695
  }
696
- .post-meta {
697
- display: flex;
698
- justify-content: space-between;
699
- font-size: 0.95em;
700
- color: rgba(0, 0, 0, 0.7);
701
- margin-bottom: 15px;
702
  }
703
- body.dark .post-meta {
704
- color: rgba(255, 255, 255, 0.7);
705
  }
706
  .username-link {
707
  color: var(--primary);
708
- font-weight: 500;
709
  text-decoration: none;
710
  }
711
  .username-link:hover {
712
- text-decoration: underline;
713
- }
714
- .stats {
715
- display: flex;
716
- gap: 20px;
717
- }
718
- .stats span {
719
- display: flex;
720
- align-items: center;
721
- gap: 5px;
722
- }
723
- .interaction-bar {
724
- display: flex;
725
- gap: 15px;
726
- align-items: center;
727
- padding-top: 15px;
728
- border-top: 1px solid rgba(0, 0, 0, 0.1);
729
- }
730
- body.dark .interaction-bar {
731
- border-top: 1px solid rgba(255, 255, 255, 0.1);
732
- }
733
- .like-btn {
734
- padding: 8px 16px;
735
- font-size: 0.95em;
736
- background: var(--secondary);
737
- }
738
- .like-btn.liked {
739
- background: #45b7b0;
740
- }
741
- .comment-form {
742
- flex: 1;
743
- display: flex;
744
- gap: 10px;
745
- }
746
- .comment-form input {
747
- flex: 1;
748
- margin: 0;
749
- padding: 8px;
750
- font-size: 0.95em;
751
- }
752
- .comment-btn {
753
- padding: 8px 16px;
754
- font-size: 0.95em;
755
  }
756
  </style>
757
  </head>
@@ -764,47 +689,24 @@ def feed():
764
  <div class="search-container">
765
  <form method="POST">
766
  <input type="text" name="search" class="search-input" placeholder="Search by title or description" value="{{ search_query }}">
767
- <button type="submit" class="search-btn">Search</button>
768
  </form>
769
  </div>
770
- <div class="post-list">
771
  {% for post in posts %}
772
- <div class="post-item">
773
- <a href="{{ url_for('post_page', post_id=post['id']) }}" style="text-decoration: none; color: inherit;">
774
- {% if post['type'] == 'video' %}
775
- <video class="post-preview" preload="metadata" muted>
776
- <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
777
- </video>
778
- {% else %}
779
- <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}" onclick="openModal(this.src, event, '{{ post['id'] }}')">
780
- {% endif %}
781
- <div class="post-content">
782
- <h2>{{ post['title'] }}</h2>
783
- <p>{{ post['description'] }}</p>
784
- <div class="post-meta">
785
- <a href="{{ url_for('user_profile', username=post['uploader']) }}" class="username-link">{{ post['uploader'] }}</a>
786
- <div class="stats">
787
- <span>👁️ {{ post['views'] }}</span>
788
- <span>❤️ {{ post['likes']|length }}</span>
789
- <span>💬 {{ post.get('comments', [])|length }}</span>
790
- </div>
791
- </div>
792
- </div>
793
- </a>
794
- {% if is_authenticated %}
795
- <div class="interaction-bar">
796
- <form method="POST" action="{{ url_for('like_post', post_id=post['id']) }}">
797
- <button type="submit" class="btn like-btn {% if username in post['likes'] %}liked{% endif %}">
798
- {% if username in post['likes'] %}Unlike{% else %}Like{% endif %}
799
- </button>
800
- </form>
801
- <form method="POST" action="{{ url_for('comment_post', post_id=post['id']) }}" class="comment-form">
802
- <input type="text" name="comment" placeholder="Add a comment" required>
803
- <button type="submit" class="btn comment-btn">Comment</button>
804
- </form>
805
- </div>
806
  {% endif %}
807
- </div>
 
 
 
 
808
  {% endfor %}
809
  </div>
810
  </div>
@@ -883,55 +785,55 @@ def post_page(post_id):
883
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
884
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
885
  <title>{{ post['title'] }} - Content Hub</title>
886
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
887
  <style>
888
  ''' + BASE_STYLE + '''
889
  .container {
890
- max-width: 950px;
891
  background: var(--card-bg-light);
892
- backdrop-filter: blur(20px);
893
- padding: 50px;
894
- border-radius: 25px;
895
  box-shadow: var(--shadow);
896
  }
897
  body.dark .container {
898
  background: var(--card-bg-dark);
899
  }
900
  h1 {
901
- font-size: 2.5em;
902
- font-weight: 700;
903
- margin-bottom: 30px;
904
- background: var(--gradient);
905
  -webkit-background-clip: text;
906
  color: transparent;
907
  }
908
  video, img {
909
  width: 100%;
910
- max-height: 500px;
911
  object-fit: cover;
912
  border-radius: 15px;
913
  box-shadow: var(--shadow);
914
- margin-bottom: 30px;
915
  }
916
  p {
917
- font-size: 1.2em;
918
- margin-bottom: 20px;
919
  }
920
  .like-btn.liked {
921
  background: var(--secondary);
922
  }
923
  .like-btn.liked:hover {
924
- background: #45b7b0;
925
  }
926
  .comment-section {
927
- margin-top: 40px;
928
  }
929
  .comment {
930
  background: var(--glass-bg);
931
- padding: 20px;
932
- border-radius: 15px;
933
- margin-bottom: 20px;
934
- font-size: 1.1em;
935
  }
936
  .username-link {
937
  color: var(--primary);
@@ -939,7 +841,7 @@ def post_page(post_id):
939
  text-decoration: none;
940
  }
941
  .username-link:hover {
942
- text-decoration: underline;
943
  }
944
  </style>
945
  </head>
@@ -957,7 +859,7 @@ def post_page(post_id):
957
  <img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}" onclick="openModal(this.src)">
958
  {% endif %}
959
  <p>{{ post['description'] }}</p>
960
- <p>Uploaded by: <a href="{{ url_for('user_profile', username=post['uploader']) }}" class="username-link">{{ post['uploader'] }}</a> | {{ post['upload_date'] }}</p>
961
  <p>Views: {{ post['views'] }} | Likes: {{ post['likes']|length }}</p>
962
  {% if is_authenticated %}
963
  <form method="POST" style="display: inline;">
@@ -966,11 +868,11 @@ def post_page(post_id):
966
  </button>
967
  </form>
968
  <form method="POST" class="comment-section">
969
- <textarea name="comment" placeholder="Leave a comment" rows="4"></textarea>
970
  <button type="submit" class="btn">Submit</button>
971
  </form>
972
  {% endif %}
973
- <h3 style="margin-top: 40px; font-size: 1.8em;">Comments</h3>
974
  {% for comment in post.get('comments', []) %}
975
  <div class="comment">
976
  <p><strong><a href="{{ url_for('user_profile', username=comment['user']) }}" class="username-link">{{ comment['user'] }}</a></strong> ({{ comment['date'] }}): {{ comment['text'] }}</p>
@@ -978,7 +880,7 @@ def post_page(post_id):
978
  {% endfor %}
979
  <a href="{{ url_for('feed') }}" class="btn">Back to Feed</a>
980
  {% if not is_authenticated %}
981
- <p style="margin-top: 20px;"><a href="{{ url_for('login') }}">Login</a> to like and comment.</p>
982
  {% endif %}
983
  </div>
984
  <div class="modal" id="imageModal" onclick="closeModal(event)">
@@ -1032,14 +934,13 @@ def profile():
1032
  avatar = user_data.get('avatar', None)
1033
 
1034
  if request.method == 'POST':
1035
- if request.form.get('action') == 'delete_post':
1036
  post_id = request.form.get('post_id')
1037
  if post_id:
1038
- data['posts'] = [p for p in data['posts'] if p['id'] != post_id]
1039
  save_data(data)
1040
- flash('Post deleted successfully!')
1041
  return redirect(url_for('profile'))
1042
- elif request.form.get('action') == 'update_profile':
1043
  bio = request.form.get('bio', '')
1044
  link = request.form.get('link', '')
1045
  avatar_file = request.files.get('avatar')
@@ -1064,7 +965,6 @@ def profile():
1064
  data['users'][username]['bio'] = bio
1065
  data['users'][username]['link'] = link
1066
  save_data(data)
1067
- flash('Profile updated successfully!')
1068
  return redirect(url_for('profile'))
1069
 
1070
  html = '''
@@ -1075,56 +975,59 @@ def profile():
1075
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1076
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1077
  <title>Profile - {{ username }} - Content Hub</title>
1078
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
1079
  <style>
1080
  ''' + BASE_STYLE + '''
1081
  .container {
1082
- max-width: 950px;
1083
  }
1084
  .profile-header {
1085
  display: flex;
1086
  align-items: center;
1087
- gap: 30px;
1088
  background: var(--card-bg-light);
1089
- backdrop-filter: blur(20px);
1090
- padding: 40px;
1091
- border-radius: 25px;
1092
  box-shadow: var(--shadow);
1093
- margin-bottom: 40px;
1094
  }
1095
  body.dark .profile-header {
1096
  background: var(--card-bg-dark);
1097
  }
1098
  .avatar {
1099
- width: 140px;
1100
- height: 140px;
1101
  border-radius: 50%;
1102
  object-fit: cover;
1103
  box-shadow: var(--shadow);
 
 
 
 
1104
  }
1105
  .profile-info h1 {
1106
- font-size: 2.5em;
1107
- font-weight: 700;
1108
- background: var(--gradient);
1109
  -webkit-background-clip: text;
1110
  color: transparent;
1111
- margin-bottom: 20px;
1112
  }
1113
  .profile-info p {
1114
- font-size: 1.2em;
1115
- margin-bottom: 15px;
1116
  }
1117
  .post-grid {
1118
  display: grid;
1119
- grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
1120
  gap: 25px;
1121
  }
1122
  .post-item {
1123
- position: relative;
1124
- width: 340px;
1125
  background: var(--card-bg-light);
1126
- border-radius: 15px;
1127
- overflow: hidden;
 
1128
  box-shadow: var(--shadow);
1129
  transition: var(--transition);
1130
  }
@@ -1132,68 +1035,40 @@ def profile():
1132
  background: var(--card-bg-dark);
1133
  }
1134
  .post-item:hover {
1135
- transform: scale(1.05);
1136
- box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
1137
  }
1138
  .post-preview {
1139
  width: 100%;
1140
- height: 200px;
1141
  object-fit: cover;
1142
- transition: var(--transition);
1143
- }
1144
- .post-item:hover .post-preview {
1145
- transform: scale(1.1);
1146
- }
1147
- .post-info {
1148
- padding: 15px;
1149
- background: rgba(0, 0, 0, 0.7);
1150
- position: absolute;
1151
- bottom: 0;
1152
- left: 0;
1153
- right: 0;
1154
- color: white;
1155
- }
1156
- body.dark .post-info {
1157
- background: rgba(255, 255, 255, 0.1);
1158
  }
1159
  .post-item h3 {
1160
- font-size: 1.3em;
1161
  font-weight: 600;
1162
- margin-bottom: 5px;
1163
- white-space: nowrap;
1164
- overflow: hidden;
1165
- text-overflow: ellipsis;
1166
  }
1167
  .delete-btn {
1168
  background: var(--secondary);
1169
- padding: 8px 16px;
1170
- font-size: 0.9em;
1171
- margin-top: 10px;
1172
- display: block; /* Убедимся, что кнопка отображается корректно */
1173
  }
1174
  .delete-btn:hover {
1175
- background: #45b7b0;
1176
  }
1177
  .share-btn {
1178
- background: #ffa07a;
1179
  }
1180
  .share-btn:hover {
1181
- background: #e6916e;
1182
  }
1183
  h2 {
1184
- font-size: 2em;
1185
- margin: 40px 0 20px;
1186
- background: var(--gradient);
 
1187
  -webkit-background-clip: text;
1188
  color: transparent;
1189
  }
1190
- .flash {
1191
- color: var(--secondary);
1192
- text-align: center;
1193
- margin-bottom: 20px;
1194
- font-size: 1.1em;
1195
- font-weight: 500;
1196
- }
1197
  </style>
1198
  </head>
1199
  <body>
@@ -1209,26 +1084,18 @@ def profile():
1209
  <h1>{{ username }}</h1>
1210
  <p>{{ bio }}</p>
1211
  {% if link %}
1212
- <p><a href="{{ link }}" target="_blank">{{ link }}</a></p>
1213
  {% endif %}
1214
  <p>Views: {{ total_views }} | Likes: {{ total_likes }}</p>
1215
  <button class="btn share-btn" onclick="copyProfileLink()">Share</button>
1216
  </div>
1217
  </div>
1218
- {% with messages = get_flashed_messages() %}
1219
- {% if messages %}
1220
- {% for message in messages %}
1221
- <div class="flash">{{ message }}</div>
1222
- {% endfor %}
1223
- {% endif %}
1224
- {% endwith %}
1225
  <h2>Edit Profile</h2>
1226
  <form method="POST" enctype="multipart/form-data">
1227
- <textarea name="bio" placeholder="Profile Bio" rows="4">{{ bio }}</textarea>
1228
  <input type="text" name="link" placeholder="Link" value="{{ link }}">
1229
  <input type="file" name="avatar" accept="image/*">
1230
- <input type="hidden" name="action" value="update_profile">
1231
- <button type="submit" class="btn">Save</button>
1232
  </form>
1233
  <a href="{{ url_for('upload') }}" class="btn">Add Post</a>
1234
  <h2>Your Posts</h2>
@@ -1242,21 +1109,20 @@ def profile():
1242
  <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
1243
  </video>
1244
  {% else %}
1245
- <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}">
1246
  {% endif %}
1247
- <div class="post-info">
1248
- <h3>{{ post['title'] }}</h3>
1249
- </div>
1250
  </a>
1251
- <form method="POST" action="{{ url_for('profile') }}">
 
 
1252
  <input type="hidden" name="post_id" value="{{ post['id'] }}">
1253
- <input type="hidden" name="action" value="delete_post">
1254
- <button type="submit" class="btn delete-btn">Delete</button>
1255
  </form>
1256
  </div>
1257
  {% endfor %}
1258
  {% else %}
1259
- <p style="font-size: 1.2em;">You haven't uploaded any posts yet.</p>
1260
  {% endif %}
1261
  </div>
1262
  </div>
@@ -1330,56 +1196,59 @@ def user_profile(username):
1330
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1331
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1332
  <title>Profile - {{ username }} - Content Hub</title>
1333
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
1334
  <style>
1335
  ''' + BASE_STYLE + '''
1336
  .container {
1337
- max-width: 950px;
1338
  }
1339
  .profile-header {
1340
  display: flex;
1341
  align-items: center;
1342
- gap: 30px;
1343
  background: var(--card-bg-light);
1344
- backdrop-filter: blur(20px);
1345
- padding: 40px;
1346
- border-radius: 25px;
1347
  box-shadow: var(--shadow);
1348
- margin-bottom: 40px;
1349
  }
1350
  body.dark .profile-header {
1351
  background: var(--card-bg-dark);
1352
  }
1353
  .avatar {
1354
- width: 140px;
1355
- height: 140px;
1356
  border-radius: 50%;
1357
  object-fit: cover;
1358
  box-shadow: var(--shadow);
 
 
 
 
1359
  }
1360
  .profile-info h1 {
1361
- font-size: 2.5em;
1362
- font-weight: 700;
1363
- background: var(--gradient);
1364
  -webkit-background-clip: text;
1365
  color: transparent;
1366
- margin-bottom: 20px;
1367
  }
1368
  .profile-info p {
1369
- font-size: 1.2em;
1370
- margin-bottom: 15px;
1371
  }
1372
  .post-grid {
1373
  display: grid;
1374
- grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
1375
  gap: 25px;
1376
  }
1377
  .post-item {
1378
- position: relative;
1379
- width: 340px;
1380
  background: var(--card-bg-light);
1381
- border-radius: 15px;
1382
- overflow: hidden;
 
1383
  box-shadow: var(--shadow);
1384
  transition: var(--transition);
1385
  }
@@ -1387,48 +1256,31 @@ def user_profile(username):
1387
  background: var(--card-bg-dark);
1388
  }
1389
  .post-item:hover {
1390
- transform: scale(1.05);
1391
- box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
1392
  }
1393
  .post-preview {
1394
  width: 100%;
1395
- height: 200px;
1396
  object-fit: cover;
1397
- transition: var(--transition);
1398
- }
1399
- .post-item:hover .post-preview {
1400
- transform: scale(1.1);
1401
- }
1402
- .post-info {
1403
- padding: 15px;
1404
- background: rgba(0, 0, 0, 0.7);
1405
- position: absolute;
1406
- bottom: 0;
1407
- left: 0;
1408
- right: 0;
1409
- color: white;
1410
- }
1411
- body.dark .post-info {
1412
- background: rgba(255, 255, 255, 0.1);
1413
  }
1414
  .post-item h3 {
1415
- font-size: 1.3em;
1416
  font-weight: 600;
1417
- margin-bottom: 5px;
1418
- white-space: nowrap;
1419
- overflow: hidden;
1420
- text-overflow: ellipsis;
1421
  }
1422
  .share-btn {
1423
- background: #ffa07a;
1424
  }
1425
  .share-btn:hover {
1426
- background: #e6916e;
1427
  }
1428
  h2 {
1429
- font-size: 2em;
1430
- margin: 40px 0 20px;
1431
- background: var(--gradient);
 
1432
  -webkit-background-clip: text;
1433
  color: transparent;
1434
  }
@@ -1447,7 +1299,7 @@ def user_profile(username):
1447
  <h1>{{ username }}</h1>
1448
  <p>{{ bio }}</p>
1449
  {% if link %}
1450
- <p><a href="{{ link }}" target="_blank">{{ link }}</a></p>
1451
  {% endif %}
1452
  <p>Views: {{ total_views }} | Likes: {{ total_likes }}</p>
1453
  <button class="btn share-btn" onclick="copyProfileLink()">Share</button>
@@ -1464,16 +1316,16 @@ def user_profile(username):
1464
  <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
1465
  </video>
1466
  {% else %}
1467
- <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}">
1468
  {% endif %}
1469
- <div class="post-info">
1470
- <h3>{{ post['title'] }}</h3>
1471
- </div>
1472
  </a>
 
 
1473
  </div>
1474
  {% endfor %}
1475
  {% else %}
1476
- <p style="font-size: 1.2em;">This user hasn't uploaded any posts yet.</p>
1477
  {% endif %}
1478
  </div>
1479
  </div>
@@ -1537,8 +1389,7 @@ def upload():
1537
  uploader = session['username']
1538
 
1539
  if not title or not file:
1540
- flash('Please provide a title and select a file')
1541
- return redirect(url_for('upload'))
1542
 
1543
  filename = secure_filename(file.filename)
1544
  temp_path = os.path.join('uploads', filename)
@@ -1576,7 +1427,6 @@ def upload():
1576
 
1577
  if os.path.exists(temp_path):
1578
  os.remove(temp_path)
1579
- flash('Post uploaded successfully!')
1580
  return redirect(url_for('profile'))
1581
 
1582
  is_authenticated = 'username' in session
@@ -1589,34 +1439,34 @@ def upload():
1589
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1590
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1591
  <title>Upload Content - Content Hub</title>
1592
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
1593
  <style>
1594
  ''' + BASE_STYLE + '''
1595
  .container {
1596
- max-width: 650px;
1597
  background: var(--card-bg-light);
1598
- backdrop-filter: blur(20px);
1599
- padding: 50px;
1600
- border-radius: 25px;
1601
  box-shadow: var(--shadow);
1602
  }
1603
  body.dark .container {
1604
  background: var(--card-bg-dark);
1605
  }
1606
  h1 {
1607
- font-size: 2.2em;
1608
- font-weight: 700;
1609
  text-align: center;
1610
- margin-bottom: 30px;
1611
- background: var(--gradient);
1612
  -webkit-background-clip: text;
1613
  color: transparent;
1614
  }
1615
  #progress-container {
1616
- margin-top: 20px;
1617
- height: 10px;
1618
  background: rgba(0, 0, 0, 0.1);
1619
- border-radius: 5px;
1620
  overflow: hidden;
1621
  }
1622
  body.dark #progress-container {
@@ -1625,15 +1475,8 @@ def upload():
1625
  #progress-bar {
1626
  width: 0%;
1627
  height: 100%;
1628
- background: var(--primary);
1629
- transition: width 0.4s ease;
1630
- }
1631
- .flash {
1632
- color: var(--secondary);
1633
- text-align: center;
1634
- margin-bottom: 20px;
1635
- font-size: 1.1em;
1636
- font-weight: 500;
1637
  }
1638
  </style>
1639
  </head>
@@ -1643,16 +1486,9 @@ def upload():
1643
  <button class="theme-toggle" onclick="toggleTheme()">🌙</button>
1644
  <div class="container">
1645
  <h1>Upload Content</h1>
1646
- {% with messages = get_flashed_messages() %}
1647
- {% if messages %}
1648
- {% for message in messages %}
1649
- <div class="flash">{{ message }}</div>
1650
- {% endfor %}
1651
- {% endif %}
1652
- {% endwith %}
1653
  <form id="upload-form" enctype="multipart/form-data">
1654
  <input type="text" name="title" placeholder="Title" required>
1655
- <textarea name="description" placeholder="Description" rows="5"></textarea>
1656
  <input type="file" name="file" accept="video/*,image/*" required>
1657
  <button type="submit" class="btn">Upload</button>
1658
  </form>
@@ -1698,64 +1534,56 @@ def upload():
1698
  '''
1699
  return render_template_string(html, username=username, is_authenticated=is_authenticated)
1700
 
1701
- # General Chat
1702
  @app.route('/chat', methods=['GET', 'POST'])
1703
  def chat():
1704
  data = load_data()
1705
  is_authenticated = 'username' in session
1706
  username = session.get('username', None)
1707
  chat_messages = data['general_chat']
1708
- is_admin = username == "admin" # Условный админ
1709
 
1710
  if request.method == 'POST' and is_authenticated:
1711
- if 'send_message' in request.form:
1712
- message = request.form.get('message')
1713
- file = request.files.get('file')
1714
- post_id = request.form.get('post_id')
1715
 
1716
- message_data = {
1717
- 'id': len(chat_messages) + 1, # Уникальный ID для сообщения
1718
- 'sender': username,
1719
- 'time': datetime.now().strftime('%Y-%m-%d %H:%M:%S')
1720
- }
1721
-
1722
- if message:
1723
- message_data['text'] = message
1724
-
1725
- if file and file.filename:
1726
- filename = secure_filename(file.filename)
1727
- temp_path = os.path.join('uploads', filename)
1728
- os.makedirs('uploads', exist_ok=True)
1729
- file.save(temp_path)
1730
-
1731
- file_type = 'video' if filename.lower().endswith(('.mp4', '.mov', '.avi')) else 'photo'
1732
- api = HfApi()
1733
- file_path = f"chat_files/general/{filename}"
1734
- api.upload_file(
1735
- path_or_fileobj=temp_path,
1736
- path_in_repo=file_path,
1737
- repo_id=REPO_ID,
1738
- repo_type="dataset",
1739
- token=HF_TOKEN_WRITE,
1740
- commit_message=f"Uploaded chat file by {username}"
1741
- )
1742
- message_data['file'] = file_path
1743
- message_data['file_type'] = file_type
1744
- if os.path.exists(temp_path):
1745
- os.remove(temp_path)
1746
-
1747
- if post_id:
1748
- post = next((p for p in data['posts'] if p['id'] == post_id and p['uploader'] == username), None)
1749
- if post:
1750
- message_data['post_id'] = post_id
1751
 
1752
- if 'text' in message_data or 'file' in message_data or 'post_id' in message_data:
1753
- data['general_chat'].append(message_data)
1754
- save_data(data)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1755
 
1756
- elif 'kick_message' in request.form and is_admin:
1757
- message_id = int(request.form.get('message_id'))
1758
- data['general_chat'] = [msg for msg in data['general_chat'] if msg['id'] != message_id]
1759
  save_data(data)
1760
 
1761
  return redirect(url_for('chat'))
@@ -1768,119 +1596,97 @@ def chat():
1768
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1769
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1770
  <title>General Chat - Content Hub</title>
1771
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
1772
  <style>
1773
  ''' + BASE_STYLE + '''
1774
  .container {
1775
- max-width: 950px;
1776
  background: var(--card-bg-light);
1777
- backdrop-filter: blur(20px);
1778
- padding: 30px;
1779
- border-radius: 25px;
1780
  box-shadow: var(--shadow);
1781
  }
1782
  body.dark .container {
1783
  background: var(--card-bg-dark);
1784
  }
1785
  h1 {
1786
- font-size: 2.5em;
1787
- font-weight: 700;
1788
- margin-bottom: 20px;
1789
- background: var(--gradient);
1790
  -webkit-background-clip: text;
1791
  color: transparent;
1792
  }
1793
- .chat-box {
1794
  max-height: 500px;
1795
  overflow-y: auto;
1796
- margin-bottom: 20px;
1797
- padding: 10px;
1798
- border-radius: 15px;
1799
  background: var(--glass-bg);
1800
- backdrop-filter: blur(10px);
 
 
1801
  }
1802
  .message {
1803
- display: flex;
1804
- align-items: flex-start;
1805
- padding: 15px;
1806
- background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
1807
- border-radius: 15px;
1808
- margin-bottom: 15px;
1809
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
1810
- animation: fadeIn 0.3s ease-in;
1811
  }
1812
  body.dark .message {
1813
- background: linear-gradient(135deg, rgba(60, 40, 80, 0.2), rgba(78, 205, 196, 0.2));
1814
- }
1815
- @keyframes fadeIn {
1816
- from { opacity: 0; transform: translateY(10px); }
1817
- to { opacity: 1; transform: translateY(0); }
1818
- }
1819
- .message-avatar {
1820
- width: 40px;
1821
- height: 40px;
1822
- border-radius: 50%;
1823
- margin-right: 15px;
1824
- object-fit: cover;
1825
- border: 2px solid var(--primary);
1826
- }
1827
- .message-content {
1828
- flex: 1;
1829
  }
1830
- .message-header {
1831
- display: flex;
1832
- align-items: center;
1833
- gap: 10px;
1834
- margin-bottom: 5px;
1835
  }
1836
- .message-sender {
1837
- font-weight: 600;
1838
  color: var(--primary);
 
1839
  text-decoration: none;
1840
- transition: var(--transition);
1841
  }
1842
- .message-sender:hover {
1843
- color: var(--secondary);
1844
  }
1845
- .message-time {
1846
- font-size: 0.9em;
1847
  color: rgba(0, 0, 0, 0.6);
 
1848
  }
1849
- body.dark .message-time {
1850
  color: rgba(255, 255, 255, 0.6);
1851
  }
1852
- .kick-btn {
1853
- background: #ff4444;
1854
- padding: 5px 10px;
1855
- font-size: 0.9em;
1856
- border-radius: 10px;
1857
- transition: var(--transition);
1858
- }
1859
- .kick-btn:hover {
1860
- background: #cc3333;
1861
- transform: scale(1.1);
1862
- }
1863
  .message img, .message video {
1864
- max-width: 250px;
1865
- max-height: 250px;
1866
  border-radius: 10px;
1867
  margin-top: 10px;
1868
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
1869
  }
1870
  .message a {
1871
- color: var(--secondary);
1872
  text-decoration: none;
1873
- font-weight: 500;
1874
  }
1875
  .message a:hover {
1876
- text-decoration: underline;
1877
  }
1878
  .message-form {
1879
  margin-top: 20px;
 
 
 
 
 
 
 
1880
  background: var(--glass-bg);
1881
- padding: 20px;
1882
- border-radius: 15px;
1883
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
 
1884
  }
1885
  </style>
1886
  </head>
@@ -1890,52 +1696,36 @@ def chat():
1890
  <button class="theme-toggle" onclick="toggleTheme()">🌙</button>
1891
  <div class="container">
1892
  <h1>General Chat</h1>
1893
- <div class="chat-box">
1894
  {% for message in chat_messages %}
1895
  <div class="message">
1896
- {% set sender_data = users[message['sender']] %}
1897
- {% if sender_data['avatar'] %}
1898
- <img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ sender_data['avatar'] }}" alt="{{ message['sender'] }}" class="message-avatar">
1899
- {% else %}
1900
- <div class="message-avatar" style="background: var(--primary);"></div>
1901
  {% endif %}
1902
- <div class="message-content">
1903
- <div class="message-header">
1904
- <a href="{{ url_for('user_profile', username=message['sender']) }}" class="message-sender">{{ message['sender'] }}</a>
1905
- <span class="message-time">{{ message['time'] }}</span>
1906
- {% if is_admin %}
1907
- <form method="POST" style="display: inline;">
1908
- <input type="hidden" name="message_id" value="{{ message['id'] }}">
1909
- <button type="submit" name="kick_message" class="btn kick-btn">Kick</button>
1910
- </form>
1911
- {% endif %}
1912
- </div>
1913
- {% if 'text' in message %}
1914
- <p>{{ message['text'] }}</p>
1915
  {% endif %}
1916
- {% if 'file' in message %}
1917
- {% if message['file_type'] == 'video' %}
1918
- <video controls>
1919
- <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ message['file'] }}" type="video/mp4">
1920
- </video>
1921
- {% else %}
1922
- <img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ message['file'] }}" alt="Chat file" onclick="openModal(this.src)">
1923
  {% endif %}
1924
- {% endif %}
1925
- {% if 'post_id' in message %}
1926
- {% with post = posts|selectattr('id', 'equalto', message['post_id'])|first %}
1927
- {% if post %}
1928
- <p>Shared: <a href="{{ url_for('post_page', post_id=message['post_id']) }}">{{ post['title'] }}</a></p>
1929
- {% endif %}
1930
- {% endwith %}
1931
- {% endif %}
1932
- </div>
1933
  </div>
1934
  {% endfor %}
1935
  </div>
1936
  {% if is_authenticated %}
1937
  <form method="POST" enctype="multipart/form-data" class="message-form">
1938
- <textarea name="message" placeholder="Type a message" rows="3"></textarea>
1939
  <input type="file" name="file" accept="video/*,image/*">
1940
  <select name="post_id" class="post-select">
1941
  <option value="">Share a post (optional)</option>
@@ -1943,10 +1733,10 @@ def chat():
1943
  <option value="{{ post['id'] }}">{{ post['title'] }}</option>
1944
  {% endfor %}
1945
  </select>
1946
- <button type="submit" name="send_message" class="btn">Send</button>
1947
  </form>
1948
  {% else %}
1949
- <p style="margin-top: 20px;"><a href="{{ url_for('login') }}">Login</a> to send messages.</p>
1950
  {% endif %}
1951
  </div>
1952
  <div class="modal" id="imageModal" onclick="closeModal(event)">
@@ -1973,8 +1763,8 @@ def chat():
1973
  }
1974
  window.onload = () => {
1975
  if (localStorage.getItem('theme') === 'dark') document.body.classList.add('dark');
1976
- const chatBox = document.querySelector('.chat-box');
1977
- chatBox.scrollTop = chatBox.scrollHeight;
1978
  };
1979
  </script>
1980
  </body>
@@ -1983,41 +1773,30 @@ def chat():
1983
  user_posts = [p for p in data['posts'] if p['uploader'] == username] if is_authenticated else []
1984
  return render_template_string(html,
1985
  chat_messages=chat_messages,
1986
- username=username,
1987
  is_authenticated=is_authenticated,
1988
- is_admin=is_admin,
1989
  repo_id=REPO_ID,
1990
  posts=data['posts'],
1991
- user_posts=user_posts,
1992
- users=data['users'])
1993
 
1994
  # Admin panel
1995
  @app.route('/admhosto', methods=['GET', 'POST'])
1996
  def admin_panel():
1997
- if 'username' not in session or session['username'] != 'admin':
1998
- flash('Admin access required!')
1999
- return redirect(url_for('login'))
2000
-
2001
  data = load_data()
2002
  posts = sorted(data.get('posts', []), key=lambda x: datetime.strptime(x['upload_date'], '%Y-%m-%d %H:%M:%S'), reverse=True)
2003
  is_authenticated = 'username' in session
2004
  username = session.get('username', None)
2005
 
2006
- if request.method == 'POST':
2007
- if request.form.get('action') == 'delete_post':
2008
- post_id = request.form.get('post_id')
2009
- if post_id:
2010
- data['posts'] = [p for p in data['posts'] if p['id'] != post_id]
2011
- save_data(data)
2012
- flash('Post deleted successfully!')
2013
- return redirect(url_for('admin_panel'))
2014
- elif request.form.get('action') == 'search':
2015
- search_query = request.form.get('search', '').strip().lower()
2016
- posts = [post for post in posts if search_query in post['title'].lower() or search_query in post['description'].lower()]
2017
- else:
2018
- search_query = request.args.get('search', '').strip().lower()
2019
- if search_query:
2020
- posts = [post for post in posts if search_query in post['title'].lower() or search_query in post['description'].lower()]
2021
 
2022
  html = '''
2023
  <!DOCTYPE html>
@@ -2027,26 +1806,26 @@ def admin_panel():
2027
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
2028
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
2029
  <title>Admin Panel - Content Hub</title>
2030
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
2031
  <style>
2032
  ''' + BASE_STYLE + '''
2033
  h1 {
2034
- font-size: 2.8em;
2035
- font-weight: 700;
2036
- margin-bottom: 40px;
2037
- background: var(--gradient);
2038
  -webkit-background-clip: text;
2039
  color: transparent;
2040
  }
2041
  .search-container {
2042
- max-width: 600px;
2043
- margin: 0 auto 40px;
2044
  position: relative;
2045
  }
2046
  .search-input {
2047
- padding-right: 60px;
2048
  background: var(--card-bg-light);
2049
- border: none;
2050
  box-shadow: var(--shadow);
2051
  }
2052
  body.dark .search-input {
@@ -2058,9 +1837,8 @@ def admin_panel():
2058
  top: 50%;
2059
  transform: translateY(-50%);
2060
  background: var(--primary);
2061
- padding: 10px 20px;
2062
- border-radius: 12px;
2063
- font-size: 1em;
2064
  box-shadow: none;
2065
  }
2066
  .search-btn:hover {
@@ -2068,15 +1846,14 @@ def admin_panel():
2068
  }
2069
  .post-grid {
2070
  display: grid;
2071
- grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
2072
  gap: 25px;
2073
  }
2074
  .post-item {
2075
- position: relative;
2076
- width: 340px;
2077
  background: var(--card-bg-light);
2078
- border-radius: 15px;
2079
- overflow: hidden;
 
2080
  box-shadow: var(--shadow);
2081
  transition: var(--transition);
2082
  }
@@ -2084,67 +1861,37 @@ def admin_panel():
2084
  background: var(--card-bg-dark);
2085
  }
2086
  .post-item:hover {
2087
- transform: scale(1.05);
2088
- box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
2089
  }
2090
  .post-preview {
2091
  width: 100%;
2092
- height: 200px;
2093
  object-fit: cover;
2094
- transition: var(--transition);
2095
- }
2096
- .post-item:hover .post-preview {
2097
- transform: scale(1.1);
2098
- }
2099
- .post-info {
2100
- padding: 15px;
2101
- background: rgba(0, 0, 0, 0.7);
2102
- position: absolute;
2103
- bottom: 0;
2104
- left: 0;
2105
- right: 0;
2106
- color: white;
2107
- }
2108
- body.dark .post-info {
2109
- background: rgba(255, 255, 255, 0.1);
2110
  }
2111
  .post-item h2 {
2112
- font-size: 1.3em;
2113
  font-weight: 600;
2114
- margin-bottom: 5px;
2115
- white-space: nowrap;
2116
- overflow: hidden;
2117
- text-overflow: ellipsis;
 
2118
  }
2119
  .delete-btn {
2120
  background: var(--secondary);
2121
- padding: 8px 16px;
2122
- font-size: 0.9em;
2123
- margin-top: 10px;
2124
- display: block; /* Убедимся, что кнопка отображается корректно */
2125
  }
2126
  .delete-btn:hover {
2127
- background: #45b7b0;
2128
  }
2129
  .username-link {
2130
- color: var(--secondary);
2131
- font-weight: 500;
2132
  text-decoration: none;
2133
  }
2134
  .username-link:hover {
2135
- text-decoration: underline;
2136
- }
2137
- .post-meta {
2138
- font-size: 0.9em;
2139
- display: flex;
2140
- justify-content: space-between;
2141
- }
2142
- .flash {
2143
- color: var(--secondary);
2144
- text-align: center;
2145
- margin-bottom: 20px;
2146
- font-size: 1.1em;
2147
- font-weight: 500;
2148
  }
2149
  </style>
2150
  </head>
@@ -2154,18 +1901,10 @@ def admin_panel():
2154
  <button class="theme-toggle" onclick="toggleTheme()">🌙</button>
2155
  <div class="container">
2156
  <h1>Admin Panel: All Posts</h1>
2157
- {% with messages = get_flashed_messages() %}
2158
- {% if messages %}
2159
- {% for message in messages %}
2160
- <div class="flash">{{ message }}</div>
2161
- {% endfor %}
2162
- {% endif %}
2163
- {% endwith %}
2164
  <div class="search-container">
2165
  <form method="POST">
2166
  <input type="text" name="search" class="search-input" placeholder="Search by title or description" value="{{ search_query }}">
2167
- <input type="hidden" name="action" value="search">
2168
- <button type="submit" class="search-btn">Search</button>
2169
  </form>
2170
  </div>
2171
  <div class="post-grid">
@@ -2178,25 +1917,20 @@ def admin_panel():
2178
  <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
2179
  </video>
2180
  {% else %}
2181
- <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}">
2182
  {% endif %}
2183
- <div class="post-info">
2184
- <h2>{{ post['title'] }}</h2>
2185
- <div class="post-meta">
2186
- <a href="{{ url_for('user_profile', username=post['uploader']) }}" class="username-link">{{ post['uploader'] }}</a>
2187
- <span>{{ post['upload_date'] }}</span>
2188
- </div>
2189
- </div>
2190
  </a>
2191
- <form method="POST" action="{{ url_for('admin_panel') }}">
 
 
2192
  <input type="hidden" name="post_id" value="{{ post['id'] }}">
2193
- <input type="hidden" name="action" value="delete_post">
2194
- <button type="submit" class="btn delete-btn">Delete</button>
2195
  </form>
2196
  </div>
2197
  {% endfor %}
2198
  {% else %}
2199
- <p style="font-size: 1.2em;">No posts found.</p>
2200
  {% endif %}
2201
  </div>
2202
  </div>
 
12
  app = Flask(__name__)
13
  app.secret_key = 'supersecretkey' # Replace with a secure key in production
14
  DATA_FILE = 'data_adusis.json'
15
+ REPO_ID = "Eluza133/A12d12s12"
16
  HF_TOKEN_WRITE = os.getenv("HF_TOKEN") # Write token
17
  HF_TOKEN_READ = os.getenv("HF_TOKEN_READ") or HF_TOKEN_WRITE
18
 
 
87
  upload_db_to_hf()
88
  time.sleep(15)
89
 
90
+ # Updated base style with 2025 trends
91
  BASE_STYLE = '''
92
  :root {
93
  --primary: #ff6b6b; /* Bright coral */
94
  --secondary: #4ecdc4; /* Turquoise */
95
+ --accent: #a78bfa; /* Vibrant purple */
96
+ --background-light: #f8f1e9; /* Warm off-white */
97
+ --background-dark: #1a1626; /* Deep night */
98
+ --card-bg-light: rgba(255, 255, 255, 0.9);
99
+ --card-bg-dark: rgba(40, 34, 56, 0.9);
100
  --text-light: #2d1b3d;
101
+ --text-dark: #e0d8f0;
102
+ --shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
103
+ --glass-bg: rgba(255, 255, 255, 0.1);
104
+ --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
 
105
  }
106
  * { margin: 0; padding: 0; box-sizing: border-box; }
107
  body {
108
  font-family: 'Inter', sans-serif;
109
  background: var(--background-light);
110
  color: var(--text-light);
111
+ line-height: 1.7;
112
  transition: var(--transition);
113
  overflow-x: hidden;
114
  }
 
120
  position: fixed;
121
  top: 0;
122
  left: 0;
123
+ width: 280px;
124
  height: 100%;
125
  background: var(--glass-bg);
126
+ backdrop-filter: blur(15px);
127
+ padding: 25px;
128
  box-shadow: var(--shadow);
129
  z-index: 1000;
130
+ transform: translateX(0);
131
  transition: var(--transition);
132
  }
133
  .sidebar-header {
 
134
  display: flex;
135
  align-items: center;
136
  gap: 15px;
137
+ margin-bottom: 35px;
138
  }
139
  .nav-brand {
140
+ font-size: 1.6em;
141
+ font-weight: 800;
142
+ background: linear-gradient(135deg, var(--primary), var(--accent));
143
  -webkit-background-clip: text;
144
  color: transparent;
145
  }
146
  .logo {
147
+ width: 36px;
148
+ height: 36px;
149
+ border-radius: 12px;
150
+ box-shadow: var(--shadow);
151
  }
152
  .nav-links {
153
  display: flex;
154
  flex-direction: column;
155
+ gap: 15px;
156
  }
157
  .nav-link {
158
  display: flex;
159
  align-items: center;
160
+ gap: 12px;
161
+ padding: 15px 20px;
162
  background: var(--card-bg-light);
163
  color: var(--text-light);
164
  text-decoration: none;
165
+ border-radius: 12px;
166
+ font-size: 1em;
167
+ font-weight: 500;
168
  transition: var(--transition);
169
  }
170
  body.dark .nav-link {
 
172
  color: var(--text-dark);
173
  }
174
  .nav-link:hover {
175
+ transform: scale(1.03);
176
  background: var(--primary);
177
  color: white;
178
+ box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
179
  }
180
  .logout-btn {
181
  background: var(--secondary);
182
  color: white;
183
  }
184
  .logout-btn:hover {
185
+ background: #3db8b0;
186
  }
187
  .menu-btn {
188
  display: none;
189
+ font-size: 28px;
190
  background: var(--glass-bg);
191
  border: none;
192
  color: var(--primary);
193
  cursor: pointer;
194
  position: fixed;
195
+ top: 15px;
196
+ left: 15px;
197
  z-index: 1001;
198
+ padding: 10px;
199
  border-radius: 50%;
200
  box-shadow: var(--shadow);
201
  }
202
  .container {
203
+ margin: 20px auto 20px 300px;
204
  max-width: 1200px;
205
+ padding: 25px;
206
  transition: var(--transition);
207
  }
208
  .btn {
209
+ padding: 12px 24px;
210
  background: var(--primary);
211
  color: white;
212
  border: none;
213
+ border-radius: 12px;
214
  cursor: pointer;
215
+ font-size: 1em;
216
+ font-weight: 600;
217
  transition: var(--transition);
218
+ display: inline-flex;
219
+ align-items: center;
220
+ gap: 8px;
221
+ box-shadow: var(--shadow);
222
  }
223
  .btn:hover {
224
+ transform: scale(1.05);
225
  background: #e65b5b;
226
+ box-shadow: 0 6px 24px rgba(255, 107, 107, 0.4);
227
  }
228
  input, textarea, select {
229
  width: 100%;
230
+ padding: 12px;
231
+ margin: 12px 0;
232
+ border: none;
233
+ border-radius: 12px;
234
  background: var(--glass-bg);
235
  color: var(--text-light);
236
+ font-size: 1em;
237
  transition: var(--transition);
238
+ box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
239
  }
240
  body.dark input, body.dark textarea, body.dark select {
 
241
  color: var(--text-dark);
242
  }
243
  input:focus, textarea:focus, select:focus {
244
  outline: none;
245
+ background: rgba(255, 255, 255, 0.15);
246
+ box-shadow: 0 0 0 3px var(--primary);
247
  }
248
  .modal {
249
  display: none;
 
252
  left: 0;
253
  width: 100%;
254
  height: 100%;
255
+ background: rgba(0, 0, 0, 0.9);
256
  z-index: 2000;
257
  justify-content: center;
258
  align-items: center;
259
+ transition: opacity 0.3s ease;
260
  }
261
+ .modal img, .modal video {
262
+ max-width: 90%;
263
+ max-height: 90%;
264
  object-fit: contain;
265
  border-radius: 15px;
266
  box-shadow: var(--shadow);
267
+ animation: fadeIn 0.3s ease;
268
  }
269
  .theme-toggle {
270
  position: fixed;
271
+ top: 15px;
272
+ right: 15px;
273
  background: var(--glass-bg);
274
  border: none;
275
+ padding: 10px;
276
  border-radius: 50%;
277
  cursor: pointer;
278
+ font-size: 22px;
279
  box-shadow: var(--shadow);
280
  transition: var(--transition);
281
  }
282
+ .theme-toggle:hover {
283
+ transform: rotate(20deg);
284
+ background: var(--accent);
285
+ color: white;
286
+ }
287
+ @keyframes fadeIn {
288
+ from { opacity: 0; transform: scale(0.95); }
289
+ to { opacity: 1; transform: scale(1); }
290
+ }
291
  @media (max-width: 768px) {
292
  .sidebar {
293
  transform: translateX(-100%);
294
+ width: 260px;
295
  }
296
  .sidebar.active {
297
  transform: translateX(0);
 
300
  display: block;
301
  }
302
  .container {
303
+ margin: 70px 15px 20px 15px;
304
  max-width: calc(100% - 30px);
305
  }
306
  .theme-toggle {
307
+ top: 70px;
308
  right: 15px;
309
  }
 
 
 
 
310
  }
311
  '''
312
 
 
314
  <aside class="sidebar" id="sidebar">
315
  <div class="sidebar-header">
316
  <img src="https://cdn-avatars.huggingface.co/v1/production/uploads/673b00f35373479538ac373c/W_dumUND8K6IlMxVmpUgS.jpeg" alt="Logo" class="logo">
317
+ <span class="nav-brand">ADUSIS QoSHUB</span>
318
  </div>
319
  <nav class="nav-links">
320
  <a href="{{ url_for('feed') }}" class="nav-link"><span>📜</span> Feed</a>
 
360
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
361
  <meta name="google-site-verification" content="V6EqDTA9Oj9V1OfNbnBHj5RKrdcXlABD8tqfEFVUHJY" />
362
  <title>Register - Content Hub</title>
363
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
364
  <style>
365
  ''' + BASE_STYLE + '''
366
  .container {
367
+ max-width: 500px;
368
  background: var(--card-bg-light);
369
+ backdrop-filter: blur(15px);
370
+ padding: 40px;
371
+ border-radius: 20px;
372
  box-shadow: var(--shadow);
373
+ animation: fadeIn 0.5s ease;
374
  }
375
  body.dark .container {
376
  background: var(--card-bg-dark);
377
  }
378
  h1 {
379
+ font-size: 2em;
380
+ font-weight: 800;
381
  text-align: center;
382
+ margin-bottom: 25px;
383
+ background: linear-gradient(135deg, var(--primary), var(--accent));
384
  -webkit-background-clip: text;
385
  color: transparent;
386
  }
387
  .flash {
388
  color: var(--secondary);
389
  text-align: center;
390
+ margin-bottom: 15px;
391
+ font-size: 1em;
392
+ font-weight: 600;
393
  }
394
  .link {
395
  text-align: center;
396
+ margin-top: 20px;
397
  color: var(--primary);
398
+ font-size: 1em;
399
  text-decoration: none;
400
+ font-weight: 600;
401
  }
402
  .link:hover {
403
+ color: var(--accent);
404
  }
405
  </style>
406
  </head>
 
466
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
467
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
468
  <title>Login - Content Hub</title>
469
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
470
  <style>
471
  ''' + BASE_STYLE + '''
472
  .container {
473
+ max-width: 500px;
474
  background: var(--card-bg-light);
475
+ backdrop-filter: blur(15px);
476
+ padding: 40px;
477
+ border-radius: 20px;
478
  box-shadow: var(--shadow);
479
+ animation: fadeIn 0.5s ease;
480
  }
481
  body.dark .container {
482
  background: var(--card-bg-dark);
483
  }
484
  h1 {
485
+ font-size: 2em;
486
+ font-weight: 800;
487
  text-align: center;
488
+ margin-bottom: 25px;
489
+ background: linear-gradient(135deg, var(--primary), var(--accent));
490
  -webkit-background-clip: text;
491
  color: transparent;
492
  }
493
  .flash {
494
  color: var(--secondary);
495
  text-align: center;
496
+ margin-bottom: 15px;
497
+ font-size: 1em;
498
+ font-weight: 600;
499
  }
500
  .link {
501
  text-align: center;
502
+ margin-top: 20px;
503
  color: var(--primary);
504
+ font-size: 1em;
505
  text-decoration: none;
506
+ font-weight: 600;
507
  }
508
  .link:hover {
509
+ color: var(--accent);
510
  }
511
  </style>
512
  </head>
 
561
  if post:
562
  post['views'] = post.get('views', 0) + 1
563
  save_data(data)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
  return '', 204
565
  return 'Post not found', 404
566
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
  # Feed
568
  @app.route('/', methods=['GET', 'POST'])
569
  def feed():
 
572
  is_authenticated = 'username' in session
573
  username = session.get('username', None)
574
 
575
+ search_query = request.form.get('search', '').strip().lower() if request.method == 'POST' else request.args.get('search', '').strip().lower()
576
  if search_query:
577
  posts = [post for post in posts if search_query in post['title'].lower() or search_query in post['description'].lower()]
578
 
 
584
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
585
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
586
  <meta name="google-site-verification" content="V6EqDTA9Oj9V1OfNbnBHj5RKrdcXlABD8tqfEFVUHJY" />
587
+ <title>Adusis - QoS, BBC, BNWO HUB</title>
588
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
589
  <style>
590
  ''' + BASE_STYLE + '''
591
  h1 {
592
+ font-size: 2.5em;
593
+ font-weight: 800;
594
+ margin-bottom: 35px;
595
+ background: linear-gradient(135deg, var(--primary), var(--accent));
596
  -webkit-background-clip: text;
597
  color: transparent;
598
  }
599
  .search-container {
600
+ max-width: 700px;
601
+ margin: 0 auto 35px;
602
  position: relative;
603
  }
604
  .search-input {
605
+ padding-right: 50px;
606
  background: var(--card-bg-light);
607
+ border-radius: 12px;
608
  box-shadow: var(--shadow);
609
  }
610
  body.dark .search-input {
 
616
  top: 50%;
617
  transform: translateY(-50%);
618
  background: var(--primary);
619
+ padding: 8px 16px;
620
+ border-radius: 10px;
 
621
  box-shadow: none;
622
  }
623
  .search-btn:hover {
624
  background: #e65b5b;
625
  }
626
+ .post-grid {
627
+ display: grid;
628
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
629
+ gap: 25px;
630
  }
631
  .post-item {
632
  background: var(--card-bg-light);
633
+ backdrop-filter: blur(15px);
634
+ padding: 20px;
635
  border-radius: 20px;
 
636
  box-shadow: var(--shadow);
637
  transition: var(--transition);
638
+ text-decoration: none;
639
  color: var(--text-light);
 
 
640
  }
641
  body.dark .post-item {
642
  background: var(--card-bg-dark);
643
  color: var(--text-dark);
644
  }
645
  .post-item:hover {
646
+ transform: translateY(-10px) scale(1.02);
647
+ box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
648
  }
649
  .post-preview {
650
  width: 100%;
651
+ height: 220px;
652
+ object-fit: cover;
653
  border-radius: 15px;
654
+ margin-bottom: 15px;
655
  transition: var(--transition);
656
  }
 
 
 
 
 
 
657
  .post-item h2 {
658
+ font-size: 1.4em;
659
  font-weight: 600;
660
+ margin-bottom: 10px;
 
 
 
661
  }
662
  .post-item p {
663
+ font-size: 1em;
664
+ margin-bottom: 10px;
665
  }
666
+ .stats {
667
+ font-size: 0.9em;
668
+ color: rgba(0, 0, 0, 0.6);
 
 
 
669
  }
670
+ body.dark .stats {
671
+ color: rgba(255, 255, 255, 0.6);
672
  }
673
  .username-link {
674
  color: var(--primary);
675
+ font-weight: 600;
676
  text-decoration: none;
677
  }
678
  .username-link:hover {
679
+ color: var(--accent);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  }
681
  </style>
682
  </head>
 
689
  <div class="search-container">
690
  <form method="POST">
691
  <input type="text" name="search" class="search-input" placeholder="Search by title or description" value="{{ search_query }}">
692
+ <button type="submit" class="search-btn">🔍</button>
693
  </form>
694
  </div>
695
+ <div class="post-grid">
696
  {% for post in posts %}
697
+ <a href="{{ url_for('post_page', post_id=post['id']) }}" class="post-item">
698
+ {% if post['type'] == 'video' %}
699
+ <video class="post-preview" preload="metadata" muted>
700
+ <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
701
+ </video>
702
+ {% else %}
703
+ <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}" onclick="openModal(this.src, event, '{{ post['id'] }}')">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  {% endif %}
705
+ <h2>{{ post['title'] }}</h2>
706
+ <p>{{ post['description'] }}</p>
707
+ <p>By: <a href="{{ url_for('user_profile', username=post['uploader']) }}" class="username-link">{{ post['uploader'] }}</a> | {{ post['upload_date'] }}</p>
708
+ <p class="stats">Views: {{ post['views'] }} | Likes: {{ post['likes']|length }}</p>
709
+ </a>
710
  {% endfor %}
711
  </div>
712
  </div>
 
785
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
786
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
787
  <title>{{ post['title'] }} - Content Hub</title>
788
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
789
  <style>
790
  ''' + BASE_STYLE + '''
791
  .container {
792
+ max-width: 900px;
793
  background: var(--card-bg-light);
794
+ backdrop-filter: blur(15px);
795
+ padding: 40px;
796
+ border-radius: 20px;
797
  box-shadow: var(--shadow);
798
  }
799
  body.dark .container {
800
  background: var(--card-bg-dark);
801
  }
802
  h1 {
803
+ font-size: 2.2em;
804
+ font-weight: 800;
805
+ margin-bottom: 25px;
806
+ background: linear-gradient(135deg, var(--primary), var(--accent));
807
  -webkit-background-clip: text;
808
  color: transparent;
809
  }
810
  video, img {
811
  width: 100%;
812
+ max-height: 480px;
813
  object-fit: cover;
814
  border-radius: 15px;
815
  box-shadow: var(--shadow);
816
+ margin-bottom: 25px;
817
  }
818
  p {
819
+ font-size: 1.1em;
820
+ margin-bottom: 15px;
821
  }
822
  .like-btn.liked {
823
  background: var(--secondary);
824
  }
825
  .like-btn.liked:hover {
826
+ background: #3db8b0;
827
  }
828
  .comment-section {
829
+ margin-top: 35px;
830
  }
831
  .comment {
832
  background: var(--glass-bg);
833
+ padding: 15px;
834
+ border-radius: 12px;
835
+ margin-bottom: 15px;
836
+ font-size: 1em;
837
  }
838
  .username-link {
839
  color: var(--primary);
 
841
  text-decoration: none;
842
  }
843
  .username-link:hover {
844
+ color: var(--accent);
845
  }
846
  </style>
847
  </head>
 
859
  <img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}" onclick="openModal(this.src)">
860
  {% endif %}
861
  <p>{{ post['description'] }}</p>
862
+ <p>By: <a href="{{ url_for('user_profile', username=post['uploader']) }}" class="username-link">{{ post['uploader'] }}</a> | {{ post['upload_date'] }}</p>
863
  <p>Views: {{ post['views'] }} | Likes: {{ post['likes']|length }}</p>
864
  {% if is_authenticated %}
865
  <form method="POST" style="display: inline;">
 
868
  </button>
869
  </form>
870
  <form method="POST" class="comment-section">
871
+ <textarea name="comment" placeholder="Leave a comment" rows="3"></textarea>
872
  <button type="submit" class="btn">Submit</button>
873
  </form>
874
  {% endif %}
875
+ <h3 style="margin-top: 35px; font-size: 1.6em;">Comments</h3>
876
  {% for comment in post.get('comments', []) %}
877
  <div class="comment">
878
  <p><strong><a href="{{ url_for('user_profile', username=comment['user']) }}" class="username-link">{{ comment['user'] }}</a></strong> ({{ comment['date'] }}): {{ comment['text'] }}</p>
 
880
  {% endfor %}
881
  <a href="{{ url_for('feed') }}" class="btn">Back to Feed</a>
882
  {% if not is_authenticated %}
883
+ <p style="margin-top: 15px;"><a href="{{ url_for('login') }}">Login</a> to like and comment.</p>
884
  {% endif %}
885
  </div>
886
  <div class="modal" id="imageModal" onclick="closeModal(event)">
 
934
  avatar = user_data.get('avatar', None)
935
 
936
  if request.method == 'POST':
937
+ if 'delete_post' in request.form:
938
  post_id = request.form.get('post_id')
939
  if post_id:
940
+ data['posts'] = [p for p in data['posts'] if p['id'] != post_id or p['uploader'] != username]
941
  save_data(data)
 
942
  return redirect(url_for('profile'))
943
+ elif 'update_profile' in request.form:
944
  bio = request.form.get('bio', '')
945
  link = request.form.get('link', '')
946
  avatar_file = request.files.get('avatar')
 
965
  data['users'][username]['bio'] = bio
966
  data['users'][username]['link'] = link
967
  save_data(data)
 
968
  return redirect(url_for('profile'))
969
 
970
  html = '''
 
975
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
976
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
977
  <title>Profile - {{ username }} - Content Hub</title>
978
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
979
  <style>
980
  ''' + BASE_STYLE + '''
981
  .container {
982
+ max-width: 900px;
983
  }
984
  .profile-header {
985
  display: flex;
986
  align-items: center;
987
+ gap: 25px;
988
  background: var(--card-bg-light);
989
+ backdrop-filter: blur(15px);
990
+ padding: 35px;
991
+ border-radius: 20px;
992
  box-shadow: var(--shadow);
993
+ margin-bottom: 35px;
994
  }
995
  body.dark .profile-header {
996
  background: var(--card-bg-dark);
997
  }
998
  .avatar {
999
+ width: 120px;
1000
+ height: 120px;
1001
  border-radius: 50%;
1002
  object-fit: cover;
1003
  box-shadow: var(--shadow);
1004
+ transition: var(--transition);
1005
+ }
1006
+ .avatar:hover {
1007
+ transform: scale(1.05);
1008
  }
1009
  .profile-info h1 {
1010
+ font-size: 2.2em;
1011
+ font-weight: 800;
1012
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1013
  -webkit-background-clip: text;
1014
  color: transparent;
1015
+ margin-bottom: 15px;
1016
  }
1017
  .profile-info p {
1018
+ font-size: 1.1em;
1019
+ margin-bottom: 10px;
1020
  }
1021
  .post-grid {
1022
  display: grid;
1023
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
1024
  gap: 25px;
1025
  }
1026
  .post-item {
 
 
1027
  background: var(--card-bg-light);
1028
+ backdrop-filter: blur(15px);
1029
+ padding: 20px;
1030
+ border-radius: 20px;
1031
  box-shadow: var(--shadow);
1032
  transition: var(--transition);
1033
  }
 
1035
  background: var(--card-bg-dark);
1036
  }
1037
  .post-item:hover {
1038
+ transform: translateY(-10px);
 
1039
  }
1040
  .post-preview {
1041
  width: 100%;
1042
+ height: 220px;
1043
  object-fit: cover;
1044
+ border-radius: 15px;
1045
+ margin-bottom: 15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1046
  }
1047
  .post-item h3 {
1048
+ font-size: 1.4em;
1049
  font-weight: 600;
1050
+ margin-bottom: 10px;
 
 
 
1051
  }
1052
  .delete-btn {
1053
  background: var(--secondary);
 
 
 
 
1054
  }
1055
  .delete-btn:hover {
1056
+ background: #3db8b0;
1057
  }
1058
  .share-btn {
1059
+ background: var(--accent);
1060
  }
1061
  .share-btn:hover {
1062
+ background: #9567e0;
1063
  }
1064
  h2 {
1065
+ font-size: 1.8em;
1066
+ font-weight: 800;
1067
+ margin: 35px 0 20px;
1068
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1069
  -webkit-background-clip: text;
1070
  color: transparent;
1071
  }
 
 
 
 
 
 
 
1072
  </style>
1073
  </head>
1074
  <body>
 
1084
  <h1>{{ username }}</h1>
1085
  <p>{{ bio }}</p>
1086
  {% if link %}
1087
+ <p><a href="{{ link }}" target="_blank" style="color: var(--primary);">{{ link }}</a></p>
1088
  {% endif %}
1089
  <p>Views: {{ total_views }} | Likes: {{ total_likes }}</p>
1090
  <button class="btn share-btn" onclick="copyProfileLink()">Share</button>
1091
  </div>
1092
  </div>
 
 
 
 
 
 
 
1093
  <h2>Edit Profile</h2>
1094
  <form method="POST" enctype="multipart/form-data">
1095
+ <textarea name="bio" placeholder="Profile Bio" rows="3">{{ bio }}</textarea>
1096
  <input type="text" name="link" placeholder="Link" value="{{ link }}">
1097
  <input type="file" name="avatar" accept="image/*">
1098
+ <button type="submit" name="update_profile" class="btn">Save</button>
 
1099
  </form>
1100
  <a href="{{ url_for('upload') }}" class="btn">Add Post</a>
1101
  <h2>Your Posts</h2>
 
1109
  <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
1110
  </video>
1111
  {% else %}
1112
+ <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}" onclick="openModal(this.src, event, '{{ post['id'] }}')">
1113
  {% endif %}
1114
+ <h3>{{ post['title'] }}</h3>
 
 
1115
  </a>
1116
+ <p>{{ post['description'] }}</p>
1117
+ <p>{{ post['upload_date'] }}</p>
1118
+ <form method="POST">
1119
  <input type="hidden" name="post_id" value="{{ post['id'] }}">
1120
+ <button type="submit" name="delete_post" class="btn delete-btn">Delete</button>
 
1121
  </form>
1122
  </div>
1123
  {% endfor %}
1124
  {% else %}
1125
+ <p style="font-size: 1.1em;">You haven't uploaded any posts yet.</p>
1126
  {% endif %}
1127
  </div>
1128
  </div>
 
1196
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1197
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1198
  <title>Profile - {{ username }} - Content Hub</title>
1199
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
1200
  <style>
1201
  ''' + BASE_STYLE + '''
1202
  .container {
1203
+ max-width: 900px;
1204
  }
1205
  .profile-header {
1206
  display: flex;
1207
  align-items: center;
1208
+ gap: 25px;
1209
  background: var(--card-bg-light);
1210
+ backdrop-filter: blur(15px);
1211
+ padding: 35px;
1212
+ border-radius: 20px;
1213
  box-shadow: var(--shadow);
1214
+ margin-bottom: 35px;
1215
  }
1216
  body.dark .profile-header {
1217
  background: var(--card-bg-dark);
1218
  }
1219
  .avatar {
1220
+ width: 120px;
1221
+ height: 120px;
1222
  border-radius: 50%;
1223
  object-fit: cover;
1224
  box-shadow: var(--shadow);
1225
+ transition: var(--transition);
1226
+ }
1227
+ .avatar:hover {
1228
+ transform: scale(1.05);
1229
  }
1230
  .profile-info h1 {
1231
+ font-size: 2.2em;
1232
+ font-weight: 800;
1233
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1234
  -webkit-background-clip: text;
1235
  color: transparent;
1236
+ margin-bottom: 15px;
1237
  }
1238
  .profile-info p {
1239
+ font-size: 1.1em;
1240
+ margin-bottom: 10px;
1241
  }
1242
  .post-grid {
1243
  display: grid;
1244
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
1245
  gap: 25px;
1246
  }
1247
  .post-item {
 
 
1248
  background: var(--card-bg-light);
1249
+ backdrop-filter: blur(15px);
1250
+ padding: 20px;
1251
+ border-radius: 20px;
1252
  box-shadow: var(--shadow);
1253
  transition: var(--transition);
1254
  }
 
1256
  background: var(--card-bg-dark);
1257
  }
1258
  .post-item:hover {
1259
+ transform: translateY(-10px);
 
1260
  }
1261
  .post-preview {
1262
  width: 100%;
1263
+ height: 220px;
1264
  object-fit: cover;
1265
+ border-radius: 15px;
1266
+ margin-bottom: 15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1267
  }
1268
  .post-item h3 {
1269
+ font-size: 1.4em;
1270
  font-weight: 600;
1271
+ margin-bottom: 10px;
 
 
 
1272
  }
1273
  .share-btn {
1274
+ background: var(--accent);
1275
  }
1276
  .share-btn:hover {
1277
+ background: #9567e0;
1278
  }
1279
  h2 {
1280
+ font-size: 1.8em;
1281
+ font-weight: 800;
1282
+ margin: 35px 0 20px;
1283
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1284
  -webkit-background-clip: text;
1285
  color: transparent;
1286
  }
 
1299
  <h1>{{ username }}</h1>
1300
  <p>{{ bio }}</p>
1301
  {% if link %}
1302
+ <p><a href="{{ link }}" target="_blank" style="color: var(--primary);">{{ link }}</a></p>
1303
  {% endif %}
1304
  <p>Views: {{ total_views }} | Likes: {{ total_likes }}</p>
1305
  <button class="btn share-btn" onclick="copyProfileLink()">Share</button>
 
1316
  <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
1317
  </video>
1318
  {% else %}
1319
+ <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}" onclick="openModal(this.src, event, '{{ post['id'] }}')">
1320
  {% endif %}
1321
+ <h3>{{ post['title'] }}</h3>
 
 
1322
  </a>
1323
+ <p>{{ post['description'] }}</p>
1324
+ <p>{{ post['upload_date'] }}</p>
1325
  </div>
1326
  {% endfor %}
1327
  {% else %}
1328
+ <p style="font-size: 1.1em;">This user hasn't uploaded any posts yet.</p>
1329
  {% endif %}
1330
  </div>
1331
  </div>
 
1389
  uploader = session['username']
1390
 
1391
  if not title or not file:
1392
+ return "Please provide a title and select a file", 400
 
1393
 
1394
  filename = secure_filename(file.filename)
1395
  temp_path = os.path.join('uploads', filename)
 
1427
 
1428
  if os.path.exists(temp_path):
1429
  os.remove(temp_path)
 
1430
  return redirect(url_for('profile'))
1431
 
1432
  is_authenticated = 'username' in session
 
1439
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1440
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1441
  <title>Upload Content - Content Hub</title>
1442
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
1443
  <style>
1444
  ''' + BASE_STYLE + '''
1445
  .container {
1446
+ max-width: 600px;
1447
  background: var(--card-bg-light);
1448
+ backdrop-filter: blur(15px);
1449
+ padding: 40px;
1450
+ border-radius: 20px;
1451
  box-shadow: var(--shadow);
1452
  }
1453
  body.dark .container {
1454
  background: var(--card-bg-dark);
1455
  }
1456
  h1 {
1457
+ font-size: 2em;
1458
+ font-weight: 800;
1459
  text-align: center;
1460
+ margin-bottom: 25px;
1461
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1462
  -webkit-background-clip: text;
1463
  color: transparent;
1464
  }
1465
  #progress-container {
1466
+ margin-top: 15px;
1467
+ height: 8px;
1468
  background: rgba(0, 0, 0, 0.1);
1469
+ border-radius: 4px;
1470
  overflow: hidden;
1471
  }
1472
  body.dark #progress-container {
 
1475
  #progress-bar {
1476
  width: 0%;
1477
  height: 100%;
1478
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1479
+ transition: width 0.5s ease;
 
 
 
 
 
 
 
1480
  }
1481
  </style>
1482
  </head>
 
1486
  <button class="theme-toggle" onclick="toggleTheme()">🌙</button>
1487
  <div class="container">
1488
  <h1>Upload Content</h1>
 
 
 
 
 
 
 
1489
  <form id="upload-form" enctype="multipart/form-data">
1490
  <input type="text" name="title" placeholder="Title" required>
1491
+ <textarea name="description" placeholder="Description" rows="4"></textarea>
1492
  <input type="file" name="file" accept="video/*,image/*" required>
1493
  <button type="submit" class="btn">Upload</button>
1494
  </form>
 
1534
  '''
1535
  return render_template_string(html, username=username, is_authenticated=is_authenticated)
1536
 
1537
+ # General Chat with Enhanced Styles
1538
  @app.route('/chat', methods=['GET', 'POST'])
1539
  def chat():
1540
  data = load_data()
1541
  is_authenticated = 'username' in session
1542
  username = session.get('username', None)
1543
  chat_messages = data['general_chat']
 
1544
 
1545
  if request.method == 'POST' and is_authenticated:
1546
+ message = request.form.get('message')
1547
+ file = request.files.get('file')
1548
+ post_id = request.form.get('post_id')
 
1549
 
1550
+ message_data = {
1551
+ 'sender': username,
1552
+ 'time': datetime.now().strftime('%Y-%m-%d %H:%M:%S')
1553
+ }
1554
+
1555
+ if message:
1556
+ message_data['text'] = message
1557
+
1558
+ if file and file.filename:
1559
+ filename = secure_filename(file.filename)
1560
+ temp_path = os.path.join('uploads', filename)
1561
+ os.makedirs('uploads', exist_ok=True)
1562
+ file.save(temp_path)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1563
 
1564
+ file_type = 'video' if filename.lower().endswith(('.mp4', '.mov', '.avi')) else 'photo'
1565
+ api = HfApi()
1566
+ file_path = f"chat_files/general/{filename}"
1567
+ api.upload_file(
1568
+ path_or_fileobj=temp_path,
1569
+ path_in_repo=file_path,
1570
+ repo_id=REPO_ID,
1571
+ repo_type="dataset",
1572
+ token=HF_TOKEN_WRITE,
1573
+ commit_message=f"Uploaded chat file by {username}"
1574
+ )
1575
+ message_data['file'] = file_path
1576
+ message_data['file_type'] = file_type
1577
+ if os.path.exists(temp_path):
1578
+ os.remove(temp_path)
1579
+
1580
+ if post_id:
1581
+ post = next((p for p in data['posts'] if p['id'] == post_id and p['uploader'] == username), None)
1582
+ if post:
1583
+ message_data['post_id'] = post_id
1584
 
1585
+ if 'text' in message_data or 'file' in message_data or 'post_id' in message_data:
1586
+ data['general_chat'].append(message_data)
 
1587
  save_data(data)
1588
 
1589
  return redirect(url_for('chat'))
 
1596
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1597
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1598
  <title>General Chat - Content Hub</title>
1599
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
1600
  <style>
1601
  ''' + BASE_STYLE + '''
1602
  .container {
1603
+ max-width: 900px;
1604
  background: var(--card-bg-light);
1605
+ backdrop-filter: blur(15px);
1606
+ padding: 40px;
1607
+ border-radius: 20px;
1608
  box-shadow: var(--shadow);
1609
  }
1610
  body.dark .container {
1611
  background: var(--card-bg-dark);
1612
  }
1613
  h1 {
1614
+ font-size: 2.2em;
1615
+ font-weight: 800;
1616
+ margin-bottom: 25px;
1617
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1618
  -webkit-background-clip: text;
1619
  color: transparent;
1620
  }
1621
+ .messages {
1622
  max-height: 500px;
1623
  overflow-y: auto;
1624
+ padding: 15px;
 
 
1625
  background: var(--glass-bg);
1626
+ border-radius: 15px;
1627
+ margin-bottom: 20px;
1628
+ scroll-behavior: smooth;
1629
  }
1630
  .message {
1631
+ padding: 12px 18px;
1632
+ background: var(--card-bg-light);
1633
+ border-radius: 12px;
1634
+ margin-bottom: 12px;
1635
+ font-size: 1em;
1636
+ transition: var(--transition);
 
 
1637
  }
1638
  body.dark .message {
1639
+ background: var(--card-bg-dark);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1640
  }
1641
+ .message:hover {
1642
+ transform: translateY(-2px);
1643
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
 
 
1644
  }
1645
+ .message .sender {
 
1646
  color: var(--primary);
1647
+ font-weight: 600;
1648
  text-decoration: none;
1649
+ cursor: pointer;
1650
  }
1651
+ .message .sender:hover {
1652
+ color: var(--accent);
1653
  }
1654
+ .message .time {
1655
+ font-size: 0.85em;
1656
  color: rgba(0, 0, 0, 0.6);
1657
+ margin-left: 10px;
1658
  }
1659
+ body.dark .message .time {
1660
  color: rgba(255, 255, 255, 0.6);
1661
  }
 
 
 
 
 
 
 
 
 
 
 
1662
  .message img, .message video {
1663
+ max-width: 280px;
1664
+ max-height: 280px;
1665
  border-radius: 10px;
1666
  margin-top: 10px;
1667
+ display: block;
1668
  }
1669
  .message a {
1670
+ color: var(--primary);
1671
  text-decoration: none;
 
1672
  }
1673
  .message a:hover {
1674
+ color: var(--accent);
1675
  }
1676
  .message-form {
1677
  margin-top: 20px;
1678
+ display: flex;
1679
+ flex-direction: column;
1680
+ gap: 12px;
1681
+ }
1682
+ .post-select {
1683
+ padding: 12px;
1684
+ border-radius: 12px;
1685
  background: var(--glass-bg);
1686
+ color: var(--text-light);
1687
+ }
1688
+ body.dark .post-select {
1689
+ color: var(--text-dark);
1690
  }
1691
  </style>
1692
  </head>
 
1696
  <button class="theme-toggle" onclick="toggleTheme()">🌙</button>
1697
  <div class="container">
1698
  <h1>General Chat</h1>
1699
+ <div class="messages" id="messages">
1700
  {% for message in chat_messages %}
1701
  <div class="message">
1702
+ <a href="{{ url_for('user_profile', username=message['sender']) }}" class="sender">{{ message['sender'] }}</a>
1703
+ <span class="time">({{ message['time'] }})</span>:
1704
+ {% if 'text' in message %}
1705
+ <p>{{ message['text'] }}</p>
 
1706
  {% endif %}
1707
+ {% if 'file' in message %}
1708
+ {% if message['file_type'] == 'video' %}
1709
+ <video controls>
1710
+ <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ message['file'] }}" type="video/mp4">
1711
+ </video>
1712
+ {% else %}
1713
+ <img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ message['file'] }}" alt="Chat file" onclick="openModal(this.src)">
 
 
 
 
 
 
1714
  {% endif %}
1715
+ {% endif %}
1716
+ {% if 'post_id' in message %}
1717
+ {% with post = posts|selectattr('id', 'equalto', message['post_id'])|first %}
1718
+ {% if post %}
1719
+ <p>Shared: <a href="{{ url_for('post_page', post_id=message['post_id']) }}">{{ post['title'] }}</a></p>
 
 
1720
  {% endif %}
1721
+ {% endwith %}
1722
+ {% endif %}
 
 
 
 
 
 
 
1723
  </div>
1724
  {% endfor %}
1725
  </div>
1726
  {% if is_authenticated %}
1727
  <form method="POST" enctype="multipart/form-data" class="message-form">
1728
+ <textarea name="message" placeholder="Type a message" rows="2"></textarea>
1729
  <input type="file" name="file" accept="video/*,image/*">
1730
  <select name="post_id" class="post-select">
1731
  <option value="">Share a post (optional)</option>
 
1733
  <option value="{{ post['id'] }}">{{ post['title'] }}</option>
1734
  {% endfor %}
1735
  </select>
1736
+ <button type="submit" class="btn">Send</button>
1737
  </form>
1738
  {% else %}
1739
+ <p style="margin-top: 15px;"><a href="{{ url_for('login') }}">Login</a> to send messages.</p>
1740
  {% endif %}
1741
  </div>
1742
  <div class="modal" id="imageModal" onclick="closeModal(event)">
 
1763
  }
1764
  window.onload = () => {
1765
  if (localStorage.getItem('theme') === 'dark') document.body.classList.add('dark');
1766
+ const messagesDiv = document.getElementById('messages');
1767
+ messagesDiv.scrollTop = messagesDiv.scrollHeight;
1768
  };
1769
  </script>
1770
  </body>
 
1773
  user_posts = [p for p in data['posts'] if p['uploader'] == username] if is_authenticated else []
1774
  return render_template_string(html,
1775
  chat_messages=chat_messages,
1776
+ username=username,
1777
  is_authenticated=is_authenticated,
 
1778
  repo_id=REPO_ID,
1779
  posts=data['posts'],
1780
+ user_posts=user_posts)
 
1781
 
1782
  # Admin panel
1783
  @app.route('/admhosto', methods=['GET', 'POST'])
1784
  def admin_panel():
 
 
 
 
1785
  data = load_data()
1786
  posts = sorted(data.get('posts', []), key=lambda x: datetime.strptime(x['upload_date'], '%Y-%m-%d %H:%M:%S'), reverse=True)
1787
  is_authenticated = 'username' in session
1788
  username = session.get('username', None)
1789
 
1790
+ search_query = request.form.get('search', '').strip().lower() if request.method == 'POST' and 'search' in request.form else request.args.get('search', '').strip().lower()
1791
+ if search_query:
1792
+ posts = [post for post in posts if search_query in post['title'].lower() or search_query in post['description'].lower()]
1793
+
1794
+ if request.method == 'POST' and 'delete' in request.form:
1795
+ post_id = request.form.get('post_id')
1796
+ if post_id:
1797
+ data['posts'] = [p for p in data['posts'] if p['id'] != post_id]
1798
+ save_data(data)
1799
+ return redirect(url_for('admin_panel'))
 
 
 
 
 
1800
 
1801
  html = '''
1802
  <!DOCTYPE html>
 
1806
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1807
  <meta name="keywords" content="interracial porn, bbc porn, qos, queen of spades, big black cock">
1808
  <title>Admin Panel - Content Hub</title>
1809
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
1810
  <style>
1811
  ''' + BASE_STYLE + '''
1812
  h1 {
1813
+ font-size: 2.5em;
1814
+ font-weight: 800;
1815
+ margin-bottom: 35px;
1816
+ background: linear-gradient(135deg, var(--primary), var(--accent));
1817
  -webkit-background-clip: text;
1818
  color: transparent;
1819
  }
1820
  .search-container {
1821
+ max-width: 700px;
1822
+ margin: 0 auto 35px;
1823
  position: relative;
1824
  }
1825
  .search-input {
1826
+ padding-right: 50px;
1827
  background: var(--card-bg-light);
1828
+ border-radius: 12px;
1829
  box-shadow: var(--shadow);
1830
  }
1831
  body.dark .search-input {
 
1837
  top: 50%;
1838
  transform: translateY(-50%);
1839
  background: var(--primary);
1840
+ padding: 8px 16px;
1841
+ border-radius: 10px;
 
1842
  box-shadow: none;
1843
  }
1844
  .search-btn:hover {
 
1846
  }
1847
  .post-grid {
1848
  display: grid;
1849
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
1850
  gap: 25px;
1851
  }
1852
  .post-item {
 
 
1853
  background: var(--card-bg-light);
1854
+ backdrop-filter: blur(15px);
1855
+ padding: 20px;
1856
+ border-radius: 20px;
1857
  box-shadow: var(--shadow);
1858
  transition: var(--transition);
1859
  }
 
1861
  background: var(--card-bg-dark);
1862
  }
1863
  .post-item:hover {
1864
+ transform: translateY(-10px);
 
1865
  }
1866
  .post-preview {
1867
  width: 100%;
1868
+ height: 220px;
1869
  object-fit: cover;
1870
+ border-radius: 15px;
1871
+ margin-bottom: 15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1872
  }
1873
  .post-item h2 {
1874
+ font-size: 1.4em;
1875
  font-weight: 600;
1876
+ margin-bottom: 10px;
1877
+ }
1878
+ .post-item p {
1879
+ font-size: 1em;
1880
+ margin-bottom: 10px;
1881
  }
1882
  .delete-btn {
1883
  background: var(--secondary);
 
 
 
 
1884
  }
1885
  .delete-btn:hover {
1886
+ background: #3db8b0;
1887
  }
1888
  .username-link {
1889
+ color: var(--primary);
1890
+ font-weight: 600;
1891
  text-decoration: none;
1892
  }
1893
  .username-link:hover {
1894
+ color: var(--accent);
 
 
 
 
 
 
 
 
 
 
 
 
1895
  }
1896
  </style>
1897
  </head>
 
1901
  <button class="theme-toggle" onclick="toggleTheme()">🌙</button>
1902
  <div class="container">
1903
  <h1>Admin Panel: All Posts</h1>
 
 
 
 
 
 
 
1904
  <div class="search-container">
1905
  <form method="POST">
1906
  <input type="text" name="search" class="search-input" placeholder="Search by title or description" value="{{ search_query }}">
1907
+ <button type="submit" class="search-btn">🔍</button>
 
1908
  </form>
1909
  </div>
1910
  <div class="post-grid">
 
1917
  <source src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" type="video/mp4">
1918
  </video>
1919
  {% else %}
1920
+ <img class="post-preview" src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/{{ post['type'] }}s/{{ post['filename'] }}" alt="{{ post['title'] }}" onclick="openModal(this.src, event, '{{ post['id'] }}')">
1921
  {% endif %}
1922
+ <h2>{{ post['title'] }}</h2>
 
 
 
 
 
 
1923
  </a>
1924
+ <p>{{ post['description'] }}</p>
1925
+ <p>By: <a href="{{ url_for('user_profile', username=post['uploader']) }}" class="username-link">{{ post['uploader'] }}</a> | {{ post['upload_date'] }}</p>
1926
+ <form method="POST">
1927
  <input type="hidden" name="post_id" value="{{ post['id'] }}">
1928
+ <button type="submit" name="delete" class="btn delete-btn">Delete</button>
 
1929
  </form>
1930
  </div>
1931
  {% endfor %}
1932
  {% else %}
1933
+ <p style="font-size: 1.1em;">No posts found.</p>
1934
  {% endif %}
1935
  </div>
1936
  </div>