Spaces:
Running
Running
Fix: add missing 'import asyncio' and fix random → _random2 in scheduler
Browse files- app_v2_entry.py +2 -1
app_v2_entry.py
CHANGED
|
@@ -21,6 +21,7 @@ from bs4 import BeautifulSoup
|
|
| 21 |
import re, html as html_lib, json, threading, time, uuid
|
| 22 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
| 23 |
from urllib.parse import quote
|
|
|
|
| 24 |
|
| 25 |
HL_LEAGUES['friendly'] = {"path": "giai-khac/friendly", "name": "Giao hữu", "emoji": "🤝"}
|
| 26 |
|
|
@@ -1378,7 +1379,7 @@ async def _auto_rewrite_one(topic, slot_label):
|
|
| 1378 |
img = images[i] if i < len(images) else (images[-1] if images else data.get('og_img', ''))
|
| 1379 |
slides.append({'text': p[:300], 'image': img, 'index': i + 1})
|
| 1380 |
|
| 1381 |
-
post_id = str(int(time.time() * 1000)) + str(
|
| 1382 |
post = {
|
| 1383 |
"id": post_id, "title": data.get('title', title)[:200],
|
| 1384 |
"text": ai_text, "img": images[0] if images else data.get('og_img', ''),
|
|
|
|
| 21 |
import re, html as html_lib, json, threading, time, uuid
|
| 22 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
| 23 |
from urllib.parse import quote
|
| 24 |
+
import asyncio
|
| 25 |
|
| 26 |
HL_LEAGUES['friendly'] = {"path": "giai-khac/friendly", "name": "Giao hữu", "emoji": "🤝"}
|
| 27 |
|
|
|
|
| 1379 |
img = images[i] if i < len(images) else (images[-1] if images else data.get('og_img', ''))
|
| 1380 |
slides.append({'text': p[:300], 'image': img, 'index': i + 1})
|
| 1381 |
|
| 1382 |
+
post_id = str(int(time.time() * 1000)) + str(_random2.randint(100, 999))
|
| 1383 |
post = {
|
| 1384 |
"id": post_id, "title": data.get('title', title)[:200],
|
| 1385 |
"text": ai_text, "img": images[0] if images else data.get('og_img', ''),
|