-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Automatically install ffms2 #34
Comments
@rr- Is there any problem with my request? |
Hi, I am interested in this feature as well! |
cc @Luni-4 |
Hi, sorry for the late reply! Yeah, it is a good request, but currently I don't have time to implement it, PRs accepted though! |
I won't do it. But, here is what I did to download the latest ffms2 releases: import ffms2
import json
import os
import re
import requests
import struct
from pyunpack import Archive
# Get ffms2 download url
ffms2Url = requests.get('https://api.github.com/repos/FFMS/ffms2/releases/latest')
ffms2Json = json.loads(ffms2Url.text)
ffms2UrlDownload = ffms2Json["assets"][0]["browser_download_url"]
# Download ffms2
response = requests.get(ffms2UrlDownload)
fname = re.findall("filename=(.+)", response.headers['content-disposition'])[0]
open(fname, "wb").write(response.content)
# Extract ffms2
Archive(fname).extractall(".")
# Get directory where ffms2.dll, ffms2.lib and ffmsindex.exe are
cpuArchitecture = "x64" if struct.calcsize("P")*8 == 64 else "x86"
ffms2Files = "./" + os.path.splitext(fname)[0] + "/" + cpuArchitecture # won't work with posix path
# Copy ffms2 files to pyffms2 directory
fileNames = os.listdir(ffms2Files)
for fileName in fileNames:
shutil.move(os.path.join(ffms2Files, fileName), os.path.dirname((ffms2.__file__))) PS, it need these two dependancy to unzip the file pip install pyunpack
pip install patool |
It would be nice if when we install this tool, it could also install ffms2.
It make it user friendly and when a another program need this tool, it does not need to ask the user to install ffms2 by themself.
The text was updated successfully, but these errors were encountered: