mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 11:56:18 -05:00
Returning all urls from a playlist, unless they're already downloaded. Changing all which() calls to contain BIN for clarity.
This commit is contained in:
parent
01c7f0716b
commit
c772b57ddb
8 changed files with 58 additions and 77 deletions
|
|
@ -91,12 +91,12 @@ def split_file_name(path: Path) -> List[str]:
|
|||
return words
|
||||
|
||||
|
||||
FILE_PATH = which('file', '/usr/bin/file')
|
||||
FILE_BIN = which('file', '/usr/bin/file')
|
||||
|
||||
|
||||
def get_mimetype(path: Path) -> str:
|
||||
"""Get the mimetype using the builtin `file` command."""
|
||||
cmd = (FILE_PATH, '--mime-type', str(path.absolute()))
|
||||
cmd = (FILE_BIN, '--mime-type', str(path.absolute()))
|
||||
output = subprocess.check_output(cmd)
|
||||
output = output.decode()
|
||||
mimetype = output.split(' ')[-1].strip()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue