mirror of
https://github.com/k4yt3x/video2x.git
synced 2025-01-30 23:58:11 +00:00
setup script 2.4.0: updated FFmpeg download URL and unpacking method
This commit is contained in:
parent
b37acfa31d
commit
4f8bb1be1c
@ -4,7 +4,7 @@
|
|||||||
Name: Video2X Setup Script
|
Name: Video2X Setup Script
|
||||||
Creator: K4YT3X
|
Creator: K4YT3X
|
||||||
Date Created: November 28, 2018
|
Date Created: November 28, 2018
|
||||||
Last Modified: September 28, 2020
|
Last Modified: October 26, 2020
|
||||||
|
|
||||||
Editor: BrianPetkovsek
|
Editor: BrianPetkovsek
|
||||||
Editor: SAT3LL
|
Editor: SAT3LL
|
||||||
@ -44,7 +44,7 @@ import zipfile
|
|||||||
# Therefore, they will be installed during the Python dependency
|
# Therefore, they will be installed during the Python dependency
|
||||||
# installation step and imported later in the script.
|
# installation step and imported later in the script.
|
||||||
|
|
||||||
SETUP_VERSION = '2.3.0'
|
SETUP_VERSION = '2.4.0'
|
||||||
|
|
||||||
# global static variables
|
# global static variables
|
||||||
LOCALAPPDATA = pathlib.Path(os.getenv('localappdata'))
|
LOCALAPPDATA = pathlib.Path(os.getenv('localappdata'))
|
||||||
@ -126,21 +126,26 @@ class Video2xSetup:
|
|||||||
"""
|
"""
|
||||||
print('\nInstalling FFmpeg')
|
print('\nInstalling FFmpeg')
|
||||||
|
|
||||||
latest_release = 'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.zip'
|
import patoolib
|
||||||
|
|
||||||
ffmpeg_zip = download(latest_release, tempfile.gettempdir())
|
latest_release = 'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z'
|
||||||
self.trash.append(ffmpeg_zip)
|
|
||||||
|
ffmpeg_7z = download(latest_release, tempfile.gettempdir())
|
||||||
|
self.trash.append(ffmpeg_7z)
|
||||||
|
|
||||||
|
# if running in PyInstaller, add sys._MEIPASS\7z to path
|
||||||
|
# this directory contains 7za.exe and its DLL files
|
||||||
|
with contextlib.suppress(AttributeError):
|
||||||
|
os.environ['PATH'] += f';{sys._MEIPASS}\\7z'
|
||||||
|
|
||||||
ffmpeg_directory = LOCALAPPDATA / 'video2x' / 'ffmpeg'
|
ffmpeg_directory = LOCALAPPDATA / 'video2x' / 'ffmpeg'
|
||||||
with zipfile.ZipFile(ffmpeg_zip) as zipf:
|
|
||||||
zipf.extractall(LOCALAPPDATA / 'video2x')
|
|
||||||
|
|
||||||
# if directory already exists, remove it
|
# (ffmpeg_directory).mkdir(parents=True, exist_ok=True)
|
||||||
if ffmpeg_directory.exists():
|
# pyunpack.Archive(ffmpeg_7z).extractall(ffmpeg_directory)
|
||||||
shutil.rmtree(ffmpeg_directory)
|
if (ffmpeg_directory).exists():
|
||||||
|
shutil.rmtree(ffmpeg_directory)
|
||||||
# rename the newly extracted directory
|
patoolib.extract_archive(str(ffmpeg_7z), outdir=str(LOCALAPPDATA / 'video2x'))
|
||||||
(LOCALAPPDATA / 'video2x' / zipf.namelist()[0]).rename(ffmpeg_directory)
|
(LOCALAPPDATA / 'video2x' / ffmpeg_7z.stem).rename(ffmpeg_directory)
|
||||||
|
|
||||||
def _install_gifski(self):
|
def _install_gifski(self):
|
||||||
print('\nInstalling Gifski')
|
print('\nInstalling Gifski')
|
||||||
|
Loading…
Reference in New Issue
Block a user