Upload files to Gofile.io
Project description
gofile
๐ Python wrapper for gofile.io Upload API[^1].
Requirements
- ๐ python>=3.6
โฌ๏ธ Installation
pip install gofilepy
โจ๏ธ Usage
โ gofile --help
usage: gofile [-h] [-o] [-e] [-vv] [-v] path [path ...]
Example: gofile <file/folder_path>
positional arguments:
path Path to the file(s) and/or folder(s)
optional arguments:
-h, --help show this help message and exit
-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
-v, --version Show program's version number and exit
๐ 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: Verbose output
โ gofile foo.txt -vv
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ { โ
โ "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 4: Exporting the API response to a JSON file
โ gofile foo.txt -e
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ 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.
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.2.2.tar.gz
(4.8 kB
view hashes)