Skip to content

Antot-12/Reddit-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

😎 Reddit Scripts

A small collection of automation scripts for Reddit that help you:

  • 📤 Autopost images from local folders to your Reddit profile
  • 🧹 Find and delete duplicate posts
  • 📂 Check which local files haven’t been published yet

This repository currently contains two main scripts:

  1. autoposter.py - automatically cycles through specified folders, posting images to your Reddit profile with random delays.
  2. duplicateDeletor.py - scans your Reddit submissions, finds duplicates, optionally deletes them, and generates a report of unpublished files on your machine.

✨ What these scripts do

Autoposter (autoposter.py)

  • Looks into predefined folders (A, H, P by default).
  • Keeps track of which files are ready to be posted.
  • Posts only images (.jpg, .jpeg, .png) while skipping videos and GIFs.
  • Checks if a file with the same title was already posted to avoid duplicates.
  • Cleans up duplicates automatically after each successful post.
  • Waits a random delay (between 5 - 15 seconds by default) before posting the next file.
  • Logs everything into autoposter.log.

🔹 Duplicate Deletor (duplicateDeletor.py)

  • Scans your profile submissions.
  • Detects duplicate titles and writes them to duplicates.txt.
  • Gives you the option to delete duplicates directly from your account.
  • Checks your local folders and generates unpublished.txt listing files that were never posted.

🛠 Installation & Setup

1. Clone the repository

git clone https://github.com/Antot-12/Reddit-Scripts.git
cd Reddit-Scripts

2. Create a virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # On Linux / macOS
venv\Scripts\activate      # On Windows

3. Install dependencies

Both scripts rely on PRAW (Python Reddit API Wrapper). Install it via pip:

pip install praw

4. Configure your Reddit API credentials

Both scripts require a Reddit app (personal use script) to authenticate.

👉 Steps:

  1. Go to Reddit Apps.

  2. Scroll down and click “create app”.

  3. Choose script as the type.

  4. Fill in:

    • Name: any name you like
    • Redirect URI: http://localhost:8080 (required, but unused in these scripts)
  5. Once created, you’ll see:

    • client_id (the short alphanumeric string under the app name)
    • client_secret
  6. Open each script (autoposter.py, duplicateDeletor.py) and replace:

    client_id="your_client_id"
    client_secret="your_client_secret"
    username="your_username"
    password="your_password"
    user_agent="your_user_agent"

    with your own credentials.

💡 Tip: Use something like "script:MyBot:1.0 (by u/YourRedditUsername)" for user_agent.


▶️ Usage

Autoposter

python autoposter.py
  • Starts cycling through folders and posting images.
  • Each successful post is logged.
  • If you stop it with CTRL + C, it will exit gracefully.

Duplicate Deletor

python duplicateDeletor.py
  • Generates duplicates.txt with duplicates.
  • Asks if you want to delete them (y/n).
  • Generates unpublished.txt showing local files not yet posted.

📁 Folder Structure

The scripts expect your project to look like this:

Reddit-Scripts/
│
├── autoposter.py
├── duplicateDeletor.py
├── autoposter.log
├── duplicates.txt
├── unpublished.txt
│
├── A/
├── H/
└── P/
  • Drop your images into one of the folders (A, H, P).
  • The script uses the folder name + file name as the Reddit post title.

Example: P/cat1.jpg → post titled “P cat1”


⚡️ How it works under the hood

  • Both scripts use PRAW, which is Reddit’s official API wrapper for Python.

  • autoposter.py:

    • Uses itertools.cycle to loop folders infinitely.
    • Submits images using profile.submit_image(...).
    • Randomizes delays to avoid spam-like behavior.
  • duplicateDeletor.py:

    • Collects all submissions from your account.
    • Groups them by title.
    • Writes duplicates to duplicates.txt.
    • Optionally deletes duplicates.
    • Scans your local folders to compare against posted titles.

✅ Requirements

  • Python 3.8+
  • praw

That’s it! No other dependencies needed.


About

A collection of Python automation scripts for publishing images to Reddit, detecting duplicate submissions, removing repeated posts, and tracking unpublished local files.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages