mirror of
https://github.com/YGGverse/qBt_SE.git
synced 2025-02-06 20:04:31 +00:00
update rutor.py: fix search query
This commit is contained in:
parent
bf2a132208
commit
9291472621
@ -1,4 +1,4 @@
|
|||||||
# VERSION: 1.4
|
# VERSION: 1.5
|
||||||
# AUTHORS: imDMG [imdmgg@gmail.com]
|
# AUTHORS: imDMG [imdmgg@gmail.com]
|
||||||
|
|
||||||
# Rutor.org search engine plugin for qBittorrent
|
# Rutor.org search engine plugin for qBittorrent
|
||||||
@ -140,13 +140,12 @@ class Rutor:
|
|||||||
"pictures": 3,
|
"pictures": 3,
|
||||||
"books": 11}
|
"books": 11}
|
||||||
|
|
||||||
|
# error message
|
||||||
|
error: Optional[str] = None
|
||||||
|
# establish connection
|
||||||
|
session = build_opener()
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# error message
|
|
||||||
self.error = None
|
|
||||||
|
|
||||||
# establish connection
|
|
||||||
self.session = build_opener()
|
|
||||||
|
|
||||||
# add proxy handler if needed
|
# add proxy handler if needed
|
||||||
if config.proxy:
|
if config.proxy:
|
||||||
if any(config.proxies.values()):
|
if any(config.proxies.values()):
|
||||||
@ -172,8 +171,8 @@ class Rutor:
|
|||||||
return None
|
return None
|
||||||
# do async requests
|
# do async requests
|
||||||
if total > PAGES:
|
if total > PAGES:
|
||||||
query = query.replace("h/0", "h/%i")
|
query = query.replace("h/0", "h/{}")
|
||||||
qrs = [query % x for x in rng(total)]
|
qrs = [query.format(x) for x in rng(total)]
|
||||||
with ThreadPoolExecutor(len(qrs)) as executor:
|
with ThreadPoolExecutor(len(qrs)) as executor:
|
||||||
executor.map(self.searching, qrs, timeout=30)
|
executor.map(self.searching, qrs, timeout=30)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user