+1
README.md
+1
README.md
+3
-3
src/bsky_api.py
+3
-3
src/bsky_api.py
···
1
1
from atproto import IdResolver, Client
2
2
import os
3
-
import dotenv
4
3
import logging
5
4
6
5
# Ensure the log directory exists
···
17
16
18
17
def login(handle_env_var, app_pass_env_var):
19
18
try:
20
-
dotenv.load_dotenv()
21
19
handle = os.getenv(handle_env_var)
22
20
app_pass = os.getenv(app_pass_env_var)
21
+
host_url = os.getenv("BSKY_HOST_URL", "https://bsky.social")
22
+
23
+
client = Client(host_url)
23
24
24
25
if not handle or not app_pass:
25
26
logging.error("Handle or app password missing in environment variables.")
26
27
raise ValueError("Handle or app password missing in environment variables")
27
28
28
29
logging.debug("Attempting to log in with handle: %s", handle)
29
-
client = Client()
30
30
client.login(handle, app_pass) # Access credentials securely
31
31
32
32
logging.info("Login successful for handle: %s", handle)