### Download Small Size Images for Thumbnails Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Download small-sized JPG images using 'wget' for thumbnail previews. The 'image/original_small/' directory holds the URL lists for these images. ```bash # 小サイズ画像をサムネイル確認用に取得する mkdir -p downloads/image/small/D0002010 wget -P downloads/image/small/D0002010 -i image/original_small/D0002010.txt ``` -------------------------------- ### Download All Audio URLs using Python Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt This Python script reads a list of audio URLs from a text file and downloads the first three audio files. Ensure the URL file exists in the 'audio/' directory and the output directory is created. ```python import urllib.request, os, pathlib series_id = "D0002011" url_file = f"audio/{series_id}.txt" out_dir = pathlib.Path(f"downloads/audio/{series_id}") out_dir.mkdir(parents=True, exist_ok=True) with open(url_file) as f: urls = [line.strip() for line in f if line.strip()] for url in urls[:3]: # 最初の3件のみ取得(例示) filename = url.split("/")[-1] dest = out_dir / filename print(f"ダウンロード中: {filename}") urllib.request.urlretrieve(url, dest) print(f"保存完了: {dest}") ``` -------------------------------- ### List Available Audio Series IDs Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Use 'ls' to list the text files in the 'audio/' directory, which correspond to the available series IDs for audio materials. ```bash # 利用可能な音声シリーズ一覧を確認する ls audio/ # 出力例: # D0002011.txt D0002022.txt D0002040.txt # D0002070.txt D0002100.txt D0002110.txt ``` -------------------------------- ### Download All Audio Series Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt A shell script to iterate through all '.txt' files in the 'audio/' directory, creating a subdirectory for each series ID and downloading the corresponding audio files using 'wget'. ```bash # 全シリーズをまとめてダウンロードするシェルスクリプト例 for txt_file in audio/*.txt; do series_id=$(basename "$txt_file" .txt) mkdir -p "downloads/audio/$series_id" wget -q -P "downloads/audio/$series_id" -i "$txt_file" echo "完了: $series_id" done ``` -------------------------------- ### Download All Audio Files for a Series Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Download all M4A audio files for a given series ID using 'wget'. The 'audio/' directory contains text files listing URLs for different audio categories. ```bash # D0002011 シリーズ(音楽素材)の音声ファイルを全件ダウンロードする mkdir -p downloads/audio/D0002011 wget -P downloads/audio/D0002011 -i audio/D0002011.txt ``` -------------------------------- ### Fetch First Movie Page Title Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Retrieve the HTML of the first video page URL listed in a 'movie/desc/' text file using 'curl' and extract the title using 'grep'. ```bash # curl で最初の映像ページのHTMLを取得する例 first_url=$(head -1 movie/desc/D0002010.txt) curl -s "$first_url" | grep -o '[^<]*' ``` -------------------------------- ### Download All Videos for a Series Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Use 'wget' to download all MP4 video files for a specific series ID listed in a 'movie/original/' text file. Ensure the target directory exists. ```bash # D0002010 シリーズの映像を全件ダウンロードする mkdir -p downloads/movie/D0002010 wget -P downloads/movie/D0002010 -i movie/original/D0002010.txt ``` -------------------------------- ### Understand Material ID Naming Pattern Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Examine the naming convention for material IDs, which includes the series ID, a sequential number, a sub-number (usually 00000), and a variant code (e.g., V for video, A for audio, S_00X for image size). ```bash # 素材IDの命名パターンを確認する(例: D0002010003_00000_V_000.mp4) # D0002010 = シリーズID # 003 = 素材連番 # 00000 = サブ番号(通常 00000) # V_000 = 映像バリアント(V=映像, A=音声, S_00X=画像サイズ) ``` -------------------------------- ### Download Large Size Images (No Logo) Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Download all large-sized JPG images without logos for a specific series ID using 'wget'. The 'image/original_large/' directory contains the corresponding URL lists. ```bash # D0002010 シリーズの大サイズ画像(ロゴなし)を全件ダウンロードする mkdir -p downloads/image/large/D0002010 wget -P downloads/image/large/D0002010 -i image/original_large/D0002010.txt ``` -------------------------------- ### List Movie Page URLs Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Use 'cat' to list all video detail page URLs for a given series ID from the 'movie/desc/' directory. Access these URLs in a browser to check content and licensing. ```bash # D0002010 シリーズの映像ページURLを一覧表示する cat movie/desc/D0002010.txt ``` ```bash # 出力例: # https://www2.nhk.or.jp/archives/movies/?id=D0002010003_00000 # https://www2.nhk.or.jp/archives/movies/?id=D0002010004_00000 # https://www2.nhk.or.jp/archives/movies/?id=D0002010005_00000 # ... ``` -------------------------------- ### Extract Archive.md Links from README Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Use 'grep' to extract all URLs pointing to 'archive.md' from the main 'README.md' file, which serves as an index for different categories. ```bash # README.md から全 archive.md リンクを抽出する grep -oP 'https://archive\.md/\S+' README.md # 出力例: # https://archive.md/9rAOs (ほ乳類) # https://archive.md/niU1P # https://archive.md/Op7jR (鳥類) # ... ``` -------------------------------- ### Download Single Large Image (No Logo) Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Fetch a single large-sized JPG image without a logo directly using 'curl' with the '-O' option. ```bash # 単一画像をcurlで取得する例(大サイズ・ロゴなし) curl -O https://www.nhk.or.jp/das/image/D0002010/D0002010003_00000_S_003.jpg ``` -------------------------------- ### Parallel Download Videos with aria2c Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Utilize 'aria2c' for parallel downloading of video files, specifying the maximum number of connections and the input file containing URLs. ```bash # aria2c で並列ダウンロード(最大4接続)する例 aria2c -x 4 -i movie/original/D0002010.txt --dir=downloads/movie/D0002010 ``` -------------------------------- ### Count URLs per Series ID Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Use 'wc -l' to count the number of URLs listed in the text files for different media types (audio, movie descriptions, image originals) grouped by series ID. ```bash # シリーズID別のURL件数を確認する wc -l audio/*.txt movie/desc/*.txt image/original_large/*.txt ``` -------------------------------- ### Download Single Video File Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Fetch a single MP4 video file directly using 'curl' with the '-O' option to save it with its original filename. ```bash # 単一URLを直接取得する例 curl -O https://www.nhk.or.jp/das/movie/D0002010/D0002010003_00000_V_000.mp4 ``` -------------------------------- ### Filter Archive.md Links by Category Source: https://context7.com/ishizueitaro/nhkcreativelibrary/llms.txt Employ 'awk' to filter and extract 'archive.md' links from 'README.md' that belong to a specific category, such as '生きもの' (Living things). ```bash # 特定ジャンル(例: 生きもの)のリンクだけを抽出するスクリプト awk '/## 生きもの/{found=1} /^## /{if(found && !/## 生きもの/) found=0} found && /archive\.md/' README.md ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.