Skip to content

Commit 5d126f4

Browse files
committed
move USER_AGENTS to shared constants to avoid circular imports
1 parent 8d3c881 commit 5d126f4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

backend/scraping/instagram_feed.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@
3333
from services.storage_service import upload_image_from_url
3434
from utils.embedding_utils import find_similar_events
3535
from utils.events_utils import tz_compute
36-
37-
USER_AGENTS = [
38-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
39-
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
40-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
41-
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15",
42-
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
43-
]
36+
from shared.constants.user_agents import USER_AGENTS
4437

4538
MAX_POSTS = int(os.getenv("MAX_POSTS", "100"))
4639
MAX_CONSEC_OLD_POSTS = 10

backend/services/storage_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from PIL import Image
1818

1919
from scraping.logging_config import logger
20-
from backend.scraping.instagram_feed import USER_AGENTS
20+
from shared.constants.user_agents import USER_AGENTS
2121

2222

2323
class StorageService:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
USER_AGENTS = [
2+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
3+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
4+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
5+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15",
6+
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
7+
]

0 commit comments

Comments
 (0)