{"id":23628604,"url":"https://github.com/itz-fork/gofile2","last_synced_at":"2025-08-31T04:32:36.063Z","repository":{"id":37749381,"uuid":"408130216","full_name":"Itz-fork/Gofile2","owner":"Itz-fork","description":"An API Wrapper for Gofile API","archived":false,"fork":false,"pushed_at":"2024-01-05T10:49:54.000Z","size":82,"stargazers_count":27,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-29T07:37:09.442Z","etag":null,"topics":["gofile","gofile-api","python-api-wrapper"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/gofile2","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Itz-fork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-19T13:08:42.000Z","updated_at":"2024-11-06T07:27:37.000Z","dependencies_parsed_at":"2024-01-15T16:52:43.682Z","dependency_job_id":null,"html_url":"https://github.com/Itz-fork/Gofile2","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.28125,"last_synced_commit":"8024375d3af3182207c7b0f46b0352feaf3e7494"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itz-fork%2FGofile2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itz-fork%2FGofile2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itz-fork%2FGofile2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Itz-fork%2FGofile2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Itz-fork","download_url":"https://codeload.github.com/Itz-fork/Gofile2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231573618,"owners_count":18394551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gofile","gofile-api","python-api-wrapper"],"created_at":"2024-12-28T00:46:43.652Z","updated_at":"2024-12-28T00:46:44.189Z","avatar_url":"https://github.com/Itz-fork.png","language":"Python","readme":"# Gofile2\n```python\nfrom gofile2 import Gofile\n\ng_a = await Gofile.initialize()\nawait g_a.upload(\"/home/itz-fork/photo.png\")\nawait g_a.done()\n```\n***An API Wrapper for Gofile API.***\n\n\n\n# About API\n\u003e Gofile is in BETA version and this API will evolve over time. Check regularly if changes have been made.\n\u003e\nCurrent version is compatible with `2023-04-20`\n\n# Installation\nInstall via pypi\n[![Downloads](https://static.pepy.tech/badge/gofile2)](https://pypi.org/project/gofile2/)\n```python\npip3 install gofile2\n```\n\nTo install development version [Gofile2](https://github.com/Itz-fork/Gofile2), run the following command\n```python\npip install git+https://github.com/Itz-fork/Gofile2.git\n```\n\n# Usage\n**1. Import [Gofile2](https://github.com/Itz-fork/Gofile2) in your python file**\n\n**Asynchronous version**\n```python\nfrom gofile2 import Gofile\n```\n**Synchronous version**\n```python\nfrom gofile2 import Sync_Gofile\n```\n\n**2. Create an instance of Gofile2**\n\n**Asynchronous version**\n```python\ng_a = await Gofile.initialize()\n```\n**Synchronous version**\n```python\ng_a = Sync_Gofile()\n```\nAbove code will login as guest account. Keep in mind that only `get_server`, `upload` and `upload_folder` functions works in this mode. If you want to use other functions you will need to have a premium account (as of `2023-04-20`) token. If you need to login to your own account then pass your api token as `token` argument like below code.\n\n```python\ng_a = await Gofile.initialize(token=\"your_gofile_api_token_here\")\n```\n\n**3. Everything Done! Now Play with it!**\n```python\n# Get current server\nawait g_a.get_server()\n\n# Upload a folder\nawait g_a.upload_folder(path=\"path_to_your_folder\")\n\n# Upload a file\nawait g_a.upload(file=\"path_to_your_file\")\n\n# Get account info\nawait g_a.get_account()\n\n# Get content details\nawait g_a.get_content(contentId=\"id_of_the_file_or_folder\")\n\n# Create folder\nawait g_a.create_folder(parentFolderId=\"your_root_folder_id\", folderName=\"Folder Name\")\n\n# Set options\nawait g_a.set_option(contentId=\"id_of_the_contentr\", option=\"your_option\", value=\"your_value\")\n\n# Copy file or folder to another folder\nawait g_a.copy_content(contentsId=\"id_of_the_file_or_folder\", folderIdDest=\"id_of_the_destination_folder\")\n\n# Delete file or folder\nawait g_a.delete_content(contentsId=\"id_of_the_file_or_folder\")\n\n# After everything, send close Gofile client\nawait g_a.done()\n```\n\n# Docs\n- `initialize (token: Optional[str] = None) -\u003e Gofile`\n    - Create a Gofile2 object\n    - `token: Optional[str]` - The access token of an account. Can be retrieved from the profile page\n\n- `_api_request (method: str, endpoint: str, params: Optional[Dict[str, Any]] = None, data: Optional[FormData] = None, need_token: bool = True) -\u003e Dict[str, Any]`\n    - Make an API request to Gofile server\n    - `method: str` - The HTTP method to use for the request\n    - `endpoint: str` - The API endpoint to request\n    - `params: Optional[Dict[str, Any]]` - The query parameters to include in the request\n    - `data: Optional[FormData]` - The form data to include in the request\n    - `need_token: bool` - Whether a token is required for the request\n\n- `validate_token (token: str) -\u003e None`\n    - Validate gofile token\n    - `token: str` - The token to validate\n\n- `get_server () -\u003e str`\n    - Get the best server available to receive files\n\n- `get_account () -\u003e Dict[str, Any]`\n    - Get information about the account\n\n- `get_content (contentId: str) -\u003e Dict[str, Any]`\n    - Get information about the content\n    - `contentId: str` - The ID of the file or folder\n\n- `upload (file: str, folderId: str) -\u003e Dict[str, Any]`\n    - Upload a file to Gofile server\n    - `file: str` - Path to file that want to be uploaded\n    - `folderId: str` - The ID of a folder. If you're using the folderId, make sure that you initialize the Gofile class with a token\n\n- `upload_folder (path: str, folderId: Optional[str] = None, delay: int = 3) -\u003e List[Dict[str, Any]]`\n    - Upload a folder to Gofile server\n    - `path: str` - Path to folder that you want to be uploaded\n    - `folderId: Optional[str]` - The ID of a folder. If you're using the folderId, make sure that you initialize the Gofile class with a token\n    - `delay: int` - Time interval between file uploads (in seconds)\n\n- `create_folder (parentFolderId: str, folderName: str) -\u003e None`\n    - Create a new folder\n    - `parentFolderId: str` - The parent folder ID\n    - `folderName: str` - The name of the folder that wanted to create\n\n- `set_option (contentId: str, option: str, value: str) -\u003e None`\n    - Set an option on a content\n    - `contentId: str` - The content ID\n    - `option: str` - Option that you want to set. Can be \"public\", \"password\", \"description\", \"expire\" or \"tags\"\n    - `value: str` - The value of the option to be defined.\n\n- `copy_content (contentsId: str, folderIdDest: str) -\u003e None`\n    - Copy one or multiple contents to another folder\n    - `contentsId: str` - The ID(s) of the file or folder (Separate each one by comma if there are multiple IDs)\n    - `folderIdDest: str` - Destination folder ID\n\n- `delete_content (contentsId: str) -\u003e None`\n    - Delete one or multiple files/folders\n    - `contentsId: str` - The ID(s) of the file or folder (Separate each one by comma if there are multiple IDs)\n\n- `done () -\u003e None`\n    - Close the session\n\n_Automatically generated on 2024:01:05:13:41:40_\n\n\n## Thanks to\n- [gofile](https://github.com/Codec04/gofile) - Base Project \u0026 Inspiration ❤️ ([Gofile2](https://github.com/Itz-fork/Gofile2) is a Re-built version of this)\n- [Itz-fork](https://github.com/Itz-fork/) (me) - For Fixing \u0026 Improving this project","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitz-fork%2Fgofile2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitz-fork%2Fgofile2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitz-fork%2Fgofile2/lists"}