stridsvagn69420 / wallpaper-dl Goto Github PK
View Code? Open in Web Editor NEWWallpaper downloader for various websites
Home Page: https://crates.io/crates/wallpaper-dl
License: European Union Public License 1.2
Wallpaper downloader for various websites
Home Page: https://crates.io/crates/wallpaper-dl
License: European Union Public License 1.2
I honestly think it's better to just make it a standalone downloader and remove all of the manager aspects. Sure, they're nice, but how often do you change wallpapers that you need a manager built-in? Even for rotating wallpapers, it's better to stick to Unix philosophy and have a separate wallpaper setter. I might actually make one, either in Rust or Zig.
Out of all websites as of time of writing only the Alphacoders websites block the downloader almost every time. I know that the User-Agent is often the giving factor. The reason why it sets a User-Agent here is because some websites (e.g. Wallhaven) outright refuse to connect/respond normally with agent-less clients.
When trying to download an image from Wallaper Abyss, I get this error message:
wallpaper-dl https://wall.alphacoders.com/big.php?i=1362746
Fetching https://wall.alphacoders.com/big.php?i=1362746 FAILED HTTP status client error (403 Forbidden) for url (https://wall.alphacoders.com/big.php?i=1362746)
Looking at the response using cURL, there is obviously a block from Cloudflare's side:
curl --head https://wall.alphacoders.com/big.php?i=1362746 -A "wallpaper-dl/0.2.0"
Date: Mon, 17 Jun 2024 20:55:45 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Set-Cookie: [REDACTED]
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Referrer-Policy: no-referrer-when-downgrade
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
CF-Cache-Status: DYNAMIC
Set-Cookie: [REDACTED]
Server: cloudflare
CF-RAY: [REDACTED]
alt-svc: h3=":443"; ma=86400
It also does not matter here if the user agent is set to wallpaper-dl's or none at all, since it's not from a normal browser. But watch what happens when I give it my browser's user agent:
curl --head https://wall.alphacoders.com/big.php?i=1362746 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
HTTP/1.1 200 OK
Date: Mon, 17 Jun 2024 20:59:23 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Set-Cookie: [REDACTED]
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Referrer-Policy: no-referrer-when-downgrade
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
CF-Cache-Status: DYNAMIC
Set-Cookie: [REDACTED]
Server: cloudflare
CF-RAY: [REDACTED]
alt-svc: h3=":443"; ma=86400
I think the config just needs a little field where we can put a custom User-Agent to bypass this anti-bot detection. Does not work all the time apparently, but it might be useful even as a temporary fix for someone.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.