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 (without furigana) of today's top news articles displayed on the homepage of NHK News Web Easy.

Installation

pip install nhk-easy

Synopsis

$ nhk-easy --help
usage: Download today's NHK easy news [-h] [-m] [-d DIRECTORY]

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
                        directory

Usage

nhk-easy

This downloads text (in .txt files) and the audio playlist (in .m3u8 format) 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.

If you have ffmpeg installed, you can use the --mp3 option to download .mp3 audio instead of .m3u8.

nhk-easy --mp3

Example output:

$ nhk-easy --mp3 -d outdir
$ ls outdir
2020-07-08-避難所でコロナウイルスがうつらないように気をつけること.mp3
2020-07-08-避難所でコロナウイルスがうつらないように気をつけること.txt
2020-07-09-コロナウイルスのアプリ うつったことを知らせた人は3人.mp3
2020-07-09-コロナウイルスのアプリ うつったことを知らせた人は3人.txt
2020-07-09-埼玉県でウイルスがうつった人が増える 知事が協力をお願い.mp3
2020-07-09-埼玉県でウイルスがうつった人が増える 知事が協力をお願い.txt
2020-07-09-雨の被害が大きい熊本県で活動する医者「支援が足りない」.mp3
2020-07-09-雨の被害が大きい熊本県で活動する医者「支援が足りない」.txt
2020-07-10-「やかん」に入れたスポーツ用の飲み物で食中毒.mp3
2020-07-10-「やかん」に入れたスポーツ用の飲み物で食中毒.txt
2020-07-10-コロナウイルスがうつった人 東京で2日続けて200人以上.mp3
2020-07-10-コロナウイルスがうつった人 東京で2日続けて200人以上.txt
2020-07-10-雨で被害を受けた人のためにインターネットで寄付を集める.mp3
2020-07-10-雨で被害を受けた人のためにインターネットで寄付を集める.txt

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 bad 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.5.tar.gz (5.9 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.5-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nhk-easy-0.0.5.tar.gz
  • Upload date:
  • Size: 5.9 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.5.tar.gz
Algorithm Hash digest
SHA256 f8469f93729961f97b1df738067b5316d795caead98ad5bd71530e4ba4346a4d
MD5 c6219d39c8546383a983319e2deb9a37
BLAKE2b-256 635b69751eccee7dbfb9bdcd723a1b01d0eb8cd5ca8450ffc576735f27c6c275

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nhk_easy-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3d905f8eb5235d1b0e20ad7b5bc5db82417f2167c5dc51884ab3d7a4ee55f46f
MD5 de0332311a65251d667679cfe0458195
BLAKE2b-256 c1f2b77fdec877208b037c86a3572b5cf7230b02557c430fb3b6cdcba7ad02d5

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