marhoy / nrk-download

Download content from NRK, complete with images and subtitles:
https://nrkdownload.readthedocs.org
GNU General Public License v3.0
54 stars 10 forks source link

Only first part of program gets downloaded #7

Closed olavlan closed 5 years ago

olavlan commented 6 years ago

It seems like some NRK programs consist of several video files. In these cases only the first video file gets downloaded.

To reproduce the issue: 1) Open https://tv.nrk.no/serie/sjakk/MSPO46500113/09-11-2013#t=1t46m45s and play the program. Notice the transition at 01:46:50. This indicates that two separate video files are merged here. Also notice that the length of the program is 02:21:35.

2) Run the command nrkdownload -u https://tv.nrk.no/serie/sjakk/MSPO46500113/09-11-2013 to download the TV program.

3) Open the downloaded video file and notice that the length is 01:46:50, when it should be 02:21:35.

I have tested several other tools to download programs from NRK, and they all have the same problem.

(Note: This particular TV program was not a special case. Many programs seems to be merged by several video files, especially programs that had a break or switched between NRK1 and NRK2 when they aired. This includes many sports events and long running programs like "Hurtigruten minutt for minutt".)

marhoy commented 6 years ago

Thanks! Very well spotted, and enough info to actually find the problem:

I've been using the ['mediaUrl'] field to extract the download-url. But it seems better to use the ['mediaAssets'] field which in this case is a list with two elements, each with it's own url. For this program, the first url is 1:46:50, and the next is 0:34:46.

I will fix this in the next release.

I have started a rewrite in order to clean up simplify the code, so if the winds are good it shouldn't be too long until the next release.

marhoy commented 5 years ago

Fixed in version 2.0.0