Don't fail on 502 errors

This commit is contained in:
7x11x13
2021-05-06 06:16:30 -04:00
parent 825dd367a0
commit 06592b8932
2 changed files with 16 additions and 13 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ from configparser import ConfigParser
logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO'))
logger = logging.getLogger(__name__)
__version__ = 'v0.0.2'
__version__ = 'v0.0.3'
if 'XDG_CONFIG_HOME' in os.environ:
config_dir = os.path.join(os.environ['XDG_CONFIG_HOME'], 'free-bandcamp-downloader')
+3
View File
@@ -249,6 +249,7 @@ def main():
logger.info(f'Waiting for {expected_emails} emails from bandcamp')
while expected_emails > 0:
time.sleep(10)
try:
for email in mail_session.get_email_list():
if email.guid not in checked_ids:
checked_ids.add(email.guid)
@@ -261,6 +262,8 @@ def main():
driver.get(download_url)
download_file()
expected_emails -= 1
except Exception as e:
logger.error(e)
if __name__ == '__main__':
main()