Snowfl API Python Wrapper
This is an unofficial Python wrapper for the Snowfl API, inspired by the work of c0dysharma. Snowfl is a platform for searching and accessing torrent files. With this wrapper, you can programmatically search for torrents based on your queries and preferences.
Installation
To use this Snowfl API Python wrapper, you can install it using pip:
pip install snowfl
Usage
Initializing Snowfl
Before making API requests, you need to initialize the Snowfl instance by fetching the API key. This key is required to access the Snowfl API.
from snowfl import Snowfl, ApiError, FetchError
snowfl = Snowfl()
try:
snowfl.initialize()
except ApiError as e:
print(f"Error initializing Snowfl: {e}")
Searching Snowfl
You can use the parse method to search the Snowfl site for torrents. You need to provide a search query, and you can optionally specify various parameters to customize your search.
from pprint import pprint
try:
query = "JoJo"
sort = "MAX_SEED" # Sorting by maximum seeders
include_nsfw = False # Exclude NSFW content
result = snowfl.parse(query, sort=sort, include_nsfw=include_nsfw)
pprint(result)
except FetchError as e:
print(f"Error searching Snowfl: {e}")
Configuration
You can customize your search by specifying the following parameters:
query: The search query you want to use.sort: Sorting method for the search results. Available options:MAX_SEED: Sort by decreasing number of seed counts (default).MAX_LEECH: Sort by decreasing number of leech counts.SIZE_ASC: Sort by increasing size per file.SIZE_DSC: Sort by decreasing size per file.RECENT: Sort by recent torrents first.NONE: No sorting (Snowfl default).
include_nsfw: Include NSFW (Not Safe For Work) content in the search results. Set toTrueto include NSFW content;Falseby default.
Return Value
The parse method returns a dictionary with the following structure:
{
"status": <HTTP status code>,
"message": <status message>,
"data": [<array of objects>]
}
Example Responses
Found Something
{
"status": 200,
"message": "OK",
"data": [
{
"magnet": "magnet:?xt=urn:btih:F3B5014A2E048E9286163B3A6A9D95942F3D8F3B&tr=udp%3A%2F%2Ftracker",
"age": "12 months",
"name": "John Coltrane - Ole Coltrane [V0](Big Papi) Jazz Music",
"size": "86.92 MB",
"seeder": 2,
"leecher": 1,
"type": "Music",
"site": "****",
"url": "https://www.*****.info/John-Coltrane--Ole-Coltrane-[V0](Big-Papi)-Jazz-Music-torrent-4500787.html",
"trusted": False,
"nsfw": False
},
{
"magnet": "magnet:?xt=urn:btih:6f1fe981ab6624ef5c235278128c00d1c7ff534e&dn",
"age": "6 years",
"name": "John Newman Ft. Calvin Harris Ole MP3 Download, 2016",
"size": "9.41 MB",
"seeder": 1,
"leecher": 0,
"type": "Music",
"site": "****",
"url": "https://www.****.com/file/2742569/john-newman-ft.-calvin-harris-ole-mp3-download-2016/",
"trusted": False,
"nsfw": False
}
]
}
Nothing Found
{
"status": 200,
"message": "OK",
"data": []
}
Conclusion
This Python wrapper allows you to interact with the Snowfl API easily, making it convenient to search for torrents and customize your search preferences. Remember to handle exceptions and errors gracefully when using this wrapper in your applications.
Release files for snowfl 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snowfl-0.4.0.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snowfl-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / snowfl-0.4.0.tar.gz
| Download URL | snowfl-0.4.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11847e4ad71f8fe1f793e6fa2fe106c13a1c6cefdd3dc5dff1b3c658374fcbe7
|
|
BLAKE2b-256 checksum How to use checksums |
7a1947f9ea9f9e06dfacc748674b96aa374aaf51d7f332b6731746ac600bb979
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / snowfl-0.4.0-py3-none-any.whl
| Download URL | snowfl-0.4.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09c8e07770b918659b9170c0488accba8314aaf442c4304da5e83c28888893a4
|
|
BLAKE2b-256 checksum How to use checksums |
d117d56a64f6b9a15156b51c56c73c5202b3acc0e320af912da87a542db68c4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|