mirror of
https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin.git
synced 2026-03-31 17:45:27 +00:00
Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e746e2a99 | ||
|
|
7d432ee39f | ||
|
|
d6822c2fe1 | ||
|
|
81e1b077d4 |
2 changed files with 73 additions and 42 deletions
73
nodes.json
73
nodes.json
|
|
@ -1,28 +1,55 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name":"YGGtracker",
|
"name":"YGGtracker",
|
||||||
"description":"YGGtracker official node",
|
"description":"YGGtracker official",
|
||||||
"url":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/",
|
"url":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/api/torrents?%s",
|
||||||
"api":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker/api/torrents?%s",
|
"categories":
|
||||||
"sensitive":null,
|
{
|
||||||
"yggdrasil":null,
|
"all":[
|
||||||
"locale":"en",
|
"movie",
|
||||||
"locales":
|
"series",
|
||||||
[
|
"tv",
|
||||||
"en",
|
"animation",
|
||||||
"cs",
|
"music",
|
||||||
"eo",
|
"game",
|
||||||
"fr",
|
"audiobook",
|
||||||
"ka",
|
"podcast",
|
||||||
"de",
|
"book",
|
||||||
"he",
|
"archive",
|
||||||
"it",
|
"picture",
|
||||||
"lv",
|
"software",
|
||||||
"pl",
|
"other"
|
||||||
"pt",
|
],
|
||||||
"ru",
|
"anime":[
|
||||||
"es",
|
"animation"
|
||||||
"uk"
|
],
|
||||||
]
|
"books":
|
||||||
|
[
|
||||||
|
"book",
|
||||||
|
"audiobook"
|
||||||
|
],
|
||||||
|
"games":[
|
||||||
|
"game"
|
||||||
|
],
|
||||||
|
"movies":[
|
||||||
|
"movie",
|
||||||
|
"series"
|
||||||
|
],
|
||||||
|
"music":[
|
||||||
|
"music"
|
||||||
|
],
|
||||||
|
"pictures":[
|
||||||
|
"picture"
|
||||||
|
],
|
||||||
|
"software":[
|
||||||
|
"software",
|
||||||
|
"archive"
|
||||||
|
],
|
||||||
|
"tv":[
|
||||||
|
"tv",
|
||||||
|
"podcast",
|
||||||
|
"series"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# VERSION: 1.00
|
# VERSION: 1.1.0
|
||||||
# LICENSE: MIT
|
# LICENSE: MIT
|
||||||
# AUTHORS: https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin
|
# AUTHORS: https://github.com/YGGverse/qbittorrent-yggtracker-search-plugin
|
||||||
|
|
||||||
|
|
@ -12,6 +12,17 @@ class yggtracker(object):
|
||||||
|
|
||||||
name = 'YGGtracker'
|
name = 'YGGtracker'
|
||||||
url = 'https://github.com/YGGverse/YGGtracker'
|
url = 'https://github.com/YGGverse/YGGtracker'
|
||||||
|
supported_categories = {
|
||||||
|
'all':[],
|
||||||
|
'anime':[],
|
||||||
|
'books':[],
|
||||||
|
'games':[],
|
||||||
|
'movies':[],
|
||||||
|
'music':[],
|
||||||
|
'pictures':[],
|
||||||
|
'software':[],
|
||||||
|
'tv':[]
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
@ -32,27 +43,20 @@ class yggtracker(object):
|
||||||
# apply query request
|
# apply query request
|
||||||
what = unquote(what)
|
what = unquote(what)
|
||||||
params = {
|
params = {
|
||||||
'query': what
|
'query': what,
|
||||||
|
'filter': 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
# apply locales filter
|
# apply categories filter
|
||||||
if len(node['locales']) > 0:
|
categories = []
|
||||||
params['locales'] = '|'.join(node['locales'])
|
for category in node['categories'][cat]:
|
||||||
|
categories.append(category)
|
||||||
|
|
||||||
# apply sensitive filter
|
if len(categories) > 0:
|
||||||
if node['sensitive'] is True:
|
params['categories'] = '|'.join(categories)
|
||||||
params['sensitive'] = '1'
|
|
||||||
if node['sensitive'] is False:
|
|
||||||
params['sensitive'] = '0'
|
|
||||||
|
|
||||||
# apply yggdrasil filter
|
|
||||||
if node['yggdrasil'] is True:
|
|
||||||
params['yggdrasil'] = '1'
|
|
||||||
if node['yggdrasil'] is False:
|
|
||||||
params['yggdrasil'] = '0'
|
|
||||||
|
|
||||||
# send api request
|
# send api request
|
||||||
response = retrieve_url(node['api'] % urlencode(params))
|
response = retrieve_url(node['url'] % urlencode(params))
|
||||||
response_json = json.loads(response)
|
response_json = json.loads(response)
|
||||||
|
|
||||||
# check empty response
|
# check empty response
|
||||||
|
|
@ -67,7 +71,7 @@ class yggtracker(object):
|
||||||
'size': str(item['torrent']['file']['size']) + " B",
|
'size': str(item['torrent']['file']['size']) + " B",
|
||||||
'seeds': item['torrent']['scrape']['seeders'],
|
'seeds': item['torrent']['scrape']['seeders'],
|
||||||
'leech': item['torrent']['scrape']['leechers'],
|
'leech': item['torrent']['scrape']['leechers'],
|
||||||
'engine_url': node['url'],
|
'engine_url': response_json['tracker']['url'],
|
||||||
'desc_link': item['torrent']['url'][node['locale']]
|
'desc_link': item['torrent']['url']
|
||||||
}
|
}
|
||||||
prettyPrinter(res)
|
prettyPrinter(res)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue