Skip to content

Commit 68a5918

Browse files
committed
Remove proxy, add random delay
• Removed INSTAGRAM_PROXY from workflow and instagram.py • Added random 0-33 min delay to randomize post timing
1 parent f86365e commit 68a5918

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/rescuegroups-api.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ jobs:
3636
INSTAGRAM_PASSWORD: ${{ secrets.INSTAGRAM_PASSWORD }}
3737
BLUESKY_HANDLE: ${{ secrets.BLUESKY_HANDLE }}
3838
BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
39-
INSTAGRAM_PROXY: ${{ secrets.INSTAGRAM_PROXY }}
4039
run: python ./main.py

social_posters/instagram.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
import requests
77
from instagrapi import Client
8+
import random
9+
import time
10+
11+
rand = random.randint(0, 2000)
12+
13+
time.sleep(rand)
14+
15+
816

917
from abstractions import Post, PostResult, SocialPoster
1018

@@ -23,10 +31,6 @@ def platform_name(self) -> str:
2331
def authenticate(self) -> bool:
2432
try:
2533
self._client = Client()
26-
# Use proxy if available to maintain a consistent IP, running on a private VPS using a proxy service so lowkey gonna need a better fix
27-
proxy = os.environ.get("INSTAGRAM_PROXY")
28-
if proxy:
29-
self._client.set_proxy(proxy)
3034
session_file = Path("ig_session.json")
3135
# Reuse saved session to avoid repeated logins, as per instagrapi best practices
3236
if session_file.exists():

0 commit comments

Comments
 (0)