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

Cannot download news #24

Closed balta2ar closed 2 years ago

balta2ar commented 2 years ago

Has their API changed? Or they moved somewhere else?

$ nrkdownload -d . 'https://tv.nrk.no/serie/distriktsnyheter-nordland/202203/DKNO98031522/avspiller'
Traceback (most recent call last):
  File "/home/bz/.local/bin/nrkdownload", line 8, in <module>
    sys.exit(main())
  File "/home/bz/.local/lib/python3.10/site-packages/nrkdownload/commandline_script.py", line 105, in main
    download_url(url, download_all=arguments.all, download_last=arguments.last)
  File "/home/bz/.local/lib/python3.10/site-packages/nrkdownload/commandline_script.py", line 121, in download_url
    programs = parse_nrk_url.parse_url(url)
  File "/home/bz/.local/lib/python3.10/site-packages/nrkdownload/parse_nrk_url.py", line 80, in parse_url
    episode = tv.new_program_from_mediaelement_id(media_id)
  File "/home/bz/.local/lib/python3.10/site-packages/nrkdownload/tv.py", line 273, in new_program_from_mediaelement_id
    json = nrkapi.get_mediaelement(mediaelement_id)
  File "/home/bz/.local/lib/python3.10/site-packages/nrkdownload/nrkapi.py", line 71, in get_mediaelement
    r.raise_for_status()
  File "/home/bz/.local/lib/python3.10/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 410 Client Error: Gone for url: http://psapi-granitt-prod-we.cloudapp.net/mediaelement/DKNO98031522
marhoy commented 2 years ago

I just released version 3.0.0, a complete rewrite from scratch. Can you give that a try? Please note that it's been simplified a bit, please read updated documentation.

balta2ar commented 2 years ago

Thank you for putting effort into making a new version!

I've just tried it again and it seems to download many news episodes, whereas I'd like it to download only one, e.g.

nrkdownload -d . 'https://tv.nrk.no/serie/distriktsnyheter-nordland/202204/DKNO98042722'
marhoy commented 2 years ago

Hehe, single episode download of a series is not implemented yet: You get at least a season (which is 1 month for news series)...

At least, the episode you want will be one of those 😊

Mvh,

Martin -- Sendt fra iPhone

On 28 Apr 2022, at 20:11, Yuri Bochkarev @.***> wrote:

 Thank you for putting effort into making a new version!

I've just tried it again and it seems to download many news episodes, whereas I'd like it to download only one, e.g.

nrkdownload -d . 'https://tv.nrk.no/serie/distriktsnyheter-nordland/202204/DKNO98042722' — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

marhoy commented 2 years ago

Version 3.1.0 adds the possibility to download single episodes from a series. So in your example, only the episode from April 27th 2022.

(Note that recent news-episodes have names like "Mandag...", but after a while the name is changed to a date).

balta2ar commented 2 years ago

Tusen hjertelig takk!