Code Monkey home page Code Monkey logo

pynyaav2's Introduction

pyNyaav2 - A Nyaa v2 API wrapper.

Easy to use API wrapper for anyone.

Python Version License Requirements

Installation

pip install git+https://github.com/noaione/pyNyaav2

or

git clone https://github.com/noaione/pyNyaav2
cd pyNyaav2
python setup.py install

Requirements

  • Python 3.5 or better
  • Requests
  • BeautifulSoup4

(Requests and Beautifulsoup4 will be installed automatically if you use pip command)

Usage

Using cmd (Upload):

nyaav2 -m upload -U USER -P PASS -i myfile.torrent --category anime_raw --description "My test upload using pyNyaav2" --anonymous --hidden

Will upload myfile.torrent with description plus upload it as Anonymous and Hidden.

For Sukebei, put --sukebei/-nsfw

Using cmd (Search):

nyaav2 -m search -U USER -P PASS -i "hataraku saibou" --category all

Will search "hataraku saibou" in all category

For Sukebei, put --sukebei/-nsfw

Full help (cmd: nyaav2 -h):

usage: nyaav2 [-h] --mode [{search,upload}] --sukebei/-nsfw --username USER --password PASSW
              --input TORKEY
              [--category {all,anime,amv,anime_eng,anime_non-eng,anime_raw,audio,audio_lossless,audio_lossy,books,books_eng,books_non-eng,books_raw,live_action,la_eng,la_idolpv,la_non-eng,la_raw,pictures,pics_graphics,pics_photos,softwaree,sw_apps,sw_games,art,art_anime,art_doujinshi,art_games,art_manga,art_pics,real_life,real_pics,real_videos}]
              [--name NAME] [--information INFO] [--description DESC]
              [--anonymous] [--hidden] [--remake] [--trusted]

As a module (Upload):

import pyNyaav2

UNAME = 'User'
PASSW = 'SecretPass'
CATEG = 1_2 #This is Anime English-translated, you can also type 'anime_eng', scroll to the very bottom for reference

description = """
**My test upload to Nyaa.si**

Note: This is an automated upload by [pyNyaav2](https://github.com/noaione/pyNyaav2)
"""
#for Sukebei, change set_opts to set_opts_sukebei
opts = pyNyaav2.set_opts(username=UNAME, password=PASSW, torrent='mystuff.torrent', category=CATEG, name='mystuff', information='https://noaione.github.io', description=description, anonymous=True, hidden=False, complete=False, remake=False, trusted=False)

#for Sukebei, change UploadTorrent to UploadSukebeiTorrent
ret = pyNyaav2.UploadTorrent(opts)

print(ret)

As a module (Search):

import pyNyaav2

UNAME = 'User'
PASSW = 'SecretPass'
KEYWORD = 'overlord s3'
CATEG = 1_2 #This is Anime English-translated, you can also type 'anime_eng', scroll to the very bottom for reference
PAGE = 1

#for Sukebei, change SearchTorrent to SearchSukebeiTorrent
ret = pyNyaav2.SearchTorrent(username=UNAME, password=PASSW, keyword=KEYWORD, category=CATEG, page=PAGE)

print(ret[0])

Category List: https://gist.github.com/noaione/2a74eb362588dcc4edc8684e9c270a8c

pynyaav2's People

Contributors

noaione avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jodanjodan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.