Skip to content

Commit

Permalink
🎨 Hardcode user_agents
Browse files Browse the repository at this point in the history
  • Loading branch information
nssharmaofficial committed Aug 7, 2024
1 parent 4519a02 commit 1bc30e3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ reddit-hole/
# .env
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_USER_AGENT="Accessing Reddit Threads"
REDDIT_USERNAME=
REDDIT_PASSKEY=
```
Expand Down
2 changes: 0 additions & 2 deletions assets/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ background='$BACKGROUND'
[RedditCredential]
client_id='$REDDIT_CLIENT_ID'
client_secret='$REDDIT_CLIENT_SECRET'
user_agent="$REDDIT_USER_AGENT"
username="$REDDIT_USERNAME"
passkey="$REDDIT_PASSKEY"
# ----------------------------------------------------------
Expand All @@ -15,7 +14,6 @@ aws_secret_access_key='$AWS_SECRET_ACCESS_KEY'
region_name='$AWS_REGION_NAME'
# ----------------------------------------------------------
[Reddit]
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
subreddit='AskReddit'
topn_comments=10
max_comment_length=300
Expand Down
2 changes: 1 addition & 1 deletion assets/database.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{"_default": {"1": {"id": "1e5tj19", "title": "I need some assistance on what I should do, I need some sort of revenge on this person from taking hundreds of dollars from me"}, "2": {"id": "1edgr0q", "title": "My mother slept with my boyfriend. "}, "3": {"id": "1ebc7q7", "title": "I outed my best friend for cheating on his girl, and now everyone in my friend group hates me."}, "4": {"id": "1echygt", "title": "Update to husband cheated with son's girlfriend "}, "5": {"id": "1e91rje", "title": "My wife (45f) has used her phone to hide a secret."}, "6": {"id": "1ech7yb", "title": "Cheating wife - why do I feel like this"}, "7": {"id": "1ee23ax", "title": "Wife of 4 years had an affair with my step-father"}, "8": {"id": "1ebbvi7", "title": "Giving my husband the open relationship he wanted after catching him cheating"}, "9": {"id": "1eb99ue", "title": "My ex-gf and my best friend cheated on me"}, "10": {"id": "1ebyv8f", "title": "Wife cheated and I'm somehow not that angry"}, "11": {"id": "1e9gkat", "title": "For the Americans voting in 2024 Election, does Kamala Harris get your vote? Why or why not?"}, "12": {"id": "1ebuk00", "title": "What illegal thing do you do on a regular basis?"}, "13": {"id": "1ed7l2o", "title": "What are some useful NSFW skills to know?"}, "14": {"id": "1ecl5vs", "title": "What is the most NSFW thing you\u2019ve actually done at work? "}, "15": {"id": "1ea3o1k", "title": "What do people not realize has an extremely low chance of happening?"}, "16": {"id": "1eb4p9d", "title": "What happened to the most attractive person in your HS/ college?"}, "17": {"id": "1edmbbq", "title": "What might men dislike the most if they were to become women?"}, "18": {"id": "1ee7g0a", "title": "What\u2019s a luxury that many people don\u2019t realize is a luxury?"}, "19": {"id": "1eefaaq", "title": "I made a huge mistake during my Bachelor Party Trip, my fiancee moved on, and I just want her back. Part 1"}, "20": {"id": "1edkjlw", "title": "My mom (24f) slept with my dad (29m)"}, "21": {"id": "1edthtq", "title": "My wife cheated"}, "22": {"id": "1e9m4b8", "title": "The Biden administration once called me out of kindness. "}, "23": {"id": "1ed2gsh", "title": "My mom cheated on my dad and thought it was his fault"}, "24": {"id": "1ea00cy", "title": "Today my mom fkd up by getting the cops called on my dad"}, "25": {"id": "1ecw82c", "title": "AITAH for not going along with my wife\u2019s friends stereotypes? "}, "26": {"id": "1ee1kja", "title": "Am I wrong? GF wants to be included in boys (sons) trip \ud83d\ude44"}, "27": {"id": "1ea23z1", "title": "What's your most money consuming hobby?"}, "28": {"id": "1ejzgf2", "title": "(NSFW) Reddit, what was your \u201cOh shit, this person is a psychopath\u201d moment when meeting people?"}, "29": {"id": "1ehfqga", "title": "What's a secret that you think would shock everyone if it came out?"}}}
1 change: 0 additions & 1 deletion utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def load_config() -> dict:

config['RedditCredential']['client_id'] = os.getenv('REDDIT_CLIENT_ID')
config['RedditCredential']['client_secret'] = os.getenv('REDDIT_CLIENT_SECRET')
config['RedditCredential']['user_agent'] = os.getenv('REDDIT_USER_AGENT')
config['RedditCredential']['username'] = os.getenv('REDDIT_USERNAME')
config['RedditCredential']['passkey'] = os.getenv('REDDIT_PASSKEY')

Expand Down
4 changes: 2 additions & 2 deletions utils/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def login() -> Reddit:
reddit = praw.Reddit(
client_id=my_config['RedditCredential']['client_id'],
client_secret=my_config['RedditCredential']['client_secret'],
user_agent=my_config['RedditCredential']['user_agent'],
user_agent="Accessing Reddit Threads",
username=my_config["RedditCredential"]["username"],
password=my_config["RedditCredential"]["passkey"],
check_for_async=False
Expand Down Expand Up @@ -154,7 +154,7 @@ def get_screenshots_of_reddit_posts(reddit_thread: Submission, reddit_comments:
color_scheme=theme,
viewport=ViewportSize(width=W, height=H),
device_scale_factor=dsf,
user_agent=my_config["RedditCredential"]["user_agent"]
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
)

with open(f"./assets/cookie-{theme}-mode.json", encoding="utf-8") as cookie_file:
Expand Down

0 comments on commit 1bc30e3

Please sign in to comment.