Исправление: Условие для исключения изображений которые в теле письма

This commit is contained in:
2025-09-03 15:12:41 +03:00
parent fc4327838e
commit 2a17ae8526

View File

@ -138,6 +138,8 @@ def process_emails():
continue continue
if part.get('Content-Disposition') is None: if part.get('Content-Disposition') is None:
continue continue
if part.get_content_disposition() == 'inline':
continue
attachment_count += 1 attachment_count += 1
# Пропустить, если вложений несколько # Пропустить, если вложений несколько
@ -152,6 +154,8 @@ def process_emails():
continue continue
if part.get('Content-Disposition') is None: if part.get('Content-Disposition') is None:
continue continue
if part.get_content_disposition() == 'inline':
continue
filename = part.get_filename() filename = part.get_filename()
# Расшифровать имя файла, если оно закодировано # Расшифровать имя файла, если оно закодировано
@ -330,6 +334,8 @@ def upload_files_to_web(processed_numbers):
successful_uploads.append(number) successful_uploads.append(number)
time.sleep(2)
except Exception as e: except Exception as e:
print(f"Не удалось загрузить файл для номера {number}: {str(e)}") print(f"Не удалось загрузить файл для номера {number}: {str(e)}")
failed_uploads.append(number) failed_uploads.append(number)