AlexAplin / nndownload

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

Use highest quality thumbnail available #100

Closed CXwudi closed 3 years ago

CXwudi commented 3 years ago

Since niconico API schema changes, we have five available thumbnail URLs that can be used. It doesn't matter if it is a normal video or an HLS encrypted video, also doesn't matter if the user has login or not.

For example, here is the portion of thumbnails information in api_data for sm38140033, from top to bottom are thumbnails from worst to best qualities.

      "thumbnail":{
         "url":"https://nicovideo.cdn.nimg.jp/thumbnails/38140033/38140033.82394287",
         "middleUrl":"https://nicovideo.cdn.nimg.jp/thumbnails/38140033/38140033.82394287.M",
         "largeUrl":"https://nicovideo.cdn.nimg.jp/thumbnails/38140033/38140033.82394287.L",
         "player":"https://img.cdn.nimg.jp/s/nicovideo/thumbnails/38140033/38140033.82394287.original/a960x540l?key=52a190060cf17d8280e439793c5352b2e2458abab080d187750f975bbd2126b5",
         "ogp":"https://img.cdn.nimg.jp/s/nicovideo/thumbnails/38140033/38140033.82394287.original/r1280x720l?key=85e590129f856ca5d37e61562bd4b20a3c9e4bba34c87f8b4ea07404ecc93fbc"
      },

Also, if you have time, we can have a new feature --thumbnial-quality that can allow users to choose desired thumbnail quality to download. But so far this PR is just for improving the default chosen thumbnail quality from highest to lowest, whichever is available.

CXwudi commented 3 years ago

oh what a second, there is an issue with the thumbnail downloading, I will re-open it once I fix it

CXwudi commented 3 years ago

fixed my issue