FabricYTProxy is a Python-based application that integrates with Fabric and YT binaries to provide a proxy service. It includes a FastAPI server for handling API requests and a system tray application for managing the API server status. The application supports both macOS and Windows platforms.
A MacOS and Windows executable is provided for easy installation. Click the latest release.
When running on windows, fabric is ran using WSL, we need a WSL1 or WSL2 distribution running and set as default, fabric installed, fabric configures, and the user must be the same as your windows user.
Ensure you have Python 3.7+ installed on your system. You will also need to have the Fabric and YT binaries installed and accessible in your system's PATH.
Portable executables are available for MacOS and Windows (Releases)[https://github.com/chasebank87/fabric-connector/releases]
Clone the repository (into Obsidian-Plugins Folder?):
git clone https://github.com/chasebank87/fabric-connector.git
cd fabric-connector
Install the required Python packages:
pip install -r requirements.txt
Ensure the paths to the Fabric and YT binaries are correctly set in the code:
FABRIC_PATH = "/path/to/fabric"
YT_PATH = "/path/to/yt"
The project relies on several Python packages, which are listed in requirements.txt
:
rumps==0.4.0
fastapi==0.95.1
uvicorn==0.22.0
pydantic==1.10.7
requests==2.30.0
pystray==0.19.4
pillow==9.5.0
pyinstaller==5.10.1
py2app==0.28.6
When using windows
To start the application, run:
python main.py
This will start the system tray application and the FastAPI server.
The system tray application provides options to:
The FastAPI server exposes several endpoints:
/fabric
Runs the Fabric binary with the provided command and returns the output.
Request Body:
{
"pattern": "pattern_name",
"data": "input_data"
}
Response:
{
"output": "result_output"
}
/yt
Runs the YT binary with the provided command and returns the output.
Request Body:
{
"pattern": "pattern_name",
"url": "video_url"
}
Response:
{
"output": "result_output"
}
/patterns
Returns a list of available patterns from the Fabric binary.
Response:
{
"data": {
"patterns": [
{"name": "pattern1"},
{"name": "pattern2"}
]
}
}
To build a macOS application bundle, use pyinstaller
:
pyinstaller main.spec
To build a Windows executable, use pyinstaller
:
pyinstaller main.spec
To run tests, use:
pytest tests/
This project is licensed under the MIT License. See the LICENSE file for details.
For more information, please refer to the documentation.