Add configurable toggles for torrent metadata and seeders jobs

This commit is contained in:
mhdzumair
2025-01-24 23:14:36 +05:30
parent a13fb30d30
commit 3de2027861
4 changed files with 16 additions and 8 deletions
+9 -8
View File
@@ -134,14 +134,15 @@ def setup_scheduler(scheduler: AsyncIOScheduler):
},
)
scheduler.add_job(
update_torrent_seeders.send,
CronTrigger.from_crontab(settings.update_seeders_crontab),
name="update_seeders",
kwargs={
"crontab_expression": settings.update_seeders_crontab,
},
)
if not settings.disable_update_seeders:
scheduler.add_job(
update_torrent_seeders.send,
CronTrigger.from_crontab(settings.update_seeders_crontab),
name="update_seeders",
kwargs={
"crontab_expression": settings.update_seeders_crontab,
},
)
if not settings.disable_arab_torrents_scheduler:
scheduler.add_job(
+2
View File
@@ -128,6 +128,7 @@ class Settings(BaseSettings):
store_stremthru_magnet_cache: bool = False
is_scrap_from_yts: bool = True
scrape_with_aka_titles: bool = True
enable_fetching_torrent_metadata_from_p2p: bool = True
# Content Filtering
adult_content_regex_keywords: str = (
@@ -166,6 +167,7 @@ class Settings(BaseSettings):
motogp_tgx_scheduler_crontab: str = "0 5 * * *"
disable_motogp_tgx_scheduler: bool = False
update_seeders_crontab: str = "0 0 * * *"
disable_update_seeders: bool = True
arab_torrents_scheduler_crontab: str = "0 0 * * *"
disable_arab_torrents_scheduler: bool = False
wwe_tgx_scheduler_crontab: str = "10 */3 * * *"
+1
View File
@@ -127,6 +127,7 @@ These settings define the basic configuration and identity of your MediaFusion i
- **store_stremthru_magnet_cache** (default: `False`): Store StremThru magnet cache.
- **is_scrap_from_yts** (default: `True`): Enable/disable YTS scraping.
- **scrape_with_aka_titles** (default: `True`): Include alternative titles in scraping.
- **enable_fetching_torrent_metadata_from_p2p** (default: `False`): Enable fetching torrent metadata from P2P, Cautions: It may raise DMCA issues.
## Time-related Settings
+4
View File
@@ -209,6 +209,10 @@ async def info_hashes_to_torrent_metadata(
) -> list[dict]:
torrents_data = []
if not settings.enable_fetching_torrent_metadata_from_p2p:
logging.info("Fetching torrent metadata from P2P is disabled")
return torrents_data
demagnetizer = Demagnetizer()
async with acollect(
coros=[