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

404 Not Found for URL #13

Closed cosminpolifronie closed 5 years ago

cosminpolifronie commented 5 years ago

Hello! When using the following command I get an error from your program: nrkdownload https://tv.nrk.no/serie/melodi-grand-prix-tv/2019/MUHU07000019

Error:

Traceback (most recent call last):
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Cosmin\AppData\Local\Programs\Python\Python37\Scripts\nrkdownload.exe\__main__.py", line 9, in <module>
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\site-packages\nrkdownload\commandline_script.py", line 80, in main
    download_url(url, download_all=arguments.all, download_last=arguments.last)
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\site-packages\nrkdownload\commandline_script.py", line 95, in download_url
    programs = parse_nrk_url.parse_url(url)
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\site-packages\nrkdownload\parse_nrk_url.py", line 79, in parse_url
    episode = tv.new_program_from_mediaelement_id(media_id)
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\site-packages\nrkdownload\tv.py", line 227, in new_program_from_mediaelement_id
    json = nrkapi.get_mediaelement(mediaelement_id)
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\site-packages\nrkdownload\nrkapi.py", line 60, in get_mediaelement
    r.raise_for_status()
  File "c:\users\cosmin\appdata\local\programs\python\python37\lib\site-packages\requests\models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://psapi-granitt-prod-we.cloudapp.net/mediaelement/2019
marhoy commented 5 years ago

Thanks for the feedback!

The problem is that the URL is formatted as a series, but it doesn't contain an "/episode/" part. If you instead use the URL https://tv.nrk.no/serie/melodi-grand-prix-tv, you will be asked to select an episode (it takes a while to query them all, there's a lot of them). Or you could just specify the option -l to directly download the last episode.

So this command will work if want to download this year's MGP final: nrkdownload -l https://tv.nrk.no/serie/melodi-grand-prix-tv

marhoy commented 5 years ago

Fixed in version 2.0.2, please update your installation.