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 Oct 19, 2023
1 parent 1a01e01 commit aa7e517
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 aa7e517

Please sign in to comment.