Skip to main content

Upload files to Gofile.io

Project description

gofile

๐Ÿš€ Python wrapper for gofile.io Upload API[^1].

Build PyPI version Supported Python versions PEP8

Requirements

โฌ‡๏ธ Installation

pip install gofilepy

โฌ†๏ธ Upgrade Existing Installation

pip install -U gofilepy

โŒจ๏ธ Usage

usage: gofilepy [-h] [-s] [-o] [-e] [-vv] [-v] path [path ...]

Example: gofile <file/folder_path>

positional arguments:
  path                  Path to the file(s) and/or folder(s)

options:
  -h, --help            show this help message and exit
  -s, --to-single-folder
                        Upload multiple files to the same folder. All files
                        will share the same URL. This option requires a valid
                        token exported as: `GOFILE_TOKEN`
  -o, --open-urls       Open the URL(s) in the browser when the upload is
                        complete (macOS-only)
  -e, --export          Export upload response(s) to a JSON file
  -vv, --verbose        Show more information

๐Ÿ“• Examples

Example 1: Uploading one file

โžœ gofile foo.txt
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ File: foo.txt                             โ”‚
โ”‚ Download page: https://gofile.io/d/PkdZP5 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Uploading progress: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% 0:00:00

Example 2: Uploading multiple files/directories

โžœ gofile foo.txt bar.txt foobar.txt foo/
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ File: foo.txt                             โ”‚
โ”‚ Download page: https://gofile.io/d/rLwQVZ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ File: bar.txt                             โ”‚
โ”‚ Download page: https://gofile.io/d/DdS7mZ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ File: foobar.txt                          โ”‚
โ”‚ Download page: https://gofile.io/d/C1VicP โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ File: foo/foo_1.txt                       โ”‚
โ”‚ Download page: https://gofile.io/d/CkYw18 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Uploading progress: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% 0:00:00

Example 3: Uploading multiple files to the same URL

This option requires a Gofile token (see: ## Misc.).

โžœ gofile -s foo.txt bar.txt
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Files:                                    โ”‚
โ”‚ foo.txt                                   โ”‚
โ”‚ bar.txt                                   โ”‚
โ”‚ Download page: https://gofile.io/d/bFwawd โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Uploading progress: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% 0:00:00

Example 4: Verbose output

โžœ gofile -vv foo.txt
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ {                                                                            โ”‚
โ”‚   "foo.txt": {                                                               โ”‚
โ”‚     "timestamp": "30-05-2022 18:42:15",                                      โ”‚
โ”‚     "response": {                                                            โ”‚
โ”‚       "status": "ok",                                                        โ”‚
โ”‚       "data": {                                                              โ”‚
โ”‚         "guestToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",                    โ”‚
โ”‚         "downloadPage": "https://gofile.io/d/sU4hV1",                        โ”‚
โ”‚         "code": "sU4hV1",                                                    โ”‚
โ”‚         "parentFolder": "7ad2d249-96a1-4675-b185-05665fbc9a46",              โ”‚
โ”‚         "fileId": "0e93e093-d122-4e42-a1be-2e7d34d78ffb",                    โ”‚
โ”‚         "fileName": "foo.txt",                                               โ”‚
โ”‚         "md5": "d41d8cd98f00b204e9800998ecf8427e"                            โ”‚
โ”‚       }                                                                      โ”‚
โ”‚     }                                                                        โ”‚
โ”‚   }                                                                          โ”‚
โ”‚ }                                                                            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Uploading progress: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% 0:00:00

Example 5: Exporting the API response to a JSON file

โžœ gofile -e foo.txt
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ File: foo.txt                             โ”‚
โ”‚ Download page: https://gofile.io/d/8t79Lz โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Uploading progress: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% 0:00:00
Exported data to: gofile_export_1653950555.json
Content of gofile_export_1653950555.json
[
    {
        "foo.txt": {
            "timestamp": "30-05-2022 18:42:35",
            "response": {
                "status": "ok",
                "data": {
                    "guestToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                    "downloadPage": "https://gofile.io/d/8t79Lz",
                    "code": "8t79Lz",
                    "parentFolder": "05xd4cb-8965-417f-ae34-a116et99b798",
                    "fileId": "d1fc3a97-8xe3-486a-bc0d-edb1rb103040",
                    "fileName": "foo.txt",
                    "md5": "d41d8cd99f00b204e9810998ecf8427e"
                }
            }
        }
    }
]

Misc.

๐Ÿ”‘ Optional: Saving uploads to your Gofile account

If you want the files to be uploaded to a specific account, you can export your gofile token, which can be retrieved from the profile page, as an environment variable GOFILE_TOKEN.

export GOFILE_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

[^1]: Disclaimer: This tool is not associated with Gofile, WOJTEK SAS ยฉ, or the Gofile Team.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gofilepy-0.3.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

gofilepy-0.3.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file gofilepy-0.3.3.tar.gz.

File metadata

  • Download URL: gofilepy-0.3.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.8 Darwin/23.5.0

File hashes

Hashes for gofilepy-0.3.3.tar.gz
Algorithm Hash digest
SHA256 bf7afb431a74fff1932e7769b3aba92a4268c30bf980f23ac89364ffa42e3db4
MD5 b43f0dc4732ffb78a282525e229453a9
BLAKE2b-256 44d6bf42de2e75c944a01aa1bd0a57ebe4320aac9ed556dab1f1896e208af1d9

See more details on using hashes here.

File details

Details for the file gofilepy-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: gofilepy-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.8 Darwin/23.5.0

File hashes

Hashes for gofilepy-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d482bd6bb28f2e4ffeaa08cce91516bb7f3c92466c81741ade18896e8919dff
MD5 62e96fad54f20c9c1e311dae124f2ae6
BLAKE2b-256 23dd43fd661eead7a453aa1c9d979880d5e4df3195064b5a3d7a46a2fb5f4b99

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page