yggtorrent: add config sort options

This commit is contained in:
Garfield69
2019-12-22 09:51:15 +13:00
parent 7ae1b57ddd
commit 9b0c4c8ed2
2 changed files with 70 additions and 44 deletions

View File

@@ -146,15 +146,26 @@
type: checkbox type: checkbox
label: Enhance sonarr compatibility with anime by renaming episode (xxx to exxx). Works only if episode is at the end of the query. Can disturb movies search. (back to the future 3 -> back to the future e3) label: Enhance sonarr compatibility with anime by renaming episode (xxx to exxx). Works only if episode is at the end of the query. Can disturb movies search. (back to the future 3 -> back to the future e3)
default: false default: false
# NEW SEARCH ENGINE MIGH BE BETTER THAN THAT
# - name: sonarrv3hack
# type: checkbox
# label: "REMOVED"
# default: false
- name: betasearchengine - name: betasearchengine
type: checkbox type: checkbox
label: "Use Beta Search engine URL (Less restrictive) / SonarrV3 Full Series Search NEW" label: "Use Beta Search engine URL (Less restrictive) / SonarrV3 Full Series Search NEW"
default: false default: false
- name: sort
type: select
label: Sort requested from site
default: "publish_date"
options:
"publish_date": "created"
"seed": "seeders"
"size": "size"
"name": "title"
- name: type
type: select
label: Order requested from site
default: "desc"
options:
"desc": "desc"
"asc": "asc"
login: login:
method: cookie method: cookie
@@ -188,21 +199,23 @@
args: ["\"", ""] args: ["\"", ""]
- name: trim - name: trim
paths: paths:
- path: "https://{{ .Config.searchanddlurl }}/{{if .Config.betasearchengine}}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{if .Config.betasearchengine}}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order=desc&sort=publish_date" - path: "https://{{ .Config.searchanddlurl }}/{{ if .Config.betasearchengine }}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{ if .Config.betasearchengine }}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order={{ .Config.type }}&sort={{ .Config.sort }}"
- path: "https://{{ .Config.searchanddlurl }}/{{if .Config.betasearchengine}}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{if .Config.betasearchengine}}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order=desc&sort=publish_date&page=50" - path: "https://{{ .Config.searchanddlurl }}/{{ if .Config.betasearchengine }}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{ if .Config.betasearchengine }}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order={{ .Config.type }}&sort={{ .Config.sort }}&page=50"
rows: rows:
selector: "table.table > tbody > tr" selector: table.table > tbody > tr
fields: fields:
_id: _id:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
attribute: href attribute: href
filters: filters:
- name: regexp - name: regexp
args: "/(\\d+)-" args: "/(\\d+)-"
title_normal: title_normal:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
title_filtered: title_filtered:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
filters: filters:
- name: re_replace - name: re_replace
args: ["(?i)^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"] args: ["(?i)^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"]
@@ -250,7 +263,7 @@
title: title:
text: "{{if .Config.enhancedAnime }}{{ .Result.title_anime }}{{else}}{{ .Result.title_phase3 }}{{end}}" text: "{{if .Config.enhancedAnime }}{{ .Result.title_anime }}{{else}}{{ .Result.title_phase3 }}{{end}}"
details: details:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
attribute: href attribute: href
category: category:
# changed the catid into and hidden div as of last tracker problem # changed the catid into and hidden div as of last tracker problem
@@ -258,12 +271,12 @@
comments: comments:
optional: true optional: true
selector: "td:nth-child(1) > a[href$=\"#comments\"]" selector: td:nth-child(1) > a[href$="#comments"]
attribute: href attribute: href
download: download:
text: "https://{{ .Config.searchanddlurl }}/engine/download_torrent?id={{ .Result._id }}" text: "https://{{ .Config.searchanddlurl }}/engine/download_torrent?id={{ .Result._id }}"
date: date:
selector: "td:nth-child(5)" selector: td:nth-child(5)
filters: filters:
- name: replace - name: replace
args: ["il y a ", ""] args: ["il y a ", ""]
@@ -288,23 +301,23 @@
- name: append - name: append
args: " ago" args: " ago"
size: size:
selector: "td:nth-child(6)" selector: td:nth-child(6)
filters: filters:
- name: replace - name: replace
args: ["o", "B"] args: ["o", "B"]
grabs: grabs:
selector: "td:nth-child(7)" selector: td:nth-child(7)
seeders: seeders:
text: 0 text: 0
seeders: seeders:
selector: "td:nth-child(8)" selector: td:nth-child(8)
optional: true optional: true
leechers: leechers:
text: 0 text: 0
leechers: leechers:
selector: "td:nth-child(9)" selector: td:nth-child(9)
optional: true optional: true
downloadvolumefactor: downloadvolumefactor:
text: "1" text: 1
uploadvolumefactor: uploadvolumefactor:
text: "1" text: 1

View File

@@ -145,15 +145,26 @@
type: checkbox type: checkbox
label: Enhance sonarr compatibility with anime by renaming episode (xxx to exxx). Works only if episode is at the end of the query. Can disturb movies search. (back to the future 3 -> back to the future e3) label: Enhance sonarr compatibility with anime by renaming episode (xxx to exxx). Works only if episode is at the end of the query. Can disturb movies search. (back to the future 3 -> back to the future e3)
default: false default: false
# NEW SEARCH ENGINE MIGH BE BETTER THAN THAT
# - name: sonarrv3hack
# type: checkbox
# label: "REMOVED"
# default: false
- name: betasearchengine - name: betasearchengine
type: checkbox type: checkbox
label: "Use Beta Search engine URL (Less restrictive) / SonarrV3 Full Series Search NEW" label: "Use Beta Search engine URL (Less restrictive) / SonarrV3 Full Series Search NEW"
default: false default: false
- name: sort
type: select
label: Sort requested from site
default: "publish_date"
options:
"publish_date": "created"
"seed": "seeders"
"size": "size"
"name": "title"
- name: type
type: select
label: Order requested from site
default: "desc"
options:
"desc": "desc"
"asc": "asc"
login: login:
method: form method: form
@@ -202,21 +213,23 @@
args: ["\"", ""] args: ["\"", ""]
- name: trim - name: trim
paths: paths:
- path: "https://{{ .Config.searchanddlurl }}/{{if .Config.betasearchengine}}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{if .Config.betasearchengine}}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order=desc&sort=publish_date" - path: "https://{{ .Config.searchanddlurl }}/{{ if .Config.betasearchengine }}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{ if .Config.betasearchengine }}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order={{ .Config.type }}&sort={{ .Config.sort }}"
- path: "https://{{ .Config.searchanddlurl }}/{{if .Config.betasearchengine}}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{if .Config.betasearchengine}}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order=desc&sort=publish_date&page=50" - path: "https://{{ .Config.searchanddlurl }}/{{ if .Config.betasearchengine }}new_search{{else}}engine{{end}}/search?category={{ .Config.category }}&name={{ if .Config.betasearchengine }}{{ .Keywords }}{{else}}{{ re_replace .Keywords \"\\b[^\\s]+\\b\" \"\"$&\"\"}}{{end}}&description=&file=&uploader=&sub_category=&do=search&order={{ .Config.type }}&sort={{ .Config.sort }}&page=50"
rows: rows:
selector: "table.table > tbody > tr" selector: table.table > tbody > tr
fields: fields:
_id: _id:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
attribute: href attribute: href
filters: filters:
- name: regexp - name: regexp
args: "/(\\d+)-" args: "/(\\d+)-"
title_normal: title_normal:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
title_filtered: title_filtered:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
filters: filters:
- name: re_replace - name: re_replace
args: ["(?i)^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"] args: ["(?i)^(?:(.+?)((?:[\\.\\-\\s_\\[]+(?:imax|(?:dvd|bd|tv)(?:rip|scr)|bluray(?:\\-?rip)?|720\\s*p?|1080\\s*p?|vof?|vost(?:fr)?|multi|vf(?:f|q)?[1-3]?|(?:true)?french|eng?)[\\.\\-\\s_\\]]*)*)([\\(\\[]?(?:20|1[7-9])\\d{2}[\\)\\]]?)(.*)$|(.*))$", "$1 $3 $2 $4 $5"]
@@ -264,7 +277,7 @@
title: title:
text: "{{ if .Config.enhancedAnime }}{{ .Result.title_anime }}{{else}}{{ .Result.title_phase3 }}{{end}}" text: "{{ if .Config.enhancedAnime }}{{ .Result.title_anime }}{{else}}{{ .Result.title_phase3 }}{{end}}"
details: details:
selector: ":nth-child(2) > a" selector: td:nth-child(2) > a
attribute: href attribute: href
category: category:
# changed the catid into and hidden div as of last tracker problem # changed the catid into and hidden div as of last tracker problem
@@ -272,12 +285,12 @@
comments: comments:
optional: true optional: true
selector: "td:nth-child(1) > a[href$=\"#comments\"]" selector: td:nth-child(1) > a[href$="#comments"]
attribute: href attribute: href
download: download:
text: "https://{{ .Config.searchanddlurl }}/engine/download_torrent?id={{ .Result._id }}" text: "https://{{ .Config.searchanddlurl }}/engine/download_torrent?id={{ .Result._id }}"
date: date:
selector: "td:nth-child(5)" selector: td:nth-child(5)
filters: filters:
- name: replace - name: replace
args: ["il y a ", ""] args: ["il y a ", ""]
@@ -302,23 +315,23 @@
- name: append - name: append
args: " ago" args: " ago"
size: size:
selector: "td:nth-child(6)" selector: td:nth-child(6)
filters: filters:
- name: replace - name: replace
args: ["o", "B"] args: ["o", "B"]
grabs: grabs:
selector: "td:nth-child(7)" selector: td:nth-child(7)
seeders: seeders:
text: 0 text: 0
seeders: seeders:
selector: "td:nth-child(8)" selector: td:nth-child(8)
optional: true optional: true
leechers: leechers:
text: 0 text: 0
leechers: leechers:
selector: "td:nth-child(9)" selector: td:nth-child(9)
optional: true optional: true
downloadvolumefactor: downloadvolumefactor:
text: "1" text: 1
uploadvolumefactor: uploadvolumefactor:
text: "1" text: 1