Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scrazzz/redgifs
Simple Python API wrapper for the RedGIFs API
https://github.com/scrazzz/redgifs
aiohttp async asyncio cli cli-downloader easy-to-use nsfw python python3 redgifs redgifs-downloader requests sync
Last synced: about 23 hours ago
JSON representation
Simple Python API wrapper for the RedGIFs API
- Host: GitHub
- URL: https://github.com/scrazzz/redgifs
- Owner: scrazzz
- License: mit
- Created: 2022-03-02T14:50:42.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T00:39:46.000Z (18 days ago)
- Last Synced: 2025-01-11T09:08:05.453Z (8 days ago)
- Topics: aiohttp, async, asyncio, cli, cli-downloader, easy-to-use, nsfw, python, python3, redgifs, redgifs-downloader, requests, sync
- Language: Python
- Homepage: https://redgifs.rtfd.io
- Size: 912 KB
- Stars: 101
- Watchers: 5
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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]`
```console
$ 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:
```console
$ # 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
``````console
$ # 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...
``````console
$ # 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 GIFsDownloaded 3/3 videos of "usernamethatexists" to rg_vids folder sucessfully
```#### 2. Synchronous usage:
```py
import redgifsapi = redgifs.API()
api.login() # Login with temporary token
response = api.search('3D')
print(response)
api.close()
```#### 3. Asynchronous usage:
```py
import asyncio
from redgifs.aio import API # note thisasync 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
- [Documentation](https://redgifs.readthedocs.io)
- [Discord](https://discord.gg/NtAJMCcTd4)
- [Examples](https://github.com/scrazzz/redgifs/tree/main/examples)