Add support for stickers.cloud

This commit is contained in:
h7x4 2023-05-14 00:13:13 +02:00
parent f7218b5005
commit d441327099
No known key found for this signature in database
GPG key ID: 9F2F7D8250F35146

View file

@ -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
'';
};
}