Last active
November 30, 2015 04:47
-
-
Save zodman/aef018a54222615da587 to your computer and use it in GitHub Desktop.
Buscar en nyaa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding=utf8 | |
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 | |
from nyaa import nyaa | |
import click | |
@click.command() | |
@click.argument("search") | |
@click.option("--user", default="") | |
@click.option("--onlylink", default="") | |
def search_nyaa(search,user, onlylink): | |
for r in range(0, 5): | |
res = nyaa.search(search, user=user, offset=r) | |
for i in res: | |
if not onlylink: | |
click.echo("{} | {} ".format(i.title.encode("utf8"), i.link)) | |
else: | |
click.echo(i.link) | |
if __name__=="__main__": | |
search_nyaa() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment