Package: nyaascraper
NyaaScraperAn asynchronous library for scraping and searching torrents onnyaa.siandsukebei.nyaa.si.INSTALLATIONUsing pip:pipinstallnyaascraperLocal Setup:gitclonehttps://github.com/zrekryu/nyaascraper
pipinstall-rrequirements.txt
pythonsetup.pyinstallUSAGESearch Torrents:importasynciofromnyaascraperimportNyaaClientclient=NyaaClient()asyncdefmain()->None:torrents=awaitclient.search("Naruto")print(torrents)asyncio.run(main())Search with Filter:fromnyaascraper.utilsimportFilterawaitclient.search("Naruto",filter_=Filter.NO_REMAKES)Search with Category and Sub-category:fromnyaascraper.utilsimportCategory,Subcategoryawaitclient.search("Naruto",category=Category.ANIME,subcategory=Subcategory.ANIME.RAW)Sorting Torrents:fromnyaascraper.utilsimportSortBy,SortOrderawaitclient.search("Naruto",sort_by=SortBy.SEEDERS,sort_order=SortOrder.DESCENDING)Search Torrents on Specific Page:awaitclient.search("Naruto",page=3)Search torrents by Username:To search for torrents uploaded by a specific user.awaitclient.search("Naruto",username="Erai-raws")Using sukebei.nyaa.si:fromnyaascraper.utilsimportSITEfromnyaascraperimportNyaaClientclient=NyaaClient(SITE.FAP)Getting torrent information:torrents=awaitclient.search("Doraemon")awaitclient.get_torrent_info(torrents[0].view_id)UTILSSITEConstants for different sites.ConstantsFUN: "https://nyaa.si"FAP: "https://sukebei.nyaa.si"FilterConstants for different filters.ConstantsNO_FILTER: 0NO_REMAKES: 1TRUSTED_ONLY: 2CategoryConstants for different torrent categories.ConstantsALL_CATEGORIES: 0ANIME: 1AUDIO: 2LITERATURE: 3LIVE_ACTION: 4PICTURES: 5SOFTWARE: 6ART: 1REAL_LIFE: 2SubcategoryConstants for different torrent subcategories.Anime Subcategories (Subcategory.ANIME)Anime Music Video (Subcategory.ANIME.ANIME_MUSIC_VIDEO):1English Translation (Subcategory.ANIME.ENGLISH_TRANSLATION):2Non-English Translation (Subcategory.ANIME.NON_ENGLISH_TRANSLATION):3Raw (Subcategory.ANIME.RAW):4Audio Subcategories (Subcategory.AUDIO)Lossless (Subcategory.AUDIO.LOSSLESS):1Lossy (Subcategory.AUDIO.LOSSY):2Literature Subcategories (Subcategory.LITERATURE)English Translation (Subcategory.LITERATURE.ENGLISH_TRANSLATION):1Non-English Translation (Subcategory.LITERATURE.NON_ENGLISH_TRANSLATION):2Raw (Subcategory.LITERATURE.RAW):3Live Action Subcategories (Subcategory.LIVE_ACTION)English Translation (Subcategory.LIVE_ACTION.ENGLISH_TRANSLATION):1Idol Promotional Video (Subcategory.LIVE_ACTION.IDOL_PROMOTIONAL_VIDEO):2Non-English Translation (Subcategory.LIVE_ACTION.NON_ENGLISH_TRANSLATION):3Raw (Subcategory.LIVE_ACTION.RAW):4Pictures Subcategories (Subcategory.PICTURES)Graphics (Subcategory.PICTURES.GRAPHICS):1Photos (Subcategory.PICTURES.PHOTOS):2Software Subcategories (Subcategory.SOFTWARE)Apps (Subcategory.SOFTWARE.APPS):1Games (Subcategory.SOFTWARE.GAMES):2Art Subcategories (Subcategory.ART)Anime (Subcategory.ART.ANIME):1Doujinshi (Subcategory.ART.DOUJINSHI):2Games (Subcategory.ART.GAMES):3Manga (Subcategory.ART.MANGA):4Pictures (Subcategory.ART.PICTURES):5Real Life Subcategories (Subcategory.REAL_LIFE)Pictures (Subcategory.REAL_LIFE.PICTURES):1Videos (Subcategory.REAL_LIFE.VIDEOS):2SortByConstants for different sorting options for torrents.ConstantsCOMMENTS: "comments"SIZE: "size"DATE: "id"SEEDERS: "seeders"LEECHERS: "leechers"COMPLETED: "downloads"SortOrderConstants for different sorting orders for torrents.ConstantsASCENDING: "asc"DESCENDING: "desc"LICENSELicensed under theUnlicense.