Skip to content

Commit

Permalink
If no link was found, try again looking for tmp2/ links (Fixes Issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
talister committed Jul 30, 2024
1 parent 780162d commit 713bf3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions neoexchange/astrometrics/sources_subs.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ def fetch_mpcobs(asteroid, debug=False):
# the other links. Turn any pluses (which were spaces) into underscores.
link = [x.get('href') for x in refs if 'tmp/'+asteroid.replace('+', '_').replace('/', '_') in x.get('href')]

if len(link) == 0:
# Try again in case the link is now a `tmp2/`
link = [x.get('href') for x in refs if 'tmp2/'+asteroid.replace('+', '_').replace('/', '_') in x.get('href')]

if len(link) == 1:
# Replace the '..' part with proper URL

Expand Down

0 comments on commit 713bf3c

Please sign in to comment.