Package to download from ncore.pro
Project description
Ncoreparser
Introduction
This module provides python API-s to manage torrents from ncore.pro eg.: search, download, rssfeed, etc..
Install
pip install ncoreparser
Examples
Search torrent
Get most seeded torrents from all category
from ncoreparser import Client, SearchParamWhere, SearchParamType, ParamSort, ParamSeq
if __name__ == "__main__":
client = Client()
client.login("<username>", "<password>")
for t_type in SearchParamType:
torrent = client.search(pattern="", type=t_type, number=1,
sort_by=ParamSort.SEEDERS, sort_order=ParamSeq.DECREASING)[0]
print(torrent['title'], torrent['type'], torrent['size'], torrent['id'])
client.logout()
Download torrent
This example download Forest gump torrent file and save it to temp folder
from ncoreparser import Client, SearchParamWhere, SearchParamType, ParamSort, ParamSeq
if __name__ == "__main__":
client = Client()
client.login("<username>", "<password>")
torrent = client.search(pattern="Forrest gump", type=SearchParamType.HD_HUN, number=1,
sort_by=ParamSort.SEEDERS, sort_order=ParamSeq.DECREASING)[0]
client.download(torrent, "/tmp")
client.logout()
Download torrent by rssfeed
This example get all torrents and their informations from an ncore bookmark (rss feed)
from ncoreparser import Client
if __name__ == "__main__":
client = Client()
client.login("<username>", "<password>")
torrents = client.get_by_rss("<rss url>")
for torrent in torrents:
print(torrent['title'], torrent['type'], torrent['size'], torrent['id'])
client.logout()
Get torrents by activity
This example get all torrents and their informations from the Hit&run page
from ncoreparser import Client
if __name__ == "__main__":
client = Client()
client.login("<username>", "<password>")
torrents = client.get_by_activity()
for torrent in torrents:
print(torrent['title'], torrent['type'], torrent['size'],
torrent['id'], torrent['rate'], torrent['remaining'])
client.logout()
Get recommended torrents
This example get all torrents and their informations from the recommended page
from ncoreparser import Client, SearchParamType
if __name__ == "__main__":
client = Client()
client.login("<username>", "<password>")
torrents = client.get_recommended(type=SearchParamType.HD_HUN)
for torrent in torrents:
print(torrent['title'], torrent['type'], torrent['size'], torrent['id'])
client.logout()
Async support
The library also supports async calls. It works same as the sync version, but you have to use the AsyncClient class.
import asyncio
from ncoreparser import AsyncClient, SearchParamWhere, SearchParamType, ParamSort, ParamSeq
async def main():
client = AsyncClient()
await client.login("<username>", "<password>")
for t_type in SearchParamType:
torrent = await client.search(pattern="", type=t_type, number=1,
sort_by=ParamSort.SEEDERS, sort_order=ParamSeq.DECREASING)[0]
print(torrent['title'], torrent['type'], torrent['size'], torrent['id'])
await client.logout()
if __name__ == "__main__":
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ncoreparser-2.1.3.tar.gz
.
File metadata
- Download URL: ncoreparser-2.1.3.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b63ad9b106098d976e06bb9b841300ad336e3e1d8fee1d153462dfff8aadea4 |
|
MD5 | 50830cba1ef9b1aee7bdd81f4991ac88 |
|
BLAKE2b-256 | 4dc8ce678a568280fadc879b0de59f12fab4ef7cb2f174156b4be1dad3942c47 |
File details
Details for the file ncoreparser-2.1.3-py3-none-any.whl
.
File metadata
- Download URL: ncoreparser-2.1.3-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e83916046f653f045eac2f7ffa769f08ba02660b5b5806fe503978d555d5075 |
|
MD5 | bc75f13e3a6086566d9ad71bd050d54e |
|
BLAKE2b-256 | 27be28da95a6e7f6ddc18fb39521538b0ae12ea5fa0b3d58c3a9af900378c8d1 |