mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
download is in download.py, needs to move
This commit is contained in:
@@ -35,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 not post_txt is None or not post_txt.b is None:
|
||||
continue
|
||||
|
||||
title = post_txt.b.text
|
||||
@@ -75,13 +75,14 @@ def scrape_m0nkrus(query):
|
||||
|
||||
def get_magnet(post: Dict):
|
||||
_, post_links, _, _, _ = format_data([post])
|
||||
return post_links[0]
|
||||
return get_magnet_link(post_links[0])
|
||||
|
||||
Metadata = {
|
||||
"name" : "m0nkrus",
|
||||
"headers" : ["Post Title", "Author"],
|
||||
"scrapeFunc" : scrape_m0nkrus,
|
||||
""
|
||||
"linkFunc" : get_magnet,
|
||||
"isMagnet" : True,
|
||||
}
|
||||
|
||||
def init_m0nkrus():
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import requests
|
||||
import re
|
||||
from core.utils.logging.loghandler import consoleLog
|
||||
|
||||
def scrape_gofile(url):
|
||||
|
||||
@@ -18,13 +19,12 @@ def scrape_gofile(url):
|
||||
f"https://api.gofile.io/contents/{filetoken}",
|
||||
headers=headers,
|
||||
)
|
||||
try:
|
||||
|
||||
temp: dict = r.json()["data"]["children"]
|
||||
child = [key for key in temp.keys()]
|
||||
temp: dict = r.json()["data"]["children"]
|
||||
child = [key for key in temp.keys()]
|
||||
|
||||
return temp[child[0]]["link"]
|
||||
except:
|
||||
consoleLog("gofile didnt auth you, either the api has changed\n or you sent to many requests, please try again later.\n If it still doesnt work please open an issue on Github.")
|
||||
|
||||
return temp[child[0]]["link"]
|
||||
|
||||
|
||||
out = scrape_gofile("https://gofile.io/d/tvvzAD")
|
||||
print(out)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import requests
|
||||
from core.utils.data.state import state
|
||||
from core.utils.logging.logs import consoleLog
|
||||
from core.utils.data.tracker import get_magnet_link
|
||||
from core.utils.network.jsonhandler import split_data, format_data
|
||||
from typing import Dict
|
||||
|
||||
@@ -30,15 +31,15 @@ def scrape_rutracker(query):
|
||||
return []
|
||||
|
||||
|
||||
def get_magnet_link(post: Dict):
|
||||
def get_magnet(post: Dict):
|
||||
_, post_links, _, _, _ = format_data([post])
|
||||
return post_links[0]
|
||||
return get_magnet_link(post_links[0])
|
||||
|
||||
Metadata = {
|
||||
"name" : "rutracker",
|
||||
"headers" : ["Post Title", "Author", "Seeders", "Leechers"],
|
||||
"scrapeFunc" : scrape_rutracker,
|
||||
"linkFunc" : get_magnet_link,
|
||||
"linkFunc" : get_magnet,
|
||||
"isMagnet" : True,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
|
||||
import os
|
||||
from bs4 import BeautifulSoup
|
||||
from fuzzyfinder.main import fuzzyfinder
|
||||
import requests
|
||||
import re
|
||||
import time
|
||||
import webbrowser
|
||||
from typing import Generator
|
||||
from core.data.scrapers.provider.buzzheavier import scrape_buzzheavier
|
||||
from core.data.scrapers.provider.gofile import scrape_gofile
|
||||
from typing import Generator, Dict
|
||||
from core.utils.data.state import state
|
||||
from core.utils.logging.logs import consoleLog
|
||||
|
||||
@@ -94,12 +95,14 @@ def get_download_link(post: Dict):
|
||||
links = scrape_steamrip_game_downloads(url)
|
||||
best = ""
|
||||
for link in links:
|
||||
if link[0] != "h":
|
||||
if link[0] == "h":
|
||||
best = link
|
||||
break
|
||||
|
||||
if links.index(best) < 2:
|
||||
return best
|
||||
if links.index(best) == 0:
|
||||
return scrape_buzzheavier(best)
|
||||
elif links.index(best) == 1:
|
||||
return scrape_gofile(best)
|
||||
else:
|
||||
consoleLog("cant scrape this cuz of captcha... opening in the browser")
|
||||
webbrowser.open(best)
|
||||
@@ -118,6 +121,8 @@ Metadata = {
|
||||
"name" : "steamrip",
|
||||
"headers" : ["Game"],
|
||||
"scrapeFunc" : filter_steamrip,
|
||||
"linkFunc" : get_download_link,
|
||||
"isMagnet" : False,
|
||||
}
|
||||
|
||||
def init_steamrip():
|
||||
|
||||
@@ -3,6 +3,7 @@ from bs4 import BeautifulSoup
|
||||
from urllib.parse import urljoin
|
||||
from core.utils.logging.logs import consoleLog
|
||||
from core.utils.data.state import state
|
||||
from core.utils.data.tracker import get_magnet_link
|
||||
from typing import Dict
|
||||
|
||||
|
||||
@@ -39,16 +40,17 @@ def scrape_uztracker(query):
|
||||
consoleLog(f"Failed to fetch {search_url}: {e}")
|
||||
return None
|
||||
|
||||
def get_magnet(post: Dict):
|
||||
item = "https://uztracker.net/" + post["url"].lstrip("./")
|
||||
return get_magnet_link(item)
|
||||
|
||||
Metadata = {
|
||||
"name" : "uztracker",
|
||||
"headers" : ["Post Title", "Author"],
|
||||
"searchkey" : None,
|
||||
"scrapeFunc" : scrape_uztracker,
|
||||
"scrapeSearches" : True,
|
||||
"linkFunc" : get_magnet,
|
||||
"isMagnet" : True,
|
||||
}
|
||||
def get_magnet_link(post: Dict):
|
||||
item = "https://uztracker.net/" + post["url"].lstrip("./")
|
||||
return item
|
||||
|
||||
def init_uztracker():
|
||||
state.trackers.update({Metadata["name"] : Metadata})
|
||||
|
||||
Reference in New Issue
Block a user