Do not except any raised error
This commit is contained in:
parent
4df67bd475
commit
d6bc9e6728
1 changed files with 15 additions and 19 deletions
|
|
@ -33,7 +33,6 @@ def grab_subtitles(url: str | Path) -> Path:
|
||||||
import yt_dlp
|
import yt_dlp
|
||||||
|
|
||||||
temp_dir = get_temp_dir()
|
temp_dir = get_temp_dir()
|
||||||
try:
|
|
||||||
ydl_opts = {
|
ydl_opts = {
|
||||||
"outtmpl": f"{temp_dir}/subs",
|
"outtmpl": f"{temp_dir}/subs",
|
||||||
"writeautomaticsub": True,
|
"writeautomaticsub": True,
|
||||||
|
|
@ -53,9 +52,6 @@ def grab_subtitles(url: str | Path) -> Path:
|
||||||
|
|
||||||
raise ValueError("No correct json3 transcript object found.")
|
raise ValueError("No correct json3 transcript object found.")
|
||||||
|
|
||||||
except ValueError as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
|
|
||||||
def get_temp_dir() -> str:
|
def get_temp_dir() -> str:
|
||||||
# Create a temporary directory
|
# Create a temporary directory
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue