niconico.py icon indicating copy to clipboard operation
niconico.py copied to clipboard

[Bug] Cannot download video. TypeError: 'NoneType' object is not subscriptable

Open joshvictor1024 opened this issue 10 months ago • 0 comments

概要

niconico video <url> download does not work for certain videos.

現象・ログ

See below.

再現手順

$ python3 ../niconico video https://www.nicovideo.jp/watch/sm43452874 download
[INFO] セッションIDを取得中... (<Video Title=トラップで冒険者を狩るあかりちゃんのDungeon Warfare 2 #15 Heartbeat=False>)
Exception in thread Thread-1 (_heartbeat):
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/home/josh/apps/niconico.py-1.2.3/downloads/../niconico/video.py", line 260, in _heartbeat
    headers=HEADERS["heartbeat"], json=self._make_session_data(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/apps/niconico.py-1.2.3/downloads/../niconico/video.py", line 295, in _make_session_data
    session = self.__data__["media"]["delivery"]["movie"]["session"].copy()
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

期待動作

It should download the video normally.

niconico.pyのバージョン

1.2.3 and 1.2.4

OSの種類/ディストリ/バージョン

  • [ ] Windows
  • [ ] macOS
  • [x] Linux

Linux Debian 12 64bit

$ uname -a
Linux framework13 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
$ python3 --version
Python 3.11.2

その他

None.

joshvictor1024 avatar Apr 22 '24 02:04 joshvictor1024