Skip to main content

Download, translate subtitles for NRK TV programs.

Project description

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.

Project details


Download files

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

Source Distributions

nrksub-0.4.0.tar.gz (16.7 kB view details)

Uploaded Source

nrksub-0.4.0.tar.bz2 (14.6 kB view details)

Uploaded Source

File details

Details for the file nrksub-0.4.0.tar.gz.

File metadata

  • Download URL: nrksub-0.4.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nrksub-0.4.0.tar.gz
Algorithm Hash digest
SHA256 df940c6d33b57ae7bdd053cdb74e9002c0c62d901f69f77c72bc7f1b3fa87dff
MD5 f0de545560ffd171456fa873d4327641
BLAKE2b-256 5683dce0c796b854894e5b8d1ec647f93acb93f8a8fcd4b3dd93095994e8ff8a

See more details on using hashes here.

File details

Details for the file nrksub-0.4.0.tar.bz2.

File metadata

  • Download URL: nrksub-0.4.0.tar.bz2
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nrksub-0.4.0.tar.bz2
Algorithm Hash digest
SHA256 53ce55c1a59bc539e55771e4ed66b5a0e5ca6a2b6d6d1fb8086920213da36dab
MD5 5d0d72fc4482ae1ca7e6e5602d555563
BLAKE2b-256 6f85a8b22b7c18a31b93929757285372d1e92b1e00c032ae84ea9c1fc8b7a8ab

See more details on using hashes here.

Supported by

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