weebzone commited on
Commit
b2192d0
·
1 Parent(s): ac3750f

`V-1.1.0 ✨ Update & Fixes`

Browse files

* Added Pinger module
* Fixed Google Colab Deployer Tool

Backend/__init__.py CHANGED
@@ -11,4 +11,4 @@ StartTime = time()
11
  USE_DEFAULT_ID: str = None
12
  db = Database()
13
 
14
- __version__ = "1.0.0"
 
11
  USE_DEFAULT_ID: str = None
12
  db = Database()
13
 
14
+ __version__ = "1.1.0"
Backend/__main__.py CHANGED
@@ -4,6 +4,7 @@ import logging
4
  from traceback import format_exc
5
  from pyrogram import idle
6
  from Backend import __version__, db
 
7
  from Backend.logger import LOGGER
8
  from Backend.fastapi import server
9
  from Backend.helper.pyro import restart_notification, setup_bot_commands
@@ -40,7 +41,8 @@ async def start_services():
40
  LOGGER.info('Initializing Telegram-Stremio Web Server...')
41
  await restart_notification()
42
  loop.create_task(server.serve())
43
-
 
44
  LOGGER.info("Telegram-Stremio Started Successfully!")
45
  await idle()
46
  except Exception:
 
4
  from traceback import format_exc
5
  from pyrogram import idle
6
  from Backend import __version__, db
7
+ from Backend.helper.pinger import ping
8
  from Backend.logger import LOGGER
9
  from Backend.fastapi import server
10
  from Backend.helper.pyro import restart_notification, setup_bot_commands
 
41
  LOGGER.info('Initializing Telegram-Stremio Web Server...')
42
  await restart_notification()
43
  loop.create_task(server.serve())
44
+ loop.create_task(ping())
45
+
46
  LOGGER.info("Telegram-Stremio Started Successfully!")
47
  await idle()
48
  except Exception:
Backend/helper/pinger.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import traceback
3
+ import aiohttp
4
+ from Backend.config import Telegram
5
+ from Backend.logger import LOGGER
6
+
7
+ async def ping():
8
+
9
+ sleep_time = 1200
10
+ manifest_url = f"{Telegram.BASE_URL}/stremio/manifest.json"
11
+
12
+ while True:
13
+ await asyncio.sleep(sleep_time)
14
+ try:
15
+ async with aiohttp.ClientSession(
16
+ timeout=aiohttp.ClientTimeout(total=10)
17
+ ) as session:
18
+ async with session.get(manifest_url) as resp:
19
+ LOGGER.info(f"Pinged manifest URL — Status: {resp.status}")
20
+ except asyncio.TimeoutError:
21
+ LOGGER.warning("Timeout: Could not connect to manifest URL.")
22
+ except Exception:
23
+ LOGGER.error("Ping failed:\n" + traceback.format_exc())
README.md CHANGED
@@ -293,7 +293,7 @@ Before you begin, ensure you have:
293
 
294
  Follow the instructions provided in the Google Colab Tool to deploy on Heroku.
295
 
296
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/weebzone/Colab-Tools/blob/main/telegram%20media%20server.ipynb)
297
 
298
 
299
  ## 🐳 VPS Guide
 
293
 
294
  Follow the instructions provided in the Google Colab Tool to deploy on Heroku.
295
 
296
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/weebzone/Colab-Tools/blob/main/telegram%20stremio.ipynb)
297
 
298
 
299
  ## 🐳 VPS Guide
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
  [project]
2
  name = "Telegram-Stremio"
3
- version = "1.0.0"
4
  description = "A powerful, self-hosted Telegram Stremio Media Server built with FastAPI, MongoDB, and PyroFork seamlessly integrated with Stremio for automated media streaming and discovery."
5
  readme = "README.md"
6
  requires-python = ">=3.11"
 
1
  [project]
2
  name = "Telegram-Stremio"
3
+ version = "1.1.0"
4
  description = "A powerful, self-hosted Telegram Stremio Media Server built with FastAPI, MongoDB, and PyroFork seamlessly integrated with Stremio for automated media streaming and discovery."
5
  readme = "README.md"
6
  requires-python = ">=3.11"
uv.lock CHANGED
@@ -901,7 +901,7 @@ wheels = [
901
 
902
  [[package]]
903
  name = "telegram-stremio"
904
- version = "5.0.2"
905
  source = { virtual = "." }
906
  dependencies = [
907
  { name = "aiofiles" },
 
901
 
902
  [[package]]
903
  name = "telegram-stremio"
904
+ version = "1.1.0"
905
  source = { virtual = "." }
906
  dependencies = [
907
  { name = "aiofiles" },