nrksub
Download, translate subtitles for NRK TV programs.
Dependencies
Python 3.4+
Beautiful Soup 4
Requests
Usage
To download subtitles for a programs, provide it’s URL as the first argument:
$ url='https://tv.nrk.no/serie/side-om-side/MUHH48000415/sesong-3/episode-4' $ ./nrksub.py $url
Help
All command line options and arguments, and their purposes can be queried using the help switch:
$ ./nrksub.py --help
File
By default, nrksub will print the subtitles out to STDOUT. To write to a file, provide a file name as the second argument:
$ ./nrksub.py $url nytt-paa-nytt-26-12-2014.srt
Translate
nrksub can translate the Norwegian subtitles provided by NRK automatically using Google Translate. The translations are by no means perfect, but they are better than nothing. By default, the subtitles are translated to English, but you can use any language supported by Google Translate:
$ ./nrksub.py --lang es $url Spanish output $ ./nrksub.py --lang de $url German output
If you want the original Norwegian subtitles, set the language to no (for Norwegian). This will skip the translation process:
$ ./nrksub.py --lang no $url
Format
By default, nrksub will output SRT format subtitles. nrksub can also output TTML format subtitles, but this is mostly for debugging purposes and of little use, as rarely any video player supports them:
$ ./nrksub.py --format ttml $url
More formats maybe added in the future, if I have the time.
Metadata
Release files for nrksub 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nrksub-0.4.0.tar.gz | 16.7 kB | Without provenance | Details | |
| nrksub-0.4.0.tar.bz2 | 14.6 kB | Without provenance | Details |
Release files / nrksub-0.4.0.tar.gz
| Download URL | nrksub-0.4.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df940c6d33b57ae7bdd053cdb74e9002c0c62d901f69f77c72bc7f1b3fa87dff
|
|
BLAKE2b-256 checksum How to use checksums |
5683dce0c796b854894e5b8d1ec647f93acb93f8a8fcd4b3dd93095994e8ff8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / nrksub-0.4.0.tar.bz2
| Download URL | nrksub-0.4.0.tar.bz2 |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53ce55c1a59bc539e55771e4ed66b5a0e5ca6a2b6d6d1fb8086920213da36dab
|
|
BLAKE2b-256 checksum How to use checksums |
6f85a8b22b7c18a31b93929757285372d1e92b1e00c032ae84ea9c1fc8b7a8ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for nrksub 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.