27 lines
895 B
Python
27 lines
895 B
Python
"""Reddit Super Duper Scraper Configuration."""
|
|
|
|
|
|
class Config:
|
|
"""Application configuration constants."""
|
|
|
|
# Reddit API base URLs (using old.reddit for better reliability)
|
|
REDDIT_SUBREDDIT_TOP_URL = "https://old.reddit.com/r/{}/top.json"
|
|
REDDIT_POST_COMMENTS_URL = "https://old.reddit.com/r/{}/comments/{}/.json"
|
|
|
|
# Pushshift.io API (fallback for comments without rate limits)
|
|
PUSHSHIFT_SEARCH_URL = "https://api.pushshift.io/reddit/search/submission/?ids={}&size=10"
|
|
PUSHSHIFT_COMMENT_URL = "https://api.pushshift.io/reddit/search/comment/?link_id=t3_{}&size=100"
|
|
|
|
# Default settings
|
|
DEFAULT_LIMIT = 10
|
|
DEFAULT_DEPTH = 3
|
|
MAX_DEPTH = 10
|
|
|
|
# Rate limiting (anonymous requests)
|
|
RATE_LIMIT_DELAY = 2.0 # seconds between requests
|
|
MAX_RETRIES = 3
|
|
|
|
# API server defaults
|
|
DEFAULT_HOST = "0.0.0.0"
|
|
DEFAULT_PORT = 8000
|