Skip to content

Commit

Permalink
Upgrade to version 0.2.0 (major changes)
Browse files Browse the repository at this point in the history
Alyetama committed May 30, 2022
1 parent ff39239 commit 6373df3
Showing 10 changed files with 388 additions and 153 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/poetry-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
push:
pull_request:

jobs:
ci:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, 3.10]
poetry-version: [1.1.13]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Build module
run: poetry build
69 changes: 65 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
@@ -50,6 +49,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
@@ -72,6 +72,7 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
@@ -82,7 +83,9 @@ profile_default/
ipython_config.py

# pyenv
.python-version
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@@ -91,7 +94,22 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
@@ -128,5 +146,48 @@ dmypy.json
# Pyre type checker
.pyre/

# System files
# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# Poetry
poetry.lock

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Other
.DS_Store
.AppleDouble
.LSOverride
*.log
logs/
*.out
141 changes: 135 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,143 @@
# Gofile

**Disclaimer: This tool is not associated with Gofile, WOJTEK SAS ©, or Gofile Team.**
🚀 Python wrapper for Gofile.io Upload API[^1].

[![Supported Python versions](https://img.shields.io/badge/Python-%3E=3.6-blue.svg)](https://www.python.org/downloads/) [![PEP8](https://img.shields.io/badge/Code%20style-PEP%208-orange.svg)](https://www.python.org/dev/peps/pep-0008/)


## Requirements
- 🐍 [python>=3.6](https://www.python.org/downloads/)


## ⬇️ Installation

## Installation:
```sh
$ git clone https://github.com/Alyetama/Gofile.git
$ cd Gofile && bash install.sh
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
```

### 🔑 Uploading to an account using access token

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.

## Usage:
```sh
$ gofile -f <file_path>
export GOFILE_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
```


## 📕 Examples

### Example 1
```sh
➜ gofile foo.txt
╭───────────────────────────────────────────╮
│ File: foo.txt │
│ Download page: https://gofile.io/d/PkdZP5 │
╰───────────────────────────────────────────╯
Uploading progress: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
```

### Example 2
```bash
➜ 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
```sh
➜ 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
```sh
➜ 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`:
```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"
}
}
}
}
]
```
[^1]: **Disclaimer: This tool is not associated with Gofile, WOJTEK SAS ©, or Gofile Team.**
16 changes: 0 additions & 16 deletions add_account.py

This file was deleted.

Loading
Oops, something went wrong.

0 comments on commit 6373df3

Please sign in to comment.