Skip to main content

Download today's news on https://www3.nhk.or.jp/news/easy/

Project description

nhk-easy

An API for NHK News Web Easy.

It includes a command-line application that supports download of audio (as .m3u8 playlists or .mp3) and text (with or without furigana, in plain text or HTML) of today's top news articles displayed on the homepage of NHK News Web Easy.

Installation

pip install nhk-easy

Synopsis

usage: nhk-easy [-h] [-M] [-d DIRECTORY] [-F] [-H]

optional arguments:
  -h, --help            show this help message and exit
  -M, --mp3             Download mp3 audio instead of m3u8 playlist (ffmpeg required)
  -d DIRECTORY, --directory DIRECTORY
                        output directory
  -F, --furigana        enable furigana
  -H, --html            HTML output (default is txt)

Usage

To start with, try nhk-easy alone (with default options):

nhk-easy

This downloads:

  1. plain text without furigana in .txt files, and
  2. the .m3u8 playlist file of the audio

of all top articles currectly shown on https://www3.nhk.or.jp/news/easy/

m3u8 playlists can be streamed by VLC, for example, to play audio.

The flag --furigana (-F) enables furigana. If you want HTML output instead of plain text, use the flag --html (-H). In plain text, furigana guides are shown in parentheses; in HTML output, they are contained within ruby tags.

If you have ffmpeg installed, you may use the --mp3 (-M) flag to download .mp3 audio files instead of .m3u8 playlists.

You can use the --directory (-d) flag to specify the output directory (defaults to the currect directory).

Example output:

$ mkdir outdir && nhk-easy -MFH -d outdir && ls outdir
2020-07-08-避難所でコロナウイルスがうつらないように気をつけること.mp3
2020-07-08-避難所でコロナウイルスがうつらないように気をつけること.html
2020-07-09-コロナウイルスのアプリ うつったことを知らせた人は3人.mp3
2020-07-09-コロナウイルスのアプリ うつったことを知らせた人は3人.html
......

Copyright Notice

You should abide by NHK's copyright notice:

NHKホームページはすべてNHKの著作物です。次の点にご注意いただいた上でご利用下さい。

  • NHKのホームページの画面あるいは内容を
    • 自分のホームページに取り込んではいけません。
    • 著作権法で許された範囲を超えて複製してはいけません。
    • 著作権法で許された範囲内で複製する場合でも、その複製物を目的外に利用してはいけません。
    • 著作権法で許された範囲内で複製する場合でも、改変するなど手を加えてはいけません。
    • 電子透かしについて
  • NHKのホームページではNHKおよびNHKに素材を提供していただいている他の著作権保有者の権利を守るために、電子透かしを用いています。

Troubleshooting

Fail to Download mp3

ffmpeg freezes due to unstable internet connection

  • ctrl+C and/or ctrl+D to exit.
  • Delete any incomplete file(s).
  • Make sure you have a good connection, then re-run nhk-easy with the same argument(s). Files already downloaded will be skipped.

ffmpeg error

dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib

See https://github.com/platformio/platform-lattice_ice40/issues/7 . This is the most widely accepted solution:

cd /usr/local/opt/libffi/lib
ln -s libffi.7.dylib libffi.6.dylib

Licence

The MIT License (MIT)

Copyright (c) 2020 石天熠

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

nhk-easy-0.0.9.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nhk_easy-0.0.9-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file nhk-easy-0.0.9.tar.gz.

File metadata

  • Download URL: nhk-easy-0.0.9.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for nhk-easy-0.0.9.tar.gz
Algorithm Hash digest
SHA256 e2d097d4abe8929f2d815191808e51522c299f125e6ca372e06afe848a165a4b
MD5 ae1e2df9205b524d1ed40730f649734b
BLAKE2b-256 e229a5b1a4f3c400d10a5a76599e82014cf9513dd6ee1ed03ef09b0dcf2c9842

See more details on using hashes here.

File details

Details for the file nhk_easy-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: nhk_easy-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for nhk_easy-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4f700105e4b98c2518f815c0d61a73ef0379f21560723a36e18c198826f0f268
MD5 48bafd3ba5081cd7d597bb2ed7437e70
BLAKE2b-256 8114bea7f1e881a3bec5ce7a90e033535688d138603d110fac43a9a21fb78619

See more details on using hashes here.

Supported by

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