Skip to content

Commit

Permalink
fix: improve torrentio/mediafusion parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Nov 19, 2024
1 parent 36323ac commit 1318772
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions comet/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ async def get_torrentio(log_name: str, type: str, full_id: str):
).json()

for torrent in get_torrentio["streams"]:
title = torrent["title"]
title_full = title.split("\nπŸ‘€")[0]
tracker = title.split("βš™οΈ ")[1].split("\n")[0]
title_full = torrent["title"]
title = title_full.split("\n")[0]
tracker = title_full.split("βš™οΈ ")[1]

results.append(
{
"Title": title_full,
"Title": title,
"InfoHash": torrent["infoHash"],
"Size": None,
"Tracker": f"Torrentio|{tracker}",
Expand Down Expand Up @@ -442,8 +442,8 @@ async def get_mediafusion(log_name: str, type: str, full_id: str):

for torrent in get_mediafusion["streams"]:
title_full = torrent["description"]
title = title_full.split("\n")[0] if "\n" in title_full else title_full
tracker = title_full.split("πŸ”— ")[1] if "πŸ”—" in title_full else "Unknown"
title = title_full.split("\n")[0].replace("πŸ“‚ ", "").replace("/", "")
tracker = title_full.split("πŸ”— ")[1]

results.append(
{
Expand Down

0 comments on commit 1318772

Please sign in to comment.