Welcome to nrkdownload’s documentation!¶
Note
If you have been using an older version of this tool, please note that version 3.x is a complete rewrite from scratch. The funtionallity has been reduced and simplifed a bit compared to previous versions.
Features¶
This is a commandline tool for downloading content from NRK (Norwegian public broadcaster). It supports downloading TV series and programs. The tool is written in Python, and is compatible with Python 3.8 or newer. It has been tested under Linux, Mac OS X and Windows.
Please only use this tool for personal purposes. You are responsible for not breaking any Intellectual Property Rights. Users outside of Norway should note that some of the content is geo-restricted.
Downloading media and metadata¶
The idea behind the tool is that the downloaded programs should integrate seamlessly into you favorite media server, e.g. Plex. If you for example download all the episodes of the popular series Førstegangstjenesten, you would get a directory-structure like this:
Førstegangstjenesten
├── banner.jpg
├── Season 01
│ ├── Førstegangstjenesten - s01e01 - 1. Pilot - del 1.jpg
│ ├── Førstegangstjenesten - s01e01 - 1. Pilot - del 1.m4v
│ ├── Førstegangstjenesten - s01e01 - 1. Pilot - del 1.no.srt
⋮
└── Season 02
├── Førstegangstjenesten - s02e01 - 1. episode.jpg
├── Førstegangstjenesten - s02e01 - 1. episode.m4v
├── Førstegangstjenesten - s02e01 - 1. episode.no.srt
⋮
├── Førstegangstjenesten - s02e08 - 8. episode.jpg
├── Førstegangstjenesten - s02e08 - 8. episode.m4v
├── Førstegangstjenesten - s02e08 - 8. episode.no.srt
└── Season02.jpg
Installing nrkdownload¶
Installing or upgrading to the latest release of nrkdownload¶
The package is avaible via PyPI. The
recommended way to install nrkdownload
is by using pipx. pipx
is a tool that installs and runs
Python applications in isolated environments. If you haven’t already done so, start by
installing pipx, and then install, upgrade or uninstall nrkdownload
like this:
$ pipx install nrkdownload
$ pipx upgrade nrkdownload
$ pipx uninstall nrkdownload
Note that in order to download video and subtitles, an installation of ffmpeg
is
needed. See Installing FFmpeg.
Installing FFmpeg¶
The videos and subtitles are downloaded using FFmpeg. It is available for all major operating systems. You need to install ffmpeg and make it available in your $PATH before you can use nrkdownload.
For Windows¶
Should be rather straight forward. Download the latest static build and run the installer.
For Linux¶
Depending on your Linux-distribution, you might have to add a package-repository in order to install ffmpeg. If you get stuck, try too Google installing ffmpeg for YOUR_LINUX_DISTRO.
For MacOS¶
Download the static build of the latest release.
Open the .dmg-file and copy the binary file ffmpeg to e.g. a directory
bin
inside your home directory. Then, add ~/bin
to your PATH.
Usage¶
Start by browsing https://tv.nrk.no until you find what you want. Copy the URLs and give it as an argument for this tool. You can list several URLs on the command line (separated by space). Content that are already downloaded will be skipped.
Options¶
Usage: nrkdownload [OPTIONS] URLS…
- Arguments:
- URLS… One or more valid URLs from https://tv.nrk.no/ [required]
- Options:
-d, --download-dir PATH Download directory. Can also be specified by setting the environment variable NRKDOWNLOAD_DIR [default: ~/Downloads/nrkdownload] --version Print version string -v Increase logger verbosity. Can be repeated up to four times. [default: 0; x<=4] --help Show this message and exit.
The files are by default downloaded to ~/Downloads/nrkdownload. This can be changed by using the option -d as described above, or you can define the environment variable NRKDOWNLOAD_DIR
URL Parsing and actions¶
If the URL points to the top-level of a series, all episodes in all seasons will be downloaded. If the URL points to a specific season, only the episodes within that season will be downloaded.
Examples¶
Downloading programs¶
For downloading a specific program that is not part of a series, the URL could look like e.g. https://tv.nrk.no/program/MUHH49000021
Dowloading series¶
Let’s say you are interested in downloading all the available episodes about the rescue
boat “Elias”. You would then search for “Elias” on https://tv.nrk.no and end up at a
page with the URL https://tv.nrk.no/serie/elias. If you give this URL as an argument to
nrkdownload
, all (available) episodes in all seasons will be downloaded.
Downloading a single season¶
If you are only interested in a specific season of a series, click around on the webpages until you are only looking at that season. As an example, if you wanted to download the third season of SKAM, you would use an URL like https://tv.nrk.no/serie/skam/sesong/3
Downloading a single episode¶
If you want to download only a single episode of a series, navigate https://tv.nrk.no until that episode is selected. The URL will look like e.g. https://tv.nrk.no/serie/kongen-av-gulset/sesong/1/episode/3/avspiller or https://tv.nrk.no/serie/klassequizen/2021/DSRR21000521/avspiller, where information about the episode is included.
Giving a URL like this as argument to nrkdownload, will result in only this single episode to be downloaded.
Contributing¶
How to make changes¶
You are welcome to help develop nrkdownload
, following these steps:
- Clone the GitHub repository
- Create a new branch based on the
master
branch - Add your code or bugfixes
- Make a pull request towards the
master
branch