Skip to content

Commit

Permalink
assorted unit3d: clean up $raw
Browse files Browse the repository at this point in the history
  • Loading branch information
garfield69 committed Mar 20, 2023
1 parent a7fec0b commit fcad92d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
15 changes: 14 additions & 1 deletion src/Jackett.Common/Definitions/danishbytes-api.yml
Expand Up @@ -77,10 +77,23 @@ login:

search:
paths:
- path: "/api/torrents/v2/filter?api_token={{ .Config.apikey }}&search={{ .Keywords }}{{ if .Query.IMDBIDShort }}&imdb={{ .Query.IMDBIDShort }}{{ else }}{{ end }}{{ if .Query.TMDBID }}&tmdb={{ .Query.TMDBID }}{{ else }}{{ end }}{{ if .Query.TVDBID }}&tvdb={{ .Query.TVDBID }}{{ else }}{{ end }}{{ range .Categories }}&categories[]={{.}}{{end}}{{ if .Config.freeleech }}&freeleech=1{{ else }}{{ end }}&sorting={{ .Config.sort }}&direction={{ .Config.type }}&qty=100&page=1"
- path: api/torrents/v2/filter
response:
type: json

inputs:
api_token: "{{ .Config.apikey }}"
$raw: "{{ range .Categories }}&categories[]={{.}}{{end}}"
search: "{{ .Keywords }}"
imdb: "{{ .Query.IMDBIDShort }}"
tmdb: "{{ .Query.TMDBID }}"
tvdb: "{{ .Query.TVDBID }}"
freeleech: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
sorting: "{{ .Config.sort }}"
direction: "{{ .Config.type }}"
qty: 100
page: 1

rows:
selector: torrents
count:
Expand Down
7 changes: 5 additions & 2 deletions src/Jackett.Common/Definitions/hawke-uno.yml
Expand Up @@ -66,10 +66,13 @@ search:
type: json

inputs:
# if we have an id based search, add Season and Episode as query in name for UNIT3D < v6. Else pass S/E Params for UNIT3D >= v6
api_token: "{{ .Config.apikey }}"
$raw: "{{ range .Categories }}&categories[]={{.}}{{end}}"
name: "{{ .Keywords }}"
$raw: "{{ if .Query.TMDBID }}&tmdbId={{ .Query.TMDBID }}{{ else }}{{ end }}{{ if .Query.IMDBIDShort }}&imdbId={{ .Query.IMDBIDShort }}{{ else }}{{ end }}{{ if .Query.TVDBID }}&tvdbId={{ .Query.TVDBID }}{{ else }}{{ end }}{{ range .Categories }}&categories[]={{.}}{{end}}{{ if .Config.freeleech }}&free=1{{ else }}{{ end }}"
imdbId: "{{ .Query.IMDBIDShort }}"
tmdbId: "{{ .Query.TMDBID }}"
tvdbId: "{{ .Query.TVDBID }}"
free: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
sortField: "{{ .Config.sort }}"
sortDirection: "{{ .Config.type }}"
perPage: 100
Expand Down
15 changes: 14 additions & 1 deletion src/Jackett.Common/Definitions/hdolimpo-api.yml
Expand Up @@ -65,10 +65,23 @@ search:
paths:
# https://hdinnovations.github.io/UNIT3D-Community-Edition-Docs/api_endpoints.html
# https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/app/Http/Controllers/API/TorrentController.php
- path: "/api/torrents/filter?api_token={{ .Config.apikey }}&name={{ if .Query.IMDBID }}{{ else }}{{ .Keywords }}{{ end }}{{ if .Query.TMDBID }}&tmdbId={{ .Query.TMDBID }}{{ else }}{{ end }}{{ if .Query.IMDBIDShort }}&imdbId={{ .Query.IMDBIDShort }}{{ else }}{{ end }}{{ if .Query.TVDBID }}&tvdbId={{ .Query.TVDBID }}{{ else }}{{ end }}&sortField={{ .Config.sort }}&sortDirection={{ .Config.type }}&perPage=100&page=1{{ range .Categories }}&categories[]={{.}}{{end}}{{ if .Config.freeleech }}&free=1{{ else }}{{ end }}"
- path: api/torrents/filter
response:
type: json

inputs:
api_token: "{{ .Config.apikey }}"
$raw: "{{ range .Categories }}&categories[]={{.}}{{end}}"
name: "{{ .Keywords }}"
imdbId: "{{ .Query.IMDBIDShort }}"
tmdbId: "{{ .Query.TMDBID }}"
tvdbId: "{{ .Query.TVDBID }}"
free: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
sortField: "{{ .Config.sort }}"
sortDirection: "{{ .Config.type }}"
perPage: 100
page: 1

rows:
selector: data
attribute: attributes
Expand Down
15 changes: 14 additions & 1 deletion src/Jackett.Common/Definitions/torrentseeds-api.yml
Expand Up @@ -74,10 +74,23 @@ search:
paths:
# https://hdinnovations.github.io/UNIT3D-Community-Edition-Docs/api_endpoints.html
# https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/app/Http/Controllers/API/TorrentController.php
- path: "/api/torrents/filter?api_token={{ .Config.apikey }}&name={{ if .Query.IMDBID }}{{ else }}{{ .Keywords }}{{ end }}{{ if .Query.TMDBID }}&tmdbId={{ .Query.TMDBID }}{{ else }}{{ end }}{{ if .Query.IMDBIDShort }}&imdbId={{ .Query.IMDBIDShort }}{{ else }}{{ end }}{{ if .Query.TVDBID }}&tvdbId={{ .Query.TVDBID }}{{ else }}{{ end }}&sortField={{ .Config.sort }}&sortDirection={{ .Config.type }}&perPage=100&page=1{{ range .Categories }}&categories[]={{.}}{{end}}{{ if .Config.freeleech }}&free=1{{ else }}{{ end }}"
- path: api/torrents/filter
response:
type: json

inputs:
api_token: "{{ .Config.apikey }}"
$raw: "{{ range .Categories }}&categories[]={{.}}{{end}}"
name: "{{ .Keywords }}"
imdbId: "{{ .Query.IMDBIDShort }}"
tmdbId: "{{ .Query.TMDBID }}"
tvdbId: "{{ .Query.TVDBID }}"
free: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
sortField: "{{ .Config.sort }}"
sortDirection: "{{ .Config.type }}"
perPage: 100
page: 1

rows:
selector: data
attribute: attributes
Expand Down

0 comments on commit fcad92d

Please sign in to comment.