Application Name | [Python] Reddit Image Downloader |
Version | 0.1 |
Short Description | Download n random images from any subreddit, and save them to a folder |
Supported OSes | Anything that can run python |
Web Page | Only available here |
Download Link | Download Here |
System Requirements | - Internet Connection: Required for downloading images from Reddit
- Python Version: 3.7 or above
- Additional Libraries: requests, Pillow, tqdm
|
Author | Click my name |
Description🌟 Introducing the Reddit Image Downloader: Fun-tastic Edition! 📸🎉
Get ready to embark on a thrilling and fun-filled image expedition with the Reddit Image Downloader: Fun-tastic Edition! This extraordinary Python script is your passport to a world of excitement, laughter, and captivating visuals from Reddit's most entertaining subreddits. Brace yourself for a truly unforgettable experience!
Why choose the Reddit Image Downloader: Fun-tastic Edition? Here are some fantastic features that will make your image exploration a blast:
1️⃣ Endless Fun, Beyond Memes: The Reddit Image Downloader: Fun-tastic Edition goes beyond just memes, uncovering a wide range of fun and entertaining images from various subreddits. From adorable animals to stunning landscapes, epic artwork to mind-bending illusions, this script brings you a kaleidoscope of visual delights to brighten your day.
2️⃣ Example Usages: Let's dive into the exciting possibilities of the Reddit Image Downloader: Fun-tastic Edition! Use it to:
📸 Create a collection of cute animal pictures from r/aww for a heartwarming slideshow.
🎨 Gather inspiring artwork from r/art to fuel your creativity and brighten your workspace.
🌄 Download breathtaking landscape images from r/EarthPorn for virtual travel adventures.
🤣 Collect hilarious images from r/funny to share with friends and create your own comedy show.
🚀 Grab captivating space-themed images from r/spaceporn for a cosmic screensaver.
🎉 Save amusing reaction GIFs from r/reactiongifs to enhance your online conversations.
🌈 Collect vibrant illustrations from r/illustration for a personalized digital art gallery.
🐱 Download adorable cat pictures from r/cats to create a "Meow of Fame" montage.
🍕 Gather mouth-watering food images from r/foodporn for culinary inspiration.
🏞️ Save stunning nature photos from r/naturepics for a calming and immersive screensaver.
🐶 Create a collection of funny dog pictures from r/dogpictures to boost your mood.
🎮 Download epic gaming screenshots and fan art from r/gaming to fuel your gaming passion.
🖼️ Gather art masterpieces from r/pics for an artistic slideshow on your digital frame.
🎉 Collect party and celebration images from r/PartyParrot for festive event invitations.
🌌 Download mesmerizing night sky photos from r/space for stargazing inspiration.
🍕 Save delicious pizza images from r/Pizza to create a mouth-watering screensaver.
🌸 Gather beautiful flower images from r/flowers for a virtual bouquet to brighten your day.
🚗 Download cool car photos from r/Autos to create a dream car vision board.
🎭 Save images from cosplay subreddits like r/cosplay to appreciate incredible costumes.
🍩 Gather tempting dessert pictures from r/dessertporn for a drool-worthy dessert recipe book.
⚡️ Download images of lightning strikes from r/weather to create a captivating weather screensaver.
🐍 Collect mesmerizing snake images from r/Sneks to appreciate their beauty and diversity.
🏞️ Save serene forest landscapes from r/ForestPorn for a peaceful and immersive screensaver.
🐦 Gather stunning bird photos from r/birdpics to create a digital aviary on your desktop.
🎉 Download party meme images from r/wheredidthesodago for a hilarious virtual celebration.
🎵 Collect images related to your favorite music artists from r/Music for a personalized gallery.
🌊 Save breathtaking ocean scenes from r/OceanPorn for a tranquil and immersive screensaver.
🐟 Gather colorful fish images from r/Aquariums to create a virtual aquarium on your desktop.
🚀 Download images from NASA subreddits like r/spaceexploration to explore the wonders of space.
🎥 Collect behind-the-scenes images from your favorite movies and TV shows from r/MovieDetails.
🌺 Save images of tropical flowers from r/tropical for a virtual paradise on your desktop.
🍔 Gather mouth-watering burger images from r/Burgers for a delicious screensaver.
📚 Download book cover art images from r/bookcoverporn for a virtual library on your desktop.
🎮 Collect nostalgic video game images from r/retrogaming for a trip down memory lane.
🎨 Gather incredible street art images from r/graffiti for an urban art gallery.
🐼 Download adorable panda pictures from r/pandas for an instant mood boost.
🚁 Capture stunning aerial photography from r/aerialporn for a bird's-eye view.
🌅 Save breathtaking sunset images from r/SunsetPorn for a soothing screensaver.
🌳 Gather images of ancient trees from r/ancienttrees to appreciate their majestic beauty.
🌈 Download rainbow-themed images from r/rainboweverything for a burst of color.
🎥 Collect behind-the-scenes images from r/behindthegifs for a peek into GIF creation.
🏞️ Save images of hidden gems from r/hiking for your next outdoor adventure.
🐮 Gather cute cow pictures from r/happycowgifs for a dose of bovine joy.
🌌 Download stunning Milky Way photos from r/MilkyWayPhotography for cosmic inspiration.
🎮 Collect video game-inspired artwork from r/gamingart for a gaming art showcase.
🎵 Save images of vinyl records and turntables from r/vinyl for music enthusiasts.
🎉 Download images of celebration fireworks from r/fireworks for a festive screensaver.
🎭 Collect theatrical makeup images from r/SFX for a showcase of special effects makeup.
🌍 Save captivating images of Earth from space from r/NASA for a cosmic screensaver.
🌸 Gather images of Japanese cherry blossoms from r/Sakura for a serene screensaver.
With the Reddit Image Downloader: Fun-tastic Edition, the possibilities for joy and entertainment are truly limitless. Start your image adventure today and unleash the power of visual fun from Reddit's most delightful subreddits! 🚀📸🎉
(Yes, AI wrote the description for me because my only remaining braincell wanted to type "it downloads pics from reddit" as the description)FeaturesSubreddit Image Downloader
Multithread
Supports args, or user input
Planned FeaturesNo clue, ask and I'll probably add
Screenshots[Pre-Release] Reddit Image DownloaderUsageInstallationIt's python, just run it like:
pip install requests urllib uuid4 sys concurrent.futures PIL Image io logging tqdm argparse
python dler.py
or
python dler.py -h (for help)
Using the ApplicationDo the above and everything else is obvious
UninstallationDelete it
TipsTry not to get obsessed and end up with 3000+ Possum Memes in a folder, like I did
Known IssuesCan take up a lot of space if you become obsessed with possum memes
RAW CODE:import requests
import os
from uuid import uuid4
import urllib
import sys
import concurrent.futures
from PIL import Image
from io import BytesIO
import logging
from tqdm import tqdm
import argparse
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def download_image(image_link, folder_name):
try:
response = requests.get(image_link)
if response.status_code == 200:
image_data = response.content
image = Image.open(BytesIO(image_data))
if image.format.lower() in ['jpeg', 'jpg', 'png']:
image_name = str(uuid4()) + "." + image.format.lower()
image_path = os.path.join(folder_name, image_name)
with open(image_path, 'wb') as file:
file.write(image_data)
logger.info(f"Downloaded image: {image_link}")
else:
logger.warning(f"Skipping image with unsupported format: {image_link}")
else:
logger.warning(f"Unable to download image: {image_link}")
except Exception as e:
logger.exception(f"Error downloading {image_link}: {e}")
def download_images(search_term, folder_name, limit):
if not os.path.exists(folder_name):
os.mkdir(folder_name)
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
}
response = requests.get(f"https://www.reddit.com/r/{search_term}/.json?limit={limit}", headers=headers)
data = response.json()
if "data" not in data:
logger.warning("No posts found in subreddit")
sys.exit()
image_links = []
for post in data["data"]["children"]:
if "post_hint" in post["data"] and post["data"]["post_hint"] == "image":
image_links.append(post["data"]["url"])
while len(image_links) < int(limit) and data["data"]["after"]:
after = data["data"]["after"]
response = requests.get(f"https://www.reddit.com/r/{search_term}/.json?limit={limit}&after={after}", headers=headers)
data = response.json()
for post in data["data"]["children"]:
if "post_hint" in post["data"] and post["data"]["post_hint"] == "image":
image_links.append(post["data"]["url"])
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = []
for image_link in image_links[:int(limit)]:
futures.append(executor.submit(download_image, image_link, folder_name))
for future in tqdm(concurrent.futures.as_completed(futures), total=len(futures), desc="Downloading images"):
try:
future.result()
except Exception as e:
logger.exception(f"Error while downloading image: {e}")
logger.info("All images downloaded to: %s", folder_name)
def validate_folder_name(folder_name):
folder_name = ''.join(c for c in folder_name if c.isalnum() or c in ['-', '_'])
return folder_name
def validate_limit(limit):
try:
limit = int(limit)
if limit <= 0:
raise ValueError()
except ValueError:
logger.warning("Invalid limit value. Using default limit of 10.")
limit = 10
return limit
def parse_arguments():
parser = argparse.ArgumentParser(description="Reddit Image Downloader")
parser.add_argument("search_term", nargs="?", type=str, help="Enter the search term")
parser.add_argument("folder_name", nargs="?", type=str, help="Enter the folder name")
parser.add_argument("--limit", type=str, help="Enter the number of images to download (default: 10)")
return parser.parse_args()
def main():
args = parse_arguments()
if not args.search_term:
search_term = input("Enter the search term: ").replace(" ", "")
else:
search_term = args.search_term.replace(" ", "")
if not args.folder_name:
folder_name = input("Enter the folder name: ")
else:
folder_name = validate_folder_name(args.folder_name)
if not args.limit:
limit = input("Enter the number of images to download: ")
else:
limit = validate_limit(args.limit)
download_images(search_term, folder_name, limit)
if __name__ == "__main__":
main()