Are you tired of downloading images off Reddit and setting it to your desktop wallpaper?
Look no further, here is a script that does that for you! (Only if you are mac user.)
Supports Resolution and multiple subreddits.
Also, runs by itself every 3 days*
- Only on Mac (Tested on Catalina)
- Python 3.7+ (I think, i have used 3.9, but should work with 3.7)
- Create a reddit account and and create an app and get two things and make up something for user-agent:
client_id
client_secret
user-agent
Something likescrapeit <username>
- Run
./mac-setup.sh
; this should does following:
- Configuration folder under
$HOME/.config/scrapeit
- Image folder under
$HOME/scrapeit
- Secret file under
$HOME/.config/scrapeit/secret.yaml
- Log folder under
$HOME/.config/scrapeit/log/
- Python virtual environment under
$HOME/scrapeit/env/scrapeit
and its dependencies - Cronjob Configuration running every 3 days.
- Should be good to go
Not easily configurable since this was created very quick; but following should be in your mind if you were to fork this.
Lots of configurations with this script.
scrapeit-onescript.py
SUBREDDITS
; without/r
just the name of subredditIMAGE_RESOLUTION_MIN
; if you don't care about resolution use this `(float('-inf'), float('-inf'))IMAGE_RESOLUTION_MAX
; if you don't care about resolution use this `(float('inf'), float('inf'))MAX_SEARCH
MAX_IMAGE_PER_SUBREDDIT
this is per run; 2 subreddits means 4 images per runMAX_IMAGE
this is overall files numbers in directory; if script sees more thanMAX_IMAGE
it will delete oldest one firstMAX_HISTORY
The script is using pickle to ignore reddit submission that has been searched before; this should be able to go about a million before mac goes boom boom;
If you are lazy just do this;
- Create a folder that you want
- Change
IMAGE_LOCATION
line inscrapeit-onescript.py
Currently, the script, mac-setup.sh
is only looking for 3 day configuartion when de-duping; if you want more frequent or lazier cron configuration; you need to remove the entry in crontab
and then change CRON_JOB
variable in mac-setup.sh