Utilize shutil.which() for finding youtube-dl binary

This commit is contained in:
Eric Torres 2019-02-20 02:18:34 -08:00
parent 475eaebd96
commit 43013af49f

View File

@ -8,10 +8,11 @@ Dependencies:
import argparse import argparse
import pathlib import pathlib
import shutil
import subprocess import subprocess
# =========== Constants ========== # =========== Constants ==========
YOUTUBE_DL_BIN = '/usr/bin/youtube-dl' YOUTUBE_DL_BIN = shutil.which('youtube-dl')
DEFAULT_FILENAME = f"{pathlib.Path.home()}/Music/%(title)s.%(ext)s" DEFAULT_FILENAME = f"{pathlib.Path.home()}/Music/%(title)s.%(ext)s"
# ========== Error Codes ========== # ========== Error Codes ==========