Skip to content

Commit

Permalink
Merge pull request #7 from verdurin/missing-station
Browse files Browse the repository at this point in the history
Fixes cases where there is no station
  • Loading branch information
everdrone authored Mar 31, 2021
2 parents 2e65218 + 686b3ce commit 5ddbac5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nts/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ def parse_nts_data(bs):
# parse artists in the title
artists, parsed_artists = parse_artists(title, bs)

station = title_box.div.div.h2.find(text=True, recursive=False).strip()
station = title_box.div.div.h2.find(text=True, recursive=False)
if not station:
station = 'London'
else:
station = station.strip()

bg_tag = bs.select('section#bg[style]')
background_image_regex = r'background-image:url\((.*)\)'
Expand Down

0 comments on commit 5ddbac5

Please sign in to comment.