AlexAplin / nndownload

Download and process links from Niconico (nicovideo.jp)
MIT License
213 stars 28 forks source link

TypeError: 'NoneType' object is not subscriptable #105

Closed psydere closed 2 years ago

psydere commented 3 years ago

python nndownload.py -f -u USERNAME -p PASSWORD https://ch.nicovideo.jp/dtmstationplus

I'm running v1.11. Some videos in this channel returns

Logged in.
Requesting videos from channel dtmstationplus...
45 videos returned.
1/45
Traceback (most recent call last):
  File "D:\nndownload\nndownload.py", line 1697, in main
    process_url_mo(session, url_mo)
  File "D:\nndownload\nndownload.py", line 1652, in process_url_mo
    request_channel(session, url_id)
  File "D:\nndownload\nndownload.py", line 880, in request_channel
    request_video(session, video_id)
  File "D:\nndownload\nndownload.py", line 933, in request_video
    template_params = perform_api_request(session, document)
  File "D:\nndownload\nndownload.py", line 1282, in perform_api_request
    if params["media"]["delivery"]["movie"].get("session"):
TypeError: 'NoneType' object is not subscriptable

But if I skip those videos (I think they're paid or require some sort of special access):

python nndownload.py -f -u USERNAME -p PASSWORD https://ch.nicovideo.jp/dtmstationplus --playlist-start 44

returns

Logging in...
Logged in.
Requesting videos from channel dtmstationplus...
45 videos returned.
Beginning at index 44.
1/1
Performing initial API request...
Performed initial API request.
Downloading so23081692 to "2014-03-13T10 22 51+09 00DTMステーションPlus!エンディングテーマ「心をこめて♪」feat.結月ゆかり 番組使用動画so23081692.mp4"...
|#########################| 100/100 @ 121.74KB /s
Finished downloading so23081692 to "2014-03-13T10 22 51+09 00DTMステーションPlus!エンディングテーマ「心をこめて♪」feat.結月ゆかり 番組使用動画so23081692.mp4".

Suggestion: Add feature where if encounters a paid(?) video in a "channel", it will just skip it and keep downloading the rest of the videos instead of stopping the process. I think that it should also be the default behavior if such a feature was implemented because right now the only way to download all the viable videos from this channel is by doing it one by one...

CXwudi commented 2 years ago

might be a duplicate to #102

CXwudi commented 2 years ago

@psydere May I know the id number of the unavailable video?

AlexAplin commented 2 years ago

I agree that it looks related, so perhaps this should be more about skipping on errors/unsupported videos for playlists, channels, and so on.

AlexAplin commented 2 years ago

Latest commit fixes this issue but I'll add an -i/--ignore-error flag when I can make sure it applies everywhere.