async-gfycat 1.0.2

Last updated:

0 purchases

async-gfycat 1.0.2 Image
async-gfycat 1.0.2 Images
Add to Cart

Description:

asyncgfycat 1.0.2

Async Gfycat
An async Python wrapper for the Gfycat API.
based on py-gfycat a sync wrapper
(api endpoints of py-gfycat are outdated as of 0.2.2)




Installation
pip install -U async-gfycat

Gfycat API Key
Go to https://developers.gfycat.com/signup/#/apiform and sign up for an API key if you don't already have one.
You need the Client ID and Client Secret to use for initializing the Python client.
Getting Started
from async_gfycat.client import GfycatClient

client = GfycatClient(clientid, secret)

# Example request
await client.upload_from_file('willsmith.gif', title='willsmith slap')

you can also use username and password authentication with
client = GfycatClient(clientid, secret, username, password)

Error Handling

GfycatClientError - General error handler, access message and status code and the response dict with

from gfycat.error import GfycatClientError
from pprint import pprint

try
...
except GfycatClientError as e
print(e.error_message)
print(e.status_code)
pprint(e.response_data)

GfycatClient Class Methods
Uploads

upload_from_url(url)
upload_from_file(filepath)


Warning: using check_upload() immediately after uploading a file may
result in a NotFoundo response, in that case waiting a moment will fix the issue, this is an api issue not a client one

Query a GFY for URLs and more information

query_gfy(gfyname)

Check if an upload has been converted

check_upload(link)

all methods return coros and need to be awaited

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.