mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
fixed github merge issue
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
import asyncio
|
import asyncio
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from ..downloading.download import start_client
|
|
||||||
from ..downloading.download import add_magnet
|
|
||||||
|
|
||||||
global url_uztracker
|
global url_uztracker
|
||||||
url_uztracker = "https://uztracker.net/tracker.php?nm=" # placeholder url for now
|
url_uztracker = "https://uztracker.net/tracker.php?nm=" # placeholder url for now
|
||||||
@@ -103,19 +101,3 @@ def get_magnet_link(post_url, debug):
|
|||||||
# x - check if x exists (not None/empty)
|
# x - check if x exists (not None/empty)
|
||||||
# and - if x exists, THEN check the next part
|
# and - if x exists, THEN check the next part
|
||||||
# x.startswith('magnet:') - does x start with "magnet:"?
|
# x.startswith('magnet:') - does x start with "magnet:"?
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_item_index(item, list, listlinks, debug):
|
|
||||||
position = list.index(item)
|
|
||||||
if 0 <= position < len(listlinks): # note for myself: py starts counting at 0; check if number is not negative, check if number is not more than list length.
|
|
||||||
selected = "https://uztracker.net/" + listlinks[position].lstrip("./")
|
|
||||||
post_url = selected
|
|
||||||
if debug:
|
|
||||||
print("Selected URL: ", selected)
|
|
||||||
selected_magnet = get_magnet_link(selected, debug)
|
|
||||||
start_client()
|
|
||||||
add_magnet(selected_magnet)
|
|
||||||
=======
|
|
||||||
>>>>>>> af99e99 (added rutracker as option. check full message)
|
|
||||||
|
|||||||
+4
-30
@@ -1,12 +1,13 @@
|
|||||||
from PySide6 import QtWidgets
|
from PySide6 import QtWidgets
|
||||||
from PySide6.QtCore import Qt
|
from PySide6.QtCore import Qt
|
||||||
from PySide6.QtWidgets import QLineEdit, QPushButton, QWidget, QVBoxLayout, QListWidget, QToolBar, QDialogButtonBox, QRadioButton, QGroupBox, QDialog, QVBoxLayout, QLabel, QHBoxLayout
|
from PySide6.QtWidgets import QLineEdit, QPushButton, QWidget, QVBoxLayout, QListWidget, QToolBar, QDialog, QVBoxLayout, QLabel, QHBoxLayout
|
||||||
from PySide6.QtGui import QIcon, QAction
|
from PySide6.QtGui import QIcon, QAction
|
||||||
import darkdetect
|
import darkdetect
|
||||||
import requests
|
import requests
|
||||||
from core.scraping.uztracker_scraper import scrape_uztracker
|
from core.scraping.uztracker_scraper import scrape_uztracker
|
||||||
from core.scraping.uztracker_scraper import get_item_index
|
from core.scraping.uztracker_scraper import get_magnet_link
|
||||||
|
from core.downloading.download import start_client
|
||||||
|
from core.downloading.download import add_magnet
|
||||||
|
|
||||||
def state_debug(setting):
|
def state_debug(setting):
|
||||||
global debug
|
global debug
|
||||||
@@ -115,12 +116,6 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
|
|
||||||
def download_selected(self):
|
def download_selected(self):
|
||||||
item = self.softwareList.currentItem()
|
item = self.softwareList.currentItem()
|
||||||
<<<<<<< HEAD
|
|
||||||
if item is not None:
|
|
||||||
if debug:
|
|
||||||
print(f"Downloading {self.softwareList.currentItem().text()}")
|
|
||||||
get_item_index(self.softwareList.currentItem().text(), self.postnames, self.postlinks, debug)
|
|
||||||
=======
|
|
||||||
if rutracker == True:
|
if rutracker == True:
|
||||||
if item is not None:
|
if item is not None:
|
||||||
if debug:
|
if debug:
|
||||||
@@ -129,7 +124,6 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
else:
|
else:
|
||||||
if debug:
|
if debug:
|
||||||
print("No item selected for download.")
|
print("No item selected for download.")
|
||||||
>>>>>>> af99e99 (added rutracker as option. check full message)
|
|
||||||
else:
|
else:
|
||||||
if item is not None:
|
if item is not None:
|
||||||
if debug:
|
if debug:
|
||||||
@@ -149,25 +143,6 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
|
|
||||||
|
|
||||||
def return_pressed(self):
|
def return_pressed(self):
|
||||||
<<<<<<< HEAD
|
|
||||||
search_text = self.searchbar.text()
|
|
||||||
if debug:
|
|
||||||
print("User searched for:", search_text)
|
|
||||||
|
|
||||||
response = scrape_uztracker(search_text, debug)
|
|
||||||
if response:
|
|
||||||
self.postnames, self.postlinks = response
|
|
||||||
self.softwareList.clear()
|
|
||||||
if self.postnames:
|
|
||||||
self.softwareList.addItems(self.postnames)
|
|
||||||
elif debug:
|
|
||||||
print(f"No Results found for \"{search_text}\"")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
if rutracker == True:
|
if rutracker == True:
|
||||||
global postnames
|
global postnames
|
||||||
global postlinks
|
global postlinks
|
||||||
@@ -206,4 +181,3 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
selected_magnet = get_magnet_link(selected, debug)
|
selected_magnet = get_magnet_link(selected, debug)
|
||||||
start_client()
|
start_client()
|
||||||
add_magnet(selected_magnet)
|
add_magnet(selected_magnet)
|
||||||
>>>>>>> af99e99 (added rutracker as option. check full message)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user