-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🛩️🌚 ↝ [SSP-31 SSP-15]: Extracting all media
- Loading branch information
1 parent
83c291a
commit 7e81938
Showing
62 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file added
BIN
+382 KB
content/media/1728134492983-fa07195a-f69e-4cbb-a11a-a3e993e49d14-Coastline Aerial.avif
Binary file not shown.
Binary file added
BIN
+154 KB
content/media/1728135332883-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.06 KB
content/media/1728136550422-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.97 KB
content/media/1728136636588-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.19 KB
content/media/1728136939831-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.02 KB
content/media/1728137124705-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.11 KB
content/media/1728137392051-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.3 KB
content/media/1728214612210-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+264 KB
content/media/1729343605288-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+261 KB
content/media/1729343895649-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+262 KB
content/media/1729344868410-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+262 KB
content/media/1729344870943-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+262 KB
content/media/1729344981717-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+262 KB
content/media/1729345007700-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+339 KB
content/media/1730620648559-fa07195a-f69e-4cbb-a11a-a3e993e49d14-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import os | ||
from supabase import create_client, Client | ||
|
||
def init_supabase_client(): | ||
url = "http://127.0.0.1:54321" | ||
key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0" | ||
return create_client(url, key) | ||
|
||
def fetch_files_from_bucket(supabase: Client, bucket_name: str): | ||
storage = supabase.storage.from_(bucket_name) | ||
response = storage.list() | ||
return response # This returns a list of files directly | ||
|
||
def download_file_from_bucket(supabase: Client, bucket_name: str, file_name: str, download_path: str): | ||
storage = supabase.storage.from_(bucket_name) | ||
print(f"Attempting to download: {bucket_name}/{file_name}") | ||
try: | ||
file_data = storage.download(file_name) | ||
with open(download_path, 'wb') as file: | ||
file.write(file_data) | ||
print(f"Downloaded {file_name} to {download_path}") | ||
except Exception as e: | ||
print(f"Error downloading {file_name}: {e}") | ||
|
||
def create_directory_for_bucket(bucket_name: str): | ||
directory_path = os.path.join(os.getcwd(), bucket_name) | ||
if not os.path.exists(directory_path): | ||
os.makedirs(directory_path) | ||
return directory_path | ||
|
||
def download_files_from_buckets(supabase: Client, bucket_names: list): | ||
for bucket_name in bucket_names: | ||
print(f"Processing bucket: {bucket_name}") | ||
files = fetch_files_from_bucket(supabase, bucket_name) | ||
bucket_directory = create_directory_for_bucket(bucket_name) | ||
for file in files: | ||
file_name = file['name'] | ||
download_path = os.path.join(bucket_directory, file_name) | ||
try: | ||
print(f"Downloading file: {file_name} to {download_path}") | ||
download_file_from_bucket(supabase, bucket_name, file_name, download_path) | ||
except Exception as e: | ||
print(f"Error downloading {file_name}: {e}") | ||
print(f"Finished downloading files from bucket: {bucket_name}\n") | ||
|
||
def main(): | ||
supabase = init_supabase_client() | ||
bucket_names = ['anomalies', 'zoodex', 'media', 'avatars', 'clouds', 'telescope'] | ||
download_files_from_buckets(supabase, bucket_names) | ||
|
||
if __name__ == "__main__": | ||
main() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.