nrk-api


Namenrk-api JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/Hellowlol/nrk_api
SummaryAPI for NRK, also includes a cli tool to download series or programs from NRK.
upload_time2017-09-06 18:52:38
maintainer
docs_urlNone
authorhellowlol
requires_python
licenseGPL3
keywords nrk api download
VCS
bugtrack_url
requirements aiohttp tqdm docopt
Travis-CI
coveralls test coverage No coveralls.
            nrk\_api
========

|Travis Status| |Cov| |GitHub Releases| |PyPI version|

API for NRK. (Norsk rikskringkasting) (Originally intended to support a
CLI)

CLI Usage
---------

In addition you will need ```ffmpeg`` <https://ffmpeg.org/>`__, e.g.
``apt-get install ffmpeg`` (Ubuntu), ``brew install ffmpeg`` (macOs)

::

    usage: nrkdl [-h] [-s keyword] [-d] [-b] [-sub] [-dr] [-sp SAVE_PATH] [-u URL]
             [-ea EXPIRES_AT]

    CLI tool to download video from NRK.

    optional arguments:
      -h, --help            show this help message and exit

      -s keyword, --search keyword
                            Search nrk for a show and download files

      -d, --description     Print verbose program description in console
      -b, --browse          Builds a menu where you can choose popular categories
      -sub, --subtitle      Download subtitle for this program too.
      -dr, --dry_run        Dry run, dont download any files.
      -sp SAVE_PATH, --save_path SAVE_PATH
                        Set a save path
      -u URL, --url URL     Use NRK URL as source. Comma separated e.g. "url1, url2"
      -ea EXPIRES_AT, --expires_at EXPIRES_AT
                        Get all files that looses access rights between two
                        dates or a date

Search
------

::

    > nrkdl -s "brannma"
      2: Brannmann i seks knop
      1: Brannmann
      0: Brannmann Sam

    Select a number or use slice notation
    0

      .....
      .....
      4: Brannmann Sam S03E29
      3: Brannmann Sam S03E30
      2: Brannmann Sam S03E32
      1: Brannmann Sam S03E33
      0: Brannmann Sam S05E25

    Select a number or use slice notation
    ::

    Downloads starting soon.. 23 downloads to go
    100%|############################################################################| 23/23 [03:57<00:00, 79.09s/it]

URL
---

::

    > nrkdl -u "http://tv.nrksuper.no/serie/bernt-og-erling-paa-nye-eventyr http://tv.nrksuper.no/serie/bertine-paa-besoek"
    100%|####################################################################################| 2/2 [00:21<00:00, 13.63s/it]

Module
------

::

    nrk = NRK()
    s = await nrk.search("lille jack", strict=True)[0]
    for e in await s.episodes():
        await e.download()

    all_downloads = nrk.downloads()

    # How many files are we gonna download
    print(len(nrk.downloads()))
    # Start downloading
    await all_downloads.start()

See example and source file for more examples

Using Docker
------------

To use ``nrkdl`` in a self-contained docker container, the provieded
``Dockerfile`` should get you going for a minimalistic install. If you
want to combine this into a standalone command, something like this will
be what you want.

.. code:: sh

    #!/bin/sh

    # export DATA="/mnt/multimedia/tmp" # Set if you don't want downloads to go to your ${HOME}/downloads
    cd ${HOME}/Projects/programming/nrkdl  # Path where we can find a checkout of this repository
    docker run -it -v ${DATA:-${HOME}/downloads}:/nrkdl/downloads $(docker build -q .) $*

    # Open data-path if we are on osx
    # [[ $? == 0 ]] && ( open ${DATA} )

You can now run it using example ``nrkdl -s "brannma"``.

Install
-------

pip install nrk\_api

Why should you use this library?
--------------------------------

-  Easy to download entire shows
-  Browsing features
-  Fixes up tvshows fucked up naming so it can be parsed by
   kodi/plex/emby
-  Pretty fast, maxes my 500 mbit connection.

Similar tools
-------------

-  `If you need a gui <https://bitbucket.org/snippsat/wx_nrk>`__
-  `Other cli tool <https://github.com/kvolden/nrk_download>`__
-  `nrk written in php <https://github.com/AndKe/nrk>`__
-  `nrk-tv-downloader written in
   bash <https://github.com/odinuge/nrk-tv-downloader>`__
-  `nrk-download cli tool <https://github.com/marhoy/nrk-download>`__
-  Use the search there is loads of nrk options.

.. |Travis Status| image:: https://travis-ci.org/Hellowlol/nrk_api.svg?branch=master
   :target: https://travis-ci.org/Hellowlol/nrk_api
.. |Cov| image:: https://codecov.io/gh/hellowlol/nrk_api/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/hellowlol/nrk_api/branch/master
.. |GitHub Releases| image:: https://img.shields.io/github/tag/hellowlol/nrk_api.svg?label=github+release
   :target: https://github.com/hellowlol/nrk_api/releases
.. |PyPI version| image:: https://badge.fury.io/py/nrk-api.svg
   :target: https://pypi.python.org/pypi/nrk-api

            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "keywords": "nrk api download", 
    "upload_time": "2017-09-06 18:52:38", 
    "requirements": [
        {
            "name": "aiohttp", 
            "specs": [
                [
                    ">=", 
                    "2.1.0"
                ]
            ]
        }, 
        {
            "name": "tqdm", 
            "specs": [
                [
                    ">=", 
                    "4.14.0"
                ]
            ]
        }, 
        {
            "name": "docopt", 
            "specs": [
                [
                    ">=", 
                    "0.6.2"
                ]
            ]
        }
    ], 
    "author": "hellowlol", 
    "home_page": "https://github.com/Hellowlol/nrk_api", 
    "github_user": "Hellowlol", 
    "download_url": "https://pypi.python.org/packages/a1/d7/ad61f901842b9dd942a2b0b49cdf30ecff2e716808dd78586af1f977d58b/nrk_api-0.0.5.tar.gz", 
    "platform": "", 
    "version": "0.0.5", 
    "cheesecake_documentation_id": null, 
    "description": "nrk\\_api\r\n========\r\n\r\n|Travis Status| |Cov| |GitHub Releases| |PyPI version|\r\n\r\nAPI for NRK. (Norsk rikskringkasting) (Originally intended to support a\r\nCLI)\r\n\r\nCLI Usage\r\n---------\r\n\r\nIn addition you will need ```ffmpeg`` <https://ffmpeg.org/>`__, e.g.\r\n``apt-get install ffmpeg`` (Ubuntu), ``brew install ffmpeg`` (macOs)\r\n\r\n::\r\n\r\n    usage: nrkdl [-h] [-s keyword] [-d] [-b] [-sub] [-dr] [-sp SAVE_PATH] [-u URL]\r\n             [-ea EXPIRES_AT]\r\n\r\n    CLI tool to download video from NRK.\r\n\r\n    optional arguments:\r\n      -h, --help            show this help message and exit\r\n\r\n      -s keyword, --search keyword\r\n                            Search nrk for a show and download files\r\n\r\n      -d, --description     Print verbose program description in console\r\n      -b, --browse          Builds a menu where you can choose popular categories\r\n      -sub, --subtitle      Download subtitle for this program too.\r\n      -dr, --dry_run        Dry run, dont download any files.\r\n      -sp SAVE_PATH, --save_path SAVE_PATH\r\n                        Set a save path\r\n      -u URL, --url URL     Use NRK URL as source. Comma separated e.g. \"url1, url2\"\r\n      -ea EXPIRES_AT, --expires_at EXPIRES_AT\r\n                        Get all files that looses access rights between two\r\n                        dates or a date\r\n\r\nSearch\r\n------\r\n\r\n::\r\n\r\n    > nrkdl -s \"brannma\"\r\n      2: Brannmann i seks knop\r\n      1: Brannmann\r\n      0: Brannmann Sam\r\n\r\n    Select a number or use slice notation\r\n    0\r\n\r\n      .....\r\n      .....\r\n      4: Brannmann Sam S03E29\r\n      3: Brannmann Sam S03E30\r\n      2: Brannmann Sam S03E32\r\n      1: Brannmann Sam S03E33\r\n      0: Brannmann Sam S05E25\r\n\r\n    Select a number or use slice notation\r\n    ::\r\n\r\n    Downloads starting soon.. 23 downloads to go\r\n    100%|############################################################################| 23/23 [03:57<00:00, 79.09s/it]\r\n\r\nURL\r\n---\r\n\r\n::\r\n\r\n    > nrkdl -u \"http://tv.nrksuper.no/serie/bernt-og-erling-paa-nye-eventyr http://tv.nrksuper.no/serie/bertine-paa-besoek\"\r\n    100%|####################################################################################| 2/2 [00:21<00:00, 13.63s/it]\r\n\r\nModule\r\n------\r\n\r\n::\r\n\r\n    nrk = NRK()\r\n    s = await nrk.search(\"lille jack\", strict=True)[0]\r\n    for e in await s.episodes():\r\n        await e.download()\r\n\r\n    all_downloads = nrk.downloads()\r\n\r\n    # How many files are we gonna download\r\n    print(len(nrk.downloads()))\r\n    # Start downloading\r\n    await all_downloads.start()\r\n\r\nSee example and source file for more examples\r\n\r\nUsing Docker\r\n------------\r\n\r\nTo use ``nrkdl`` in a self-contained docker container, the provieded\r\n``Dockerfile`` should get you going for a minimalistic install. If you\r\nwant to combine this into a standalone command, something like this will\r\nbe what you want.\r\n\r\n.. code:: sh\r\n\r\n    #!/bin/sh\r\n\r\n    # export DATA=\"/mnt/multimedia/tmp\" # Set if you don't want downloads to go to your ${HOME}/downloads\r\n    cd ${HOME}/Projects/programming/nrkdl  # Path where we can find a checkout of this repository\r\n    docker run -it -v ${DATA:-${HOME}/downloads}:/nrkdl/downloads $(docker build -q .) $*\r\n\r\n    # Open data-path if we are on osx\r\n    # [[ $? == 0 ]] && ( open ${DATA} )\r\n\r\nYou can now run it using example ``nrkdl -s \"brannma\"``.\r\n\r\nInstall\r\n-------\r\n\r\npip install nrk\\_api\r\n\r\nWhy should you use this library?\r\n--------------------------------\r\n\r\n-  Easy to download entire shows\r\n-  Browsing features\r\n-  Fixes up tvshows fucked up naming so it can be parsed by\r\n   kodi/plex/emby\r\n-  Pretty fast, maxes my 500 mbit connection.\r\n\r\nSimilar tools\r\n-------------\r\n\r\n-  `If you need a gui <https://bitbucket.org/snippsat/wx_nrk>`__\r\n-  `Other cli tool <https://github.com/kvolden/nrk_download>`__\r\n-  `nrk written in php <https://github.com/AndKe/nrk>`__\r\n-  `nrk-tv-downloader written in\r\n   bash <https://github.com/odinuge/nrk-tv-downloader>`__\r\n-  `nrk-download cli tool <https://github.com/marhoy/nrk-download>`__\r\n-  Use the search there is loads of nrk options.\r\n\r\n.. |Travis Status| image:: https://travis-ci.org/Hellowlol/nrk_api.svg?branch=master\r\n   :target: https://travis-ci.org/Hellowlol/nrk_api\r\n.. |Cov| image:: https://codecov.io/gh/hellowlol/nrk_api/branch/master/graph/badge.svg\r\n   :target: https://codecov.io/gh/hellowlol/nrk_api/branch/master\r\n.. |GitHub Releases| image:: https://img.shields.io/github/tag/hellowlol/nrk_api.svg?label=github+release\r\n   :target: https://github.com/hellowlol/nrk_api/releases\r\n.. |PyPI version| image:: https://badge.fury.io/py/nrk-api.svg\r\n   :target: https://pypi.python.org/pypi/nrk-api\r\n", 
    "lcname": "nrk-api", 
    "bugtrack_url": null, 
    "github": true, 
    "coveralls": false, 
    "name": "nrk-api", 
    "license": "GPL3", 
    "travis_ci": true, 
    "github_project": "nrk_api", 
    "summary": "API for NRK, also includes a cli tool to download series or programs from NRK.", 
    "split_keywords": [
        "nrk", 
        "api", 
        "download"
    ], 
    "author_email": "hellowlol1@gmail.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2017-09-06T18:52:38", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/a1/d7/ad61f901842b9dd942a2b0b49cdf30ecff2e716808dd78586af1f977d58b/nrk_api-0.0.5.tar.gz", 
            "md5_digest": "b034a2235137c6da540530b5b0d3855e", 
            "downloads": 0, 
            "filename": "nrk_api-0.0.5.tar.gz", 
            "packagetype": "sdist", 
            "path": "a1/d7/ad61f901842b9dd942a2b0b49cdf30ecff2e716808dd78586af1f977d58b/nrk_api-0.0.5.tar.gz", 
            "size": 132643
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}