Add support for stickers.cloud
This commit is contained in:
parent
f7218b5005
commit
d441327099
20
fetchers.nix
20
fetchers.nix
|
@ -32,7 +32,7 @@ in {
|
||||||
chatsticker-deps = with pkgs; [ wget html-xml-utils ];
|
chatsticker-deps = with pkgs; [ wget html-xml-utils ];
|
||||||
chatsticker-build = { name, id ? "", title ? "", ... }: baseFetcher {
|
chatsticker-build = { name, id ? "", title ? "", ... }: baseFetcher {
|
||||||
inherit id title;
|
inherit id title;
|
||||||
type = "chatstickers";
|
type = "chatsticker";
|
||||||
dir = name;
|
dir = name;
|
||||||
instructions = ''
|
instructions = ''
|
||||||
wget "https://chatsticker.com/sticker/${name}" -O raw.html
|
wget "https://chatsticker.com/sticker/${name}" -O raw.html
|
||||||
|
@ -47,4 +47,22 @@ in {
|
||||||
rm raw.html normalized.html images.txt
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue