-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devine-dl:master' into master
- Loading branch information
Showing
15 changed files
with
130 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import shutil | ||
import sys | ||
from pathlib import Path | ||
from typing import Optional | ||
|
||
__shaka_platform = { | ||
"win32": "win", | ||
"darwin": "osx" | ||
}.get(sys.platform, sys.platform) | ||
|
||
|
||
def find(*names: str) -> Optional[Path]: | ||
"""Find the path of the first found binary name.""" | ||
for name in names: | ||
path = shutil.which(name) | ||
if path: | ||
return Path(path) | ||
return None | ||
|
||
|
||
FFMPEG = find("ffmpeg") | ||
FFProbe = find("ffprobe") | ||
FFPlay = find("ffplay") | ||
SubtitleEdit = find("SubtitleEdit") | ||
ShakaPackager = find( | ||
"shaka-packager", | ||
"packager", | ||
f"packager-{__shaka_platform}", | ||
f"packager-{__shaka_platform}-x64" | ||
) | ||
Aria2 = find("aria2c", "aria2") | ||
CCExtractor = find( | ||
"ccextractor", | ||
"ccextractorwin", | ||
"ccextractorwinfull" | ||
) | ||
HolaProxy = find("hola-proxy") | ||
MPV = find("mpv") | ||
Caddy = find("caddy") | ||
|
||
|
||
__all__ = ( | ||
"FFMPEG", "FFProbe", "FFPlay", "SubtitleEdit", "ShakaPackager", | ||
"Aria2", "CCExtractor", "HolaProxy", "MPV", "Caddy", "find" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.