everdrone/nts

`IndexError: list out of range` when downloading whole show

ChrisSandison opened this issue · 5 comments

Just updated to the newest version, got this error when downloading the alexander-nut show.

downloading into: /Users/chrissandison/Desktop/shows/nts/alexander-nut

[soundcloud] nts-latest/alexander-nut-240320: Downloading info JSON
[soundcloud] 782974657: Downloading JSON metadata
[soundcloud] 782974657: Downloading JSON metadata
[soundcloud] 782974657: Downloading JSON metadata
[download] Destination: /Users/chrissandison/Desktop/shows/nts/alexander-nut/Alexander Nut - 2020-3-24.mp3
[download] 100% of 110.00MiB in 00:12
adding metadata to Alexander Nut - 2020-3-24.mp3 ...
Traceback (most recent call last):
  File "/usr/local/bin/nts", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/nts/cli.py", line 73, in main
    url_matcher(arg)
  File "/usr/local/lib/python3.9/site-packages/nts/cli.py", line 57, in url_matcher
    url_matcher(ep)
  File "/usr/local/lib/python3.9/site-packages/nts/cli.py", line 52, in url_matcher
    nts.download(url=url, quiet=options.quiet,
  File "/usr/local/lib/python3.9/site-packages/nts/downloader.py", line 35, in download
    parsed = parse_nts_data(bs)
  File "/usr/local/lib/python3.9/site-packages/nts/downloader.py", line 130, in parse_nts_data
    tracks = parse_tracklist(bs)
  File "/usr/local/lib/python3.9/site-packages/nts/downloader.py", line 153, in parse_tracklist
    artist = track.select('.track__artist')[0].text.strip()
IndexError: list index out of range

Similar index issue

[download] Destination: /Users/chrissandison/Desktop/shows/nts/guide-to/Polish Jazz Special - 2020-12-12.m4a
[download] 100% of 58.27MiB in 00:14
adding metadata to Polish Jazz Special - 2020-12-12.m4a ...
Traceback (most recent call last):
  File "/usr/local/bin/nts", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/nts/cli.py", line 73, in main
    url_matcher(arg)
  File "/usr/local/lib/python3.9/site-packages/nts/cli.py", line 57, in url_matcher
    url_matcher(ep)
  File "/usr/local/lib/python3.9/site-packages/nts/cli.py", line 52, in url_matcher
    nts.download(url=url, quiet=options.quiet,
  File "/usr/local/lib/python3.9/site-packages/nts/downloader.py", line 35, in download
    parsed = parse_nts_data(bs)
  File "/usr/local/lib/python3.9/site-packages/nts/downloader.py", line 127, in parse_nts_data
    genres = parse_genres(bs)
  File "/usr/local/lib/python3.9/site-packages/nts/downloader.py", line 165, in parse_genres
    genres_box = bs.select('.episode-genres')[0]
IndexError: list index out of range

Hi, can you please post the link to the show?
I'm gonna use the url you provide to conduct tests.

Can you also post the python and nts package version?
Make sure you're using the latest version (1.1.8) of the nts package.

Looks like something might have changed on nts.live so the parser is crashing.
I'll have a look into it asap

@ChrisSandison I guessed the url for the first error you posted, should be: https://www.nts.live/shows/alexander-nut

I can't reproduce the issue, with version v1.1.9 the first episodes download just fine

Hey @everdrone thanks so much for digging in. I'll upgrade and verify the issue when I'm able to. Thank you so much for your work!