Skip to content

Commit 7e4e72b

Browse files
committed
Add comprehensive Reddit fetcher module with PRAW integration
This commit adds a complete Reddit post fetching module for video script generation: Features: - RedditFetcher class with PRAW integration for fetching posts - Fetch posts by ID, URL, or from subreddits - Extract comprehensive post data (title, body, comments, media, awards, metadata) - Configurable options for comment limits, sorting, and filtering - Media extraction support (images, videos, galleries, external links) - Clean text processing for video script generation - JSON export functionality - Custom error handling with specific exception types Files added: - reddit_fetcher.py: Main module with RedditFetcher class - reddit_config.py: Configuration file for API credentials and options - examples/reddit_fetcher_example.py: Comprehensive usage examples - REDDIT_FETCHER_README.md: Full documentation and usage guide - .env.example: Environment variable template - .gitignore: Git ignore file to protect credentials Dependencies: - Added praw>=7.7.1 for Reddit API access - Added prawcore>=2.3.0 for API core functionality - Added python-dotenv>=1.0.0 for environment variable support - Added requests>=2.31.0 for HTTP requests
1 parent 2ac6d64 commit 7e4e72b

File tree

7 files changed

+1361
-1
lines changed

7 files changed

+1361
-1
lines changed

.env.example

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Reddit API Configuration
2+
# Copy this file to .env and fill in your credentials
3+
4+
# Get these from https://www.reddit.com/prefs/apps
5+
REDDIT_CLIENT_ID=your_client_id_here
6+
REDDIT_CLIENT_SECRET=your_client_secret_here
7+
REDDIT_USER_AGENT=RedditVideoScript/1.0 (by /u/YourUsername)
8+
9+
# Optional: Customize fetch behavior
10+
# REDDIT_MAX_COMMENTS=10
11+
# REDDIT_COMMENT_SORT=best
12+
# REDDIT_MIN_COMMENT_SCORE=5

.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
pip-wheel-metadata/
20+
share/python-wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
25+
# Virtual environments
26+
venv/
27+
ENV/
28+
env/
29+
.venv
30+
31+
# IDE
32+
.vscode/
33+
.idea/
34+
*.swp
35+
*.swo
36+
*~
37+
38+
# Reddit API Credentials - IMPORTANT: Keep these private!
39+
.env
40+
reddit_config_local.py
41+
42+
# Downloaded media
43+
reddit_media/
44+
*.jpg
45+
*.png
46+
*.mp4
47+
*.gif
48+
49+
# Exported data
50+
reddit_post_*.json
51+
*.json
52+
53+
# OS
54+
.DS_Store
55+
Thumbs.db
56+
57+
# Logs
58+
*.log
59+
60+
# Model files (large)
61+
*.pth
62+
*.bin
63+
*.ckpt
64+
*.safetensors
65+
66+
# DeepSeek OCR specific
67+
DeepSeek-OCR-master/models/

0 commit comments

Comments
 (0)