mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 12:05:35 +00:00
Fix ffmpeg repo version
This commit is contained in:
parent
cb67d96335
commit
bd03839f97
@ -21,6 +21,7 @@ from rich.progress import Progress, SpinnerColumn, BarColumn, TextColumn, TimeRe
|
|||||||
console = Console()
|
console = Console()
|
||||||
|
|
||||||
# https://github.com/eugeneware/ffmpeg-static/releases
|
# https://github.com/eugeneware/ffmpeg-static/releases
|
||||||
|
# https://github.com/GyanD/codexffmpeg/releases/
|
||||||
FFMPEG_CONFIGURATION = {
|
FFMPEG_CONFIGURATION = {
|
||||||
'windows': {
|
'windows': {
|
||||||
'base_dir': lambda home: os.path.join(os.path.splitdrive(home)[0] + os.path.sep, 'binary'),
|
'base_dir': lambda home: os.path.join(os.path.splitdrive(home)[0] + os.path.sep, 'binary'),
|
||||||
@ -150,7 +151,7 @@ class FFMPEGDownloader:
|
|||||||
|
|
||||||
return tuple(found_executables) if len(found_executables) == 3 else (None, None, None)
|
return tuple(found_executables) if len(found_executables) == 3 else (None, None, None)
|
||||||
|
|
||||||
def _get_latest_version(self) -> Optional[str]:
|
def _get_latest_version(self, repo: str) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
Get the latest FFmpeg version from the GitHub releases page.
|
Get the latest FFmpeg version from the GitHub releases page.
|
||||||
|
|
||||||
@ -162,14 +163,13 @@ class FFMPEGDownloader:
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
# Use GitHub API to fetch the latest release
|
# Use GitHub API to fetch the latest release
|
||||||
response = requests.get(
|
response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest')
|
||||||
'https://api.github.com/repos/eugeneware/ffmpeg-static/releases/latest'
|
|
||||||
)
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
latest_release = response.json()
|
latest_release = response.json()
|
||||||
|
|
||||||
# Extract the tag name or version from the release
|
# Extract the tag name or version from the release
|
||||||
return latest_release.get('tag_name')
|
return latest_release.get('tag_name')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Unable to get version from GitHub: {e}")
|
logging.error(f"Unable to get version from GitHub: {e}")
|
||||||
return None
|
return None
|
||||||
@ -273,7 +273,10 @@ class FFMPEGDownloader:
|
|||||||
if all([existing_ffmpeg, existing_ffprobe, existing_ffplay]):
|
if all([existing_ffmpeg, existing_ffprobe, existing_ffplay]):
|
||||||
return existing_ffmpeg, existing_ffprobe, existing_ffplay
|
return existing_ffmpeg, existing_ffprobe, existing_ffplay
|
||||||
|
|
||||||
version = self._get_latest_version()
|
repo = 'GyanD/codexffmpeg' if self._detect_system() == 'windows' else 'eugeneware/ffmpeg-static'
|
||||||
|
console.print(f"[red]Use {repo} repo for downloading ffmpeg.")
|
||||||
|
version = self._get_latest_version(repo)
|
||||||
|
|
||||||
if not version:
|
if not version:
|
||||||
logging.error("Cannot proceed: version not found")
|
logging.error("Cannot proceed: version not found")
|
||||||
return None, None, None
|
return None, None, None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user