mirror of
https://github.com/Viren070/MediaFusion.git
synced 2025-12-01 23:21:11 +01:00
fix: handle missing infoHash and improve annotation request check
This commit is contained in:
@@ -75,7 +75,7 @@ class MediafusionScraper(StremioScraper):
|
||||
source = stream["name"].split()[0].title()
|
||||
info_hash = stream.get("infoHash")
|
||||
if not info_hash:
|
||||
url = stream["url"]
|
||||
url = stream.get("url")
|
||||
if "/stream/" not in url:
|
||||
return {}, False
|
||||
info_hash = url.split("/")[6]
|
||||
|
||||
@@ -268,9 +268,10 @@ async def update_torrent_streams_metadata(
|
||||
Returns True if update was successful, False if annotation was requested.
|
||||
"""
|
||||
# Check if annotation was recently requested
|
||||
if torrent_stream.annotation_requested_at and datetime.now(
|
||||
tz=timezone.utc
|
||||
) - torrent_stream.annotation_requested_at < timedelta(days=7):
|
||||
if (
|
||||
torrent_stream.annotation_requested_at
|
||||
and datetime.now() - torrent_stream.annotation_requested_at < timedelta(days=7)
|
||||
):
|
||||
logger.info(
|
||||
f"Skipping metadata update for {torrent_stream.id} - "
|
||||
"recent annotation request"
|
||||
|
||||
Reference in New Issue
Block a user