From d441327099b0abfea9a11026e5c9ecb139b7e012 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 14 May 2023 00:13:13 +0200 Subject: [PATCH] Add support for stickers.cloud --- fetchers.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/fetchers.nix b/fetchers.nix index 949a94f..22ca7e1 100644 --- a/fetchers.nix +++ b/fetchers.nix @@ -32,7 +32,7 @@ in { chatsticker-deps = with pkgs; [ wget html-xml-utils ]; chatsticker-build = { name, id ? "", title ? "", ... }: baseFetcher { inherit id title; - type = "chatstickers"; + type = "chatsticker"; dir = name; instructions = '' wget "https://chatsticker.com/sticker/${name}" -O raw.html @@ -47,4 +47,22 @@ in { rm raw.html normalized.html images.txt ''; }; + + stickers-cloud-deps = with pkgs; [ wget html-xml-utils ]; + stickers-cloud-build = { name, id ? "", title ? "", ... }: baseFetcher { + inherit id title; + type = "stickers-cloud"; + dir = name; + instructions = '' + wget "https://stickers.cloud/en/pack/${name}" -O raw.html + hxnormalize -l 240 -x raw.html > normalized.html + cat normalized.html | hxselect -s '\n' -c "img.d-block.image-ratio::attr(src)" > images.txt; + + for url in $(cat images.txt); do + wget $url + done + + rm raw.html normalized.html images.txt + ''; + }; }