Reooiq commited on
Commit
a8a52c0
·
verified ·
1 Parent(s): a296638

Update bot.py

Browse files
Files changed (1) hide show
  1. bot.py +13 -3
bot.py CHANGED
@@ -39,12 +39,23 @@ def mark_album_processed(album_id):
39
  cursor.execute("INSERT OR IGNORE INTO processed_albums VALUES (?)", (album_id,))
40
  conn.commit()
41
 
42
- # --- 3. سيرفر الويب الوهمي ---
43
  class RequestHandler(BaseHTTPRequestHandler):
44
  def do_GET(self):
 
45
  self.send_response(200)
 
 
46
  self.end_headers()
47
- self.wfile.write(b"Ultimate Speed Archiver is Running 24/7!")
 
 
 
 
 
 
 
 
48
  def log_message(self, format, *args): pass
49
 
50
  def start_web_server():
@@ -172,7 +183,6 @@ async def uploader_worker():
172
  if message.photo:
173
  await app.send_photo(TARGET_CHAT, photo=file_path, caption=caption, caption_entities=entities)
174
  elif message.video:
175
- # ضمان الحفاظ على جودة الفيديو والتشغيل المباشر وعدم تحوله لصورة
176
  await app.send_video(
177
  TARGET_CHAT,
178
  video=file_path,
 
39
  cursor.execute("INSERT OR IGNORE INTO processed_albums VALUES (?)", (album_id,))
40
  conn.commit()
41
 
42
+ # --- 3. سيرفر الويب الوهمي (متوافق 100% مع UptimeRobot يدعم GET و HEAD) ---
43
  class RequestHandler(BaseHTTPRequestHandler):
44
  def do_GET(self):
45
+ body = b"Ultimate Speed Archiver is Running 24/7!"
46
  self.send_response(200)
47
+ self.send_header("Content-type", "text/html; charset=utf-8")
48
+ self.send_header("Content-Length", str(len(body)))
49
  self.end_headers()
50
+ self.wfile.write(body)
51
+
52
+ def do_HEAD(self):
53
+ body = b"Ultimate Speed Archiver is Running 24/7!"
54
+ self.send_response(200)
55
+ self.send_header("Content-type", "text/html; charset=utf-8")
56
+ self.send_header("Content-Length", str(len(body)))
57
+ self.end_headers()
58
+
59
  def log_message(self, format, *args): pass
60
 
61
  def start_web_server():
 
183
  if message.photo:
184
  await app.send_photo(TARGET_CHAT, photo=file_path, caption=caption, caption_entities=entities)
185
  elif message.video:
 
186
  await app.send_video(
187
  TARGET_CHAT,
188
  video=file_path,