Async and Sync Python Wrapper for the RedGIFs API.
Project description
redgifs
Async and Sync Python Wrapper for the RedGIFs API.
⭐ Please star this repo to support the developer and to encourage the development of this project!
Installation
pip install -U redgifs
Development version
pip install -U git+https://github.com/scrazzz/redgifs
redgifs
works on Python versions 3.8 and above.
Quickstart
1. Command Line:
Install: pip install redgifs[cli]
$ redgifs --help
Usage: redgifs [OPTIONS] [URLS]...
Options:
-q, --quality [sd|hd] Video quality of GIF to download. [default: hd]
-d, --dir FOLDER_NAME The folder/directory to save the downloads to.
-i, --input PATH Download URLs from a newline seperated txt file.
--help Show this message and exit.
Examples:
$ # Download files to a folder
$ ls
Home Downloads Homework Music
Backup Documents Videos Games
$ redgifs https://redgifs.com/watch/xyz --q sd --dir Homework
Downloading xyz...
Download complete
$ ls Homework
xyz.mp4
$ # Download GIFs from a file that contains a list of URLs
$
$ # urls.txt:
$ # https://redigfs.com/watch/xyz
$ # https://redigfs.com/watch/qwe
$ # https://redigfs.com/watch/abc
$ # https://redigfs.com/watch/rst
$ redgifs -i urls.txt
Downloading xyz...
Download complete
Downloading qwe...
$ # Download all GIFs from a user's profile
$ mkdir rg_vids
$ redgifs https://redgifs.com/users/usernamethatexists -d rg_vids
Downloaded 1/3 GIFs
Downloaded 2/3 GIFs
Downloaded 3/3 GIFs
Downloaded 3/3 videos of "usernamethatexists" to rg_vids folder sucessfully
2. Synchronous usage:
import redgifs
api = redgifs.API()
api.login() # Login with temporary token
response = api.search('3D')
print(response)
api.close()
3. Asynchronous usage:
import asyncio
from redgifs.aio import API # note this
async def main():
api = API()
await api.login() # Login with temporary token
response = await api.search('3D')
print(response)
await api.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
More examples can be found in the examples directory.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
redgifs-1.9.5.tar.gz
(106.5 kB
view details)
Built Distribution
redgifs-1.9.5-py3-none-any.whl
(118.9 kB
view details)
File details
Details for the file redgifs-1.9.5.tar.gz
.
File metadata
- Download URL: redgifs-1.9.5.tar.gz
- Upload date:
- Size: 106.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08d9e9506356ab65ee8a6306f581b16cb55953e5953ee5c21b1a866dc723c849 |
|
MD5 | 68fa0143bccd94761e873582c6c6d2a4 |
|
BLAKE2b-256 | 4d060b74898033db09b54e5a322e785432ec887828fc3f05c3f64a5bd5c708e7 |
File details
Details for the file redgifs-1.9.5-py3-none-any.whl
.
File metadata
- Download URL: redgifs-1.9.5-py3-none-any.whl
- Upload date:
- Size: 118.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6d5836cd089f2714a66f02abc078a8a8e49d84b52020940e10da9c02ec07f4c |
|
MD5 | 2818fcf3c1131f33ebe1da031d992d09 |
|
BLAKE2b-256 | 9d106e2613a8425b92dd73a8af961b8b948e0632e368e5ef2a79f745d5c7876e |