Skip to main content

Package to download from ncore.pro

Project description

Test pypi downloads license

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ncoreparser-2.1.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

ncoreparser-2.1.0-py2.py3-none-any.whl (11.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ncoreparser-2.1.0.tar.gz.

File metadata

  • Download URL: ncoreparser-2.1.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ncoreparser-2.1.0.tar.gz
Algorithm Hash digest
SHA256 60745cdcb8e349c3f631eb18a5ab4766144830cb000e6e6f81134f2d8407ce25
MD5 ef9a3f7572e2e7943169f965866baa37
BLAKE2b-256 b4dd82bc4ad465aeb2e0a2eef132954f452b80ddbf02ae2531633682a583c471

See more details on using hashes here.

File details

Details for the file ncoreparser-2.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ncoreparser-2.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e485c247f455e4affc097204bc54747a42fd6e519a6b3bc634424af640db1f95
MD5 05af5ebee3a797e1845392a59065a40b
BLAKE2b-256 90f1312aa6032b89968ecfbec31b176c31dc31a7263edc5eed295a80945be986

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page