from google.cloud import storage import firebase_admin from firebase_admin import credentials try: cred = credentials.Certificate("servicekey.json") try: firebase_admin.initialize_app( cred, {"databaseURL": "https://farmbase-b2f7e-31c0c.firebaseio.com/"} ) except: print("fire running") except: abs = 1 def generate_shareable_url(bucket_name, folder_path, credentials_path): # Initialize a client using the provided credentials #client = storage.Client.from_service_account_json(credentials_path) client = storage.Client() # Get the bucket and folder objects bucket = client.bucket(bucket_name) folder_blob = bucket.blob(folder_path) # Generate a signed URL for the folder folder_url = folder_blob.generate_signed_url( version="v4", expiration=None, # Change this to set an expiration time method="GET" ) return folder_url # Replace these with your values bucket_name = "farmbase-b2f7e.appspot.com" folder_path = "PaidMonitoredFieldsPolygons/TCXcp5VIsfhHZrh0nm2VsgBtcGy2" credentials_path = cred shareable_url = generate_shareable_url(bucket_name, folder_path, credentials_path) print("Shareable URL:", shareable_url)