/python-nozomi

Nozomi.la API for Python

Primary LanguagePythonMIT LicenseMIT

python-nozomi

Build Status Codacy Badge PyPI version Python version

nozomi.la API in Python.

Features

  • Retrieving image and video posts
  • Downloading posts

Installation

$ pip install python-nozomi

Upgrade

$ pip install python-nozomi --upgrade

Example Usage

Retrieve and download a single post provided a URL

from pathlib import Path
from nozomi import api

url = 'https://nozomi.la/post/26905532.html#veigar'

# Retrieve post metadata using the URL
post = api.get_post(url)

# Download the post
api.download_media(post, Path.cwd())

Retrieve and download all posts containing certain tags

# The tags that the posts retrieved must contain
positive_tags = ['veigar', 'wallpaper']

# Gets all posts with the tags 'veigar', 'wallpaper'
for post in api.get_posts(positive_tags):
    api.download_media(post, Path.cwd())

Retrieve all posts containing certain tags with blacklisted tags

# The blacklisted tags
negative_tags = ['chogath']

# Gets all posts with the tags 'veigar', 'wallpaper' but no 'chogath' tag.
for post in api.get_posts(positive_tags, negative_tags):
    api.download_media(post, Path.cwd())