Skip to content

Commit

Permalink
PR: Catching pydub's warning of ffmpeg or avconv missing
Browse files Browse the repository at this point in the history
  • Loading branch information
SH4DOW4RE committed Dec 15, 2024
1 parent 81e3f24 commit b7f5662
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/markitdown/_markitdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import traceback
from typing import Any, Dict, List, Optional, Union
from urllib.parse import parse_qs, quote, unquote, urlparse, urlunparse
from warnings import catch_warnings

import mammoth
import markdownify
Expand All @@ -29,7 +30,12 @@

# Optional Transcription support
try:
import pydub
# Using warnings' catch_warnings to catch
# pydub's warning of ffmpeg or avconv missing
with catch_warnings(record=True) as w:
import pydub
if w:
raise ModuleNotFoundError
import speech_recognition as sr

IS_AUDIO_TRANSCRIPTION_CAPABLE = True
Expand Down

0 comments on commit b7f5662

Please sign in to comment.