import requests import os import time API_URL = "https://api.gofile.io"
C:\Users\Public\Documents\Reports ./photos/vacation /var/log/backups Save it in the same directory as your script. This script reads each folder path, uploads it to GoFile using their free API, and writes the folder link to output_links.txt .
def create_folder(): # Step 1: Get a guest account (free, no email) resp = requests.get(f"API_URL/accounts") guest_token = resp.json()["data"]["token"] headers = "Authorization": f"Bearer guest_token" filedot folder link ams txt free
def main(): input_txt = "folder_paths.txt" output_txt = "output_links.txt"
/home/user/projects/design /home/user/projects/videos ./backup_2025 import requests import os import time API_URL = "https://api
C:\Users\Public\Documents\Reports -> https://gofile.io/d/XYzw98Q ./photos/vacation -> https://gofile.io/d/AbC123x /var/log/backups -> https://gofile.io/d/9zXy78q These are your “filedot folder links” (replace FileDot with GoFile in this implementation). Share them freely. If GoFile doesn’t suit your needs, here are other free combinations: Using Rclone + .txt + Free Cloud Storage Rclone (open-source) can sync folders to Google Drive or Dropbox free tier (15GB). Create a folder_list.txt and run:
with open(output_txt, "w") as out: for folder in folders: if os.path.isdir(folder): print(f"Processing folder: folder") link = upload_folder(folder) out.write(f"folder -> link\n") print(f"Link saved: link") else: out.write(f"folder -> ERROR: Folder not found\n") Share them freely
# Step 2: Create a new folder folder_resp = requests.post(f"API_URL/contents/folder", headers=headers) folder_id = folder_resp.json()["data"]["folderId"] return folder_id, headers def upload_file_to_folder(folder_id, file_path, headers): url = f"API_URL/contents/folder_id/file" with open(file_path, "rb") as f: files = "file": f response = requests.post(url, headers=headers, files=files) return response.json()