結論
以下のとおりにスクリプトを走らせると良いです*1。
$ until youtube-dl [options] https://www.nicovideo.jp/watch/sm35801010; do continue; done
上記のコマンドを実行すると、ERROR: unable to download video data: HTTP Error 403: Forbidden
が出た後にリジュームでダウンロードを再開してくれます。until ... do continue
なので、ダウンロードが終了するまで永久ループしてくれます。
補足
優しい方法ではないので、--sleep-interval
オプションを入れるなどして優しくダウンロードしましょう。
参考
heartbeat signal
heartbeat signal
を定期的に送信する仕組みがマージされれば、上記の方法を使う必要はないそうです。
until ... do continue
until ... do continue
を使う方法は以下の Issue を参考にしました。
ログ
$ until youtube-dl --ignore-errors --download-archive .youtube-dl_download-archive --write-all-thumbnails --write-annotations --write-info-json --write-description --write-auto-sub --sleep-interval 15 --max-sleep-interval 30 --format mp4 https://www.nicovideo.jp/watch/sm35801010; do continue; done [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 25.54 seconds... [download] Resuming download at byte 34065350 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 19.5% of 247.50MiB at 170.38KiB/s ETA 19:58[download] Got server HTTP error: Downloaded 50501550 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 17.15 seconds... [download] Resuming download at byte 50501550 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 26.2% of 247.50MiB at 166.67KiB/s ETA 18:42[download] Got server HTTP error: Downloaded 67998150 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 18.63 seconds... [download] Resuming download at byte 67998150 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 32.9% of 247.50MiB at 167.76KiB/s ETA 16:53[download] Got server HTTP error: Downloaded 85362200 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 21.54 seconds... [download] Resuming download at byte 85362200 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 39.4% of 247.50MiB at 169.03KiB/s ETA 15:08[download] Got server HTTP error: Downloaded 102328600 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 24.84 seconds... [download] Resuming download at byte 102328600 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 45.8% of 247.50MiB at 169.25KiB/s ETA 13:32[download] Got server HTTP error: Downloaded 118764800 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 29.59 seconds... [download] Resuming download at byte 118764800 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 51.8% of 247.50MiB at 171.30KiB/s ETA 11:52[download] Got server HTTP error: Downloaded 134538250 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 15.30 seconds... [download] Resuming download at byte 134538250 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 58.7% of 247.50MiB at 166.22KiB/s ETA 10:29[download] Got server HTTP error: Downloaded 152299950 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 21.11 seconds... [download] Resuming download at byte 152299950 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 65.2% of 247.50MiB at 168.18KiB/s ETA 08:44[download] Got server HTTP error: Downloaded 169266350 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 28.57 seconds... [download] Resuming download at byte 169266350 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 71.4% of 247.50MiB at 171.87KiB/s ETA 07:01[download] Got server HTTP error: Downloaded 185304900 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 24.80 seconds... [download] Resuming download at byte 185304900 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 77.7% of 247.50MiB at 169.08KiB/s ETA 05:33[download] Got server HTTP error: Downloaded 201741100 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 22.07 seconds... [download] Resuming download at byte 201741100 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 84.2% of 247.50MiB at 168.26KiB/s ETA 03:57[download] Got server HTTP error: Downloaded 218574950 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 23.36 seconds... [download] Resuming download at byte 218574950 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 90.7% of 247.50MiB at 169.31KiB/s ETA 02:19[download] Got server HTTP error: Downloaded 235276250 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 17.93 seconds... [download] Resuming download at byte 235276250 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 97.3% of 247.50MiB at 166.66KiB/s ETA 00:40[download] Got server HTTP error: Downloaded 252640300 bytes, expected 259522690 bytes. Retrying (attempt 1 of 10)... ERROR: unable to download video data: HTTP Error 403: Forbidden [niconico] sm35801010: Downloading webpage [niconico] sm35801010: Downloading JSON metadata for h264_360p-aac_64kbps [niconico] sm35801010: Downloading JSON metadata for h264_360p_low-aac_64kbps [info] Writing video description to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.description WARNING: There are no annotations to write. [info] Writing video description metadata as JSON to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.info.json [niconico] sm35801010: Downloading thumbnail ... [niconico] sm35801010: Writing thumbnail to: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.90830849 [download] Sleeping 25.31 seconds... [download] Resuming download at byte 252640300 [download] Destination: 【実況】メガドライブミニをいい大人達が本気で遊んでみた。part1-sm35801010.mp4 [download] 100% of 247.50MiB in 00:22
*1:以下は sm35801010 をダウンロードする例