Merge branch 'feat-steamrip-noschxl' into merge_candidate_noschxl, improve stuff (http dl impl still needed)

This commit is contained in:
Vxrtrauter
2026-03-09 23:48:41 +01:00
23 changed files with 740 additions and 459 deletions
+21 -3
View File
@@ -1,4 +1,8 @@
from core.utils.data.state import state
from core.utils.network.jsonhandler import format_data
from core.utils.data.tracker import get_magnet_link
from bs4 import BeautifulSoup
from typing import Dict
import requests
import time
@@ -31,7 +35,7 @@ def _get_telegram_posts():
for bubble in bubbles:
post_txt = bubble.find("div", class_="tgme_widget_message_text js-message_text")
if not post_txt or not post_txt.b:
if post_txt is None or post_txt.b is None:
continue
title = post_txt.b.text
@@ -42,9 +46,9 @@ def _get_telegram_posts():
if post_url not in added:
added.add(post_url)
posts.append(dict(
title=title,
author="m0nkrus",
id=len(posts) + 1,
title=title,
url=post_url
))
@@ -67,4 +71,18 @@ def scrape_m0nkrus(query):
filtered_post["id"] = len(filtered_posts) + 1
filtered_posts.append(filtered_post)
return filtered_posts
return filtered_posts
def get_magnet(post: Dict):
return get_magnet_link(post["url"])
Metadata = {
"name" : "m0nkrus",
"headers" : ["Post Title", "Author"],
"scrapeFunc" : scrape_m0nkrus,
"linkFunc" : get_magnet,
"isMagnet" : True,
}
def init_m0nkrus():
state.trackers.update({Metadata["name"] : Metadata})