From a5647bcc9188db25c6dba94697d768e714832929 Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Thu, 13 Oct 2022 02:34:38 +0000 Subject: [PATCH 1/6] Update downloader.py --- downloader.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/downloader.py b/downloader.py index b090289..919aa72 100644 --- a/downloader.py +++ b/downloader.py @@ -69,9 +69,8 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: print('failed trying something else') print(os.listdir(cwd)) - -if os_name == 'darwin': - link = 'https://evermeet.cx/ffmpeg/get/ffmpeg/7z' +elif os_name == 'darwin': + link = 'https://evermeet.cx/ffmpeg/get/ffmpeg/zip' resp = requests.get(link, stream=True) with open('ffmpeg.7z', 'wb') as z: for chunk in resp.iter_content(chunk_size=2048): From aca504dc310d1ef47287684bcc86c3950ef813ae Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Thu, 13 Oct 2022 02:34:41 +0000 Subject: [PATCH 2/6] Update downloader.py --- downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downloader.py b/downloader.py index 919aa72..25ab4b2 100644 --- a/downloader.py +++ b/downloader.py @@ -78,7 +78,7 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: z.write(chunk) arch = glob.glob('ffmpeg*.7z')[0] - fullpath = extract_to_folder('ffmpeg',arch) + fullpath = extract_to_folder('ffmpeg',arch, z=False) out = '../darwin' misc.Paths().convert_to_py(fullpath, out) From 97210e3d8fb1a9b6b7c95680be56b69e309e2f8d Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Thu, 13 Oct 2022 02:37:10 +0000 Subject: [PATCH 3/6] Update downloader.py --- downloader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/downloader.py b/downloader.py index 25ab4b2..8a89b39 100644 --- a/downloader.py +++ b/downloader.py @@ -57,7 +57,7 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: # extract to folder arch = glob.glob('ffmpeg*.7z')[0] fullpath = extract_to_folder('ffmpeg.exe', arch) - out = '../win32' + out = 'win32' misc.Paths().convert_to_py(fullpath, out) # copy all those contents to folder_name, skip exitsting @@ -79,7 +79,7 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: arch = glob.glob('ffmpeg*.7z')[0] fullpath = extract_to_folder('ffmpeg',arch, z=False) - out = '../darwin' + out = 'darwin' misc.Paths().convert_to_py(fullpath, out) @@ -97,7 +97,7 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: arch = glob.glob('ffmpeg*.tar.xz')[0] fullpath = extract_to_folder('ffmpeg', arch, z=False) - out = '../linux' + out = 'linux' misc.Paths().convert_to_py(fullpath, out) From c6510ac9c3c36afbd7260d94b6f43e5d2e558ac0 Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Thu, 13 Oct 2022 02:37:15 +0000 Subject: [PATCH 4/6] Update downloader.py --- downloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/downloader.py b/downloader.py index 8a89b39..a76e66b 100644 --- a/downloader.py +++ b/downloader.py @@ -65,8 +65,8 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: # replace shutil.copy('win32.py', win32) - except: - print('failed trying something else') + except Exception as err: + print(err) print(os.listdir(cwd)) elif os_name == 'darwin': From bedc7b42c611d2f0b76476360e1b3787fd153676 Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Thu, 13 Oct 2022 02:38:32 +0000 Subject: [PATCH 5/6] Update downloader.py --- downloader.py | 56 +++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/downloader.py b/downloader.py index a76e66b..5723624 100644 --- a/downloader.py +++ b/downloader.py @@ -70,38 +70,46 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: print(os.listdir(cwd)) elif os_name == 'darwin': - link = 'https://evermeet.cx/ffmpeg/get/ffmpeg/zip' - resp = requests.get(link, stream=True) - with open('ffmpeg.7z', 'wb') as z: - for chunk in resp.iter_content(chunk_size=2048): - if chunk: - z.write(chunk) + try: + link = 'https://evermeet.cx/ffmpeg/get/ffmpeg/zip' + resp = requests.get(link, stream=True) + with open('ffmpeg.7z', 'wb') as z: + for chunk in resp.iter_content(chunk_size=2048): + if chunk: + z.write(chunk) - arch = glob.glob('ffmpeg*.7z')[0] - fullpath = extract_to_folder('ffmpeg',arch, z=False) - out = 'darwin' + arch = glob.glob('ffmpeg*.7z')[0] + fullpath = extract_to_folder('ffmpeg',arch, z=False) + out = 'darwin' - misc.Paths().convert_to_py(fullpath, out) + misc.Paths().convert_to_py(fullpath, out) - darwin = os.path.join(bin_path, 'darwin') - shutil.copy('darwin.py', darwin) + darwin = os.path.join(bin_path, 'darwin') + shutil.copy('darwin.py', darwin) + except Exception as err: + print(err) + print(os.listdir(cwd)) else: # Download Qmlview archive for os - link = 'https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-i686-static.tar.xz' - resp = requests.get(link, stream=True) - with open('ffmpeg.tar.xz', 'wb') as z: - for chunk in resp.iter_content(chunk_size=2048): - if chunk: - z.write(chunk) + try: + link = 'https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-i686-static.tar.xz' + resp = requests.get(link, stream=True) + with open('ffmpeg.tar.xz', 'wb') as z: + for chunk in resp.iter_content(chunk_size=2048): + if chunk: + z.write(chunk) - arch = glob.glob('ffmpeg*.tar.xz')[0] - fullpath = extract_to_folder('ffmpeg', arch, z=False) - out = 'linux' + arch = glob.glob('ffmpeg*.tar.xz')[0] + fullpath = extract_to_folder('ffmpeg', arch, z=False) + out = 'linux' - misc.Paths().convert_to_py(fullpath, out) + misc.Paths().convert_to_py(fullpath, out) - linux = os.path.join(bin_path, 'linuxmod') - shutil.copy('linux.py', linux) + linux = os.path.join(bin_path, 'linuxmod') + shutil.copy('linux.py', linux) + except Exception as err: + print(err) + print(os.listdir(cwd)) print('All Done') \ No newline at end of file From baa784e3f2771ce3e19a09d680e3e24cc20eb854 Mon Sep 17 00:00:00 2001 From: Amoh Gyebi Ampofo Date: Thu, 13 Oct 2022 02:40:16 +0000 Subject: [PATCH 6/6] Update downloader.py --- downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downloader.py b/downloader.py index 5723624..df3e5ad 100644 --- a/downloader.py +++ b/downloader.py @@ -112,4 +112,4 @@ def extract_to_folder(ffmpeg: str, arch: str, z=True) -> str: print(err) print(os.listdir(cwd)) -print('All Done') \ No newline at end of file +print('All Done')