|
|
@ -1,4 +1,4 @@ |
|
|
|
# VERSION: 1.5 |
|
|
|
# VERSION: 1.6 |
|
|
|
# AUTHORS: imDMG [imdmgg@gmail.com] |
|
|
|
# AUTHORS: imDMG [imdmgg@gmail.com] |
|
|
|
|
|
|
|
|
|
|
|
# Rutor.org search engine plugin for qBittorrent |
|
|
|
# Rutor.org search engine plugin for qBittorrent |
|
|
@ -28,8 +28,8 @@ except ImportError: |
|
|
|
FILE = Path(__file__) |
|
|
|
FILE = Path(__file__) |
|
|
|
BASEDIR = FILE.parent.absolute() |
|
|
|
BASEDIR = FILE.parent.absolute() |
|
|
|
|
|
|
|
|
|
|
|
FILENAME = FILE.name[:-3] |
|
|
|
FILENAME = FILE.stem |
|
|
|
FILE_J, FILE_C = [BASEDIR / (FILENAME + fl) for fl in [".json", ".cookie"]] |
|
|
|
FILE_J, FILE_C = [BASEDIR / (FILENAME + fl) for fl in (".json", ".cookie")] |
|
|
|
|
|
|
|
|
|
|
|
PAGES = 100 |
|
|
|
PAGES = 100 |
|
|
|
|
|
|
|
|
|
|
@ -39,8 +39,9 @@ def rng(t: int) -> range: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RE_TORRENTS = re.compile( |
|
|
|
RE_TORRENTS = re.compile( |
|
|
|
r'(?:gai|tum)"><td>(.+?)</td.+?href="/(torrent/(\d+).+?)">(.+?)</a.+?right"' |
|
|
|
r'(?:gai|tum)"><td>(.+?)</td.+?href="(magnet:.+?)".+?href="/' |
|
|
|
r'>([.\d]+ \w+)</td.+?alt="S"\s/>(.+?)</s.+?red">(.+?)</s', re.S |
|
|
|
r'(torrent/(\d+).+?)">(.+?)</a.+?right">([.\d]+? \w+?)</td.+?alt="S"\s' |
|
|
|
|
|
|
|
r'/>(.+?)</s.+?red">(.+?)</s', re.S |
|
|
|
) |
|
|
|
) |
|
|
|
RE_RESULTS = re.compile(r"</b>\sРезультатов\sпоиска\s(\d{1,4})\s", re.S) |
|
|
|
RE_RESULTS = re.compile(r"</b>\sРезультатов\sпоиска\s(\d{1,4})\s", re.S) |
|
|
|
PATTERNS = ("%ssearch/%i/%i/000/0/%s",) |
|
|
|
PATTERNS = ("%ssearch/%i/%i/000/0/%s",) |
|
|
@ -80,7 +81,7 @@ class Config: |
|
|
|
# username: str = "USERNAME" |
|
|
|
# username: str = "USERNAME" |
|
|
|
# password: str = "PASSWORD" |
|
|
|
# password: str = "PASSWORD" |
|
|
|
torrent_date: bool = True |
|
|
|
torrent_date: bool = True |
|
|
|
# magnet: bool = False |
|
|
|
magnet: bool = False |
|
|
|
proxy: bool = False |
|
|
|
proxy: bool = False |
|
|
|
# dynamic_proxy: bool = True |
|
|
|
# dynamic_proxy: bool = True |
|
|
|
proxies: dict = field(default_factory=lambda: {"http": "", "https": ""}) |
|
|
|
proxies: dict = field(default_factory=lambda: {"http": "", "https": ""}) |
|
|
@ -226,12 +227,12 @@ class Rutor: |
|
|
|
|
|
|
|
|
|
|
|
prettyPrinter({ |
|
|
|
prettyPrinter({ |
|
|
|
"engine_url": self.url, |
|
|
|
"engine_url": self.url, |
|
|
|
"desc_link": self.url + tor[1], |
|
|
|
"desc_link": self.url + tor[2], |
|
|
|
"name": torrent_date + unescape(tor[3]), |
|
|
|
"name": torrent_date + unescape(tor[4]), |
|
|
|
"link": self.url_dl + tor[2], |
|
|
|
"link": tor[1] if config.magnet else self.url_dl + tor[3], |
|
|
|
"size": unescape(tor[4]), |
|
|
|
"size": unescape(tor[5]), |
|
|
|
"seeds": unescape(tor[5]), |
|
|
|
"seeds": unescape(tor[6]), |
|
|
|
"leech": unescape(tor[6]) |
|
|
|
"leech": unescape(tor[7]) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
def _request( |
|
|
|
def _request( |
|
|
|