ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.68k stars 9.97k forks source link

Expand Niconico Video support #5838

Open quozbogv opened 9 years ago

quozbogv commented 9 years ago

Niconico Video has two quality levels for a video, "normal" and "economy" (Japlish for "low"). Currently, using youtube-dl -F on a Niconico Video link only brings up one video quality:

format code  extension      resolution note
0            unknown_video  unknown

Expanding youtube-dl's functionality to include video quality would be nice. The url for the video file changes by having "low" added as a suffix (http://smile-fnl41.nicovideo.jp/smile?m=1097445.24697low vs. http://smile-fnl41.nicovideo.jp/smile?v=1097445.24697) (Economy mode can be forced by appending ?eco=1 to the end of a Niconico URL, for what it's worth)

It should be noted that normal users who don't pay up for a premium account may get the economy quality automatically from JST 6:00 PM to 2:00 AM on normal days, and JST 12:00 PM to 2:00 AM on Saturdays, Sundays, and holidays. If this affects youtube-dl's behavior of automatically getting the highest quality, the file size in bytes can be found in "size_high" (for normal quality) and "size_low" (for economy) at http://ext.nicovideo.jp/api/getthumbinfo/$VIDEO-ID (for example, http://ext.nicovideo.jp/api/getthumbinfo/sm1097445 for http://www.nicovideo.jp/watch/sm1097445)

hakanai commented 6 years ago

I even had nico force low quality on my paid premium account the other day, and ended up having to reschedule all my downloads for the middle of the day on a work day to get around it.

If I had a way to fail a download in eco mode it would be really convenient. I know I can see it in advance with -F but the last time I was downloading 200+ videos and didn't know whether it was going to cross into economy mode half way through.