From 774a896bfdb65f930ad28c2d7bd6a9fd38ac9ab4 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Sat, 30 Nov 2024 20:46:38 +0100 Subject: [PATCH] feat: we have ygg at home --- modules/jackett/default.nix | 8 ++- modules/jackett/ygg-api.yml | 117 ++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 modules/jackett/ygg-api.yml diff --git a/modules/jackett/default.nix b/modules/jackett/default.nix index c131afd..337aa3d 100644 --- a/modules/jackett/default.nix +++ b/modules/jackett/default.nix @@ -35,7 +35,13 @@ in services.jackett = { enable = true; # unstable version to have updated torrent list - package = pkgs.jackett; + package = pkgs.unstable.jackett.overrideAttrs ( + _: _: { + postInstall = '' + cp ${./ygg-api.yml} $out/lib/jackett/Definitions/ygg-api.yml + ''; + } + ); inherit (cfg) user group; }; } diff --git a/modules/jackett/ygg-api.yml b/modules/jackett/ygg-api.yml new file mode 100644 index 0000000..44dba67 --- /dev/null +++ b/modules/jackett/ygg-api.yml @@ -0,0 +1,117 @@ +--- +id: ygg-api +name: Ygg API +description: Indexeur non officiel pour ygg.re MOVIES / TV +language: fr-FR +type: private +encoding: UTF-8 +testlinktorrent: false +links: + - https://yggapi.eu/ + +caps: + categorymappings: + - {id: 2178, cat: Movies/Other, desc: "Films d’animation"} + - {id: 2179, cat: TV/Anime, desc: "Séries d’animation / Mangas"} + - {id: 2183, cat: Movies, desc: "Films"} + - {id: 2184, cat: TV, desc: "Séries"} + + modes: + search: [q] + tv-search: [q, season, ep] + movie-search: [q, year] + allowrawsearch: true + +settings: + - name: passkey + type: password + label: Passkey + - name: info_key + type: info + label: About your passkey + default: "You will find your passkey on the YGG account page." + - name: sort + type: select + label: Sort requested from site + default: uploaded_at + options: + uploaded_at: publish_date + seeders: seeders + downloads: downloads + - name: multilang + type: checkbox + label: Replace MULTi by another language in release name + default: false + - name: multilanguage + type: select + label: Replace MULTi by this language + default: FRENCH + options: + FRENCH: FRENCH + MULTi.FRENCH: MULTi.FRENCH + ENGLISH: ENGLISH + MULTi.ENGLISH: MULTi.ENGLISH + VOSTFR: VOSTFR + MULTi.VOSTFR: MULTi.VOSTFR + - name: info_downloads + type: info + label: About missing Downloads + default: "If the torrent has no seeder and no leecher then the torrent file may be missing and download may fail." + +search: + paths: + - path: torrents + response: + type: json + inputs: + $raw: "{{ range .Categories }}&category_id={{.}}{{end}}" + q: "{{ .Keywords }}" + page: 1 + per_page: 100 + order_by: "{{ .Config.sort }}" + + rows: + selector: $ + missingAttributeEqualsNoResults: true + + fields: + category: + selector: category_id + title_normal: + selector: title + title_multilang: + text: "{{ .Result.title_normal }}" + filters: + - name: re_replace + args: ["(?i)[\\.](MULTI(?!.*(?:FRENCH|ENGLISH|VOSTFR)))[\\.]", ".{{ .Config.multilanguage }}."] + title: + text: "{{ if .Config.multilang }}{{ .Result.title_multilang }}{{ else }}{{ .Result.title_normal }}{{ end }}" + _id: + selector: id + details: + text: "torrent/{{ .Result._id }}" + download: + text: "torrent/{{ .Result._id }}/download?passkey={{ .Config.passkey }}" + year: + selector: title + filters: + - name: regexp + args: (\b(19|20)\d{2}\b) + size: + selector: size + seeders: + selector: seeders + leechers: + selector: leechers + grabs: + selector: downloads + optional: true + default: 0 + date: + # unix + selector: uploaded_at + downloadvolumefactor: + text: 1 + uploadvolumefactor: + text: 1 +# JSON 1.0.0