Investigate and silence warnings. (#1133)

This commit is contained in:
afourney
2025-03-15 23:41:35 -07:00
committed by GitHub
parent 5c565b7d79
commit 53834fdd24
2 changed files with 11 additions and 0 deletions

View File

@@ -13,6 +13,11 @@ try:
warnings.filterwarnings( warnings.filterwarnings(
"ignore", category=DeprecationWarning, module="speech_recognition" "ignore", category=DeprecationWarning, module="speech_recognition"
) )
warnings.filterwarnings(
"ignore",
category=SyntaxWarning,
module="pydub", # TODO: Migrate away from pydub
)
import speech_recognition as sr import speech_recognition as sr
import pydub import pydub

View File

@@ -4,6 +4,7 @@ import time
import io import io
import re import re
import bs4 import bs4
import warnings
from typing import Any, BinaryIO, Optional, Dict, List, Union from typing import Any, BinaryIO, Optional, Dict, List, Union
from urllib.parse import parse_qs, urlparse, unquote from urllib.parse import parse_qs, urlparse, unquote
@@ -13,6 +14,11 @@ from ._markdownify import _CustomMarkdownify
# Optional YouTube transcription support # Optional YouTube transcription support
try: try:
warnings.filterwarnings(
"ignore",
category=SyntaxWarning,
module="youtube_transcript_api", # Patch submitted to youtube-transcript-api
)
from youtube_transcript_api import YouTubeTranscriptApi from youtube_transcript_api import YouTubeTranscriptApi
IS_YOUTUBE_TRANSCRIPT_CAPABLE = True IS_YOUTUBE_TRANSCRIPT_CAPABLE = True