Skip to content

Commit 6398948

Browse files
committed
fix: ignore warnings
1 parent c7d6069 commit 6398948

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging
44
import re
55
import math
6+
import warnings
67

78
import nltk
89
import googleapiclient.discovery
@@ -11,6 +12,8 @@
1112
from youtube_transcript_api import YouTubeTranscriptApi
1213

1314
logging.basicConfig(level=logging.INFO, force=True)
15+
# stop any warnings
16+
warnings.filterwarnings("ignore")
1417

1518

1619
def clean_for_filename(title):
@@ -98,7 +101,8 @@ def get_transcript(video_id, language, video_info, verbose=True):
98101

99102
if video_info["title"] != "":
100103
transcript = f'# {video_info["title"]}\n\n'
101-
104+
else:
105+
transcript = ''
102106
current_chapter_index = 0
103107
chapters = video_info["chapters"]
104108
logging.info(f"""Transcript_List Length: {

0 commit comments

Comments
 (0)