An API Wrapper for Gofile API

Overview

Gofile2

from gofile2 import Gofile

g_a = Gofile()
print(g_a.upload(file="/home/itz-fork/photo.png"))

An API Wrapper for Gofile API.

About API

Gofile is in BETA version and this API will evolve over time. Check regularly if changes have been made.

Current version is compatible with 2021-06-22

Installation

Install via pypi

pip3 install gofile2

To install development version Gofile2, run the following command

pip install git+https://github.com/Itz-fork/Gofile2.git

Usage

1. Import Gofile2 in your python file

from gofile2 import Gofile

2. Create an instance of Gofile2

g_a = Gofile()

Above code will login as guest account (Some functions won't work in this mode). If you need to login to your own account then pass your api token as token argument like below code.

g_a = Gofile(token="your_gofile_api_token_here")

3. Everything Done! Now Play with it!

# Get current server
g_a.get_Server()

# Get account info
g_a.get_Account()

# Upload a file
g_a.upload(file="path_to_your_file")

# Create folder
g_a.create_folder(parentFolderId="your_root_folder_id", folderName="Folder Name")

# Set folder options
g_a.set_folder_options(folderId="id_of_the_folder", option="your_option", value="your_value")

# Delete file or folder
g_a.delete_content(contentId="id_of_the_file_or_folder")

Docs

For now there is no documentation for Gofile2. However you can get some help from Docstrings using,

from gofile2 import Gofile

print(help(Gofile().upload))

Thanks to

  • gofile - Base Project & Inspiration ❤️ (Gofile2 is a Re-built version of this)
  • Itz-fork (me) - For Fixing & Improving this project
You might also like...
A simple API wrapper for the Tenor API

Gifpy A simple API wrapper for the Tenor API Installation Python 3.9 or higher is recommended python3 -m pip install gifpy Clone repository: $ git cl

A Python API wrapper for the Twitter API!

PyTweet PyTweet is an api wrapper made for twitter using twitter's api version 2! Installation Windows py3 -m pip install PyTweet Linux python -m pip

Python API wrapper library for Convex Value API

convex-value-python Python API wrapper library for Convex Value API. Further Links: Convex Value homepage @ConvexValue on Twitter JB on Twitter Authen

An API wrapper around Discord API.

NeoCord This project is work in progress not for production use. An asynchronous API wrapper around Discord API written in Python. Features Modern API

This an API wrapper library for the OpenSea API written in Python 3.

OpenSea NFT API Python 3 wrapper This an API wrapper library for the OpenSea API written in Python 3. The library provides a simplified interface to f

YARSAW is an Async Python API Wrapper for the Random Stuff API.

Yet Another Random Stuff API Wrapper - YARSAW YARSAW is an Async Python API Wrapper for the Random Stuff API. This module makes it simpler for you to

A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key).

fulltmdb A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key). Installation Use the package manager pip t

EpikCord.py - This is an API Wrapper for Discord's API for Python

EpikCord.py - This is an API Wrapper for Discord's API for Python! We've decided not to fork discord.py and start completely from scratch for a new, better structuring system!

An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% API coverage Most of the codebase is documented

Comments
  • folder upload

    folder upload

    Hello, I encountered the following error while uploading a folder. I was using venv and I redacted full paths in the error log below.

    Traceback (most recent call last):
      File "...\lib\site-packages\gofile2\gofile2.py", line 144, in upload
        return self._api_resp_handler(upload_file)
      File "...\lib\site-packages\gofile2\gofile2.py", line 37, in _api_resp_handler
        raise ResponseError(error)
    gofile2.errors.ResponseError: parentFolder
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "...\gofile.io\test.py", line 10, in <module>
        g_a.upload_folder(path="test_folder/test_folder_2pic")
      File "...\lib\site-packages\gofile2\gofile2.py", line 101, in upload_folder
        udt = self.upload(file, folderId)
      File "...\lib\site-packages\gofile2\gofile2.py", line 146, in upload
        raise JobFailed(
    gofile2.errors.JobFailed: Error Happend: Error Happend: parentFolder
    
    Report this at ----> https://github.com/Itz-fork/Gofile2/issues
    
    Report this at ----> https://github.com/Itz-fork/Gofile2/issues
    

    My thoughts: There is no mechanism to upload a folder to the server. They suggest uploading a file once and with using the id of the automatically created folder, uploading other files sequentially. Did you realize this mechanism or I am missing something?

    Thank you for the lib.

    opened by h-enes-simsek 2
  • Program doesn't preserve the folder structure

    Program doesn't preserve the folder structure

    This is actually almost not an issue, but a feature. I don't know if you want to add a feature to support recursive folder upload.

    At the moment assume you have a folder like this: _ parent ___ pic1.jpg ___ child _____ pic2.jpg

    And you upload the parent folder to gofile server. It ends up like this in the gofile server: _ longBoringGenericName _ pic1.jpg _ pic2.jpg

    So it does not preserve the folder structure. I don't need it personally but this feature could be added.

    Thank you for your effort to open source.

    opened by h-enes-simsek 0
  • fix import error and fix syntax error in strftime function

    fix import error and fix syntax error in strftime function

    There is a problem with the new version. You successfully solve the folder uploading problem but somehow made a syntax mistake. v1.4.3 code cannot be compiled at the moment. I fix the problem. Briefly:

    • You want to use time.sleep(x) but you import time wrongly
    • You mistakenly write %l instead of %I in strftime function. ( /L/ouisiana instead of /I/ndiana )

    Thank you for the nice lib.

    opened by h-enes-simsek 0
  • RuntimeWarning: Enable tracemalloc to get the object allocation traceback

    RuntimeWarning: Enable tracemalloc to get the object allocation traceback

    C:\Users\MSI\AppData\Roaming\JetBrains\PyCharmCE2022.2\scratches\testtt.py:7: RuntimeWarning: coroutine 'Async_Gofile.get_Account' was never awaited print(g_a.get_Account()) RuntimeWarning: Enable tracemalloc to get the object allocation traceback <coroutine object Async_Gofile.get_Account at 0x00000217AEF70CF0>

    Process finished with exit code 0

    opened by Tux-MacG1v 0
Releases(Gofile2-v1.4.3)
Owner
I'm Not A Bot #Left_TG
Everything is impossible until You use Your Brain
I'm Not A Bot #Left_TG
A telegram media to gofile bot

GoFile-Bot A telegram media to gofile bot Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License -> https://github.com/Fay

Fayas Noushad 37 Nov 14, 2022
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
A wrapper for slurm especially on Taiwania2 (HPC CLI)A wrapper for slurm especially on Taiwania2 (HPC CLI)

TWCC-slurm-wrapper A wrapper for slurm especially on Taiwania2 (HPC CLI). For Taiwania2 (HPC CLI) usage, please refer to here. (中文) How to Install? gi

Chi-Liang, Liu 5 Oct 7, 2022
Discord-Wrapper - Discord Websocket Wrapper in python

This does not currently work and is in development Discord Websocket Wrapper in

null 3 Oct 25, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
Python API wrapper around Trello's API

A wrapper around the Trello API written in Python. Each Trello object is represented by a corresponding Python object. The attributes of these objects

Richard Kolkovich 904 Jan 2, 2023
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% api coverage most of the codebase is documented

null 7 Dec 11, 2022
Async ready API wrapper for Revolt API written in Python.

Mutiny Async ready API wrapper for Revolt API written in Python. Installation Python 3.9 or higher is required To install the library, you can just ru

null 16 Mar 29, 2022