Skip to content

coconono/patreon-audio-uploader

Repository files navigation

Patreon Audio Uploader

This script automates uploading your latest VCV Rack2 recording to a Patreon post by simulating drag-and-drop in your browser. No API access or keys required.

Features

  • Opens the Patreon post edit page in your default browser and tiles it left
  • Opens Finder, tiles it right, and selects the newest file in your VCV Rack2 recordings folder
  • Locates and clicks the Audio button using image recognition
  • Simulates dragging and dropping the newest file into the Patreon post editor
  • Cleans up stray files after upload

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/patreon-audio-uploader.git
    cd patreon-audio-uploader
  2. (Recommended) Create and activate a Python virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required dependencies:

    pip install -r requirements.txt

Configuration

  1. Place screenshots named audio_button.png and upload_area.png in the script directory.

  2. Run the script:

    python src/patreon_dragdrop.py

Requirements

  • macOS
  • Python 3.8+
  • pyautogui
  • pillow

Notes

  • No Patreon API access is used.
  • $HOME is used for user directories.
  • The script uses AppleScript to tile windows.

Usage

To upload your latest recording to Patreon:

python src/patreon_dragdrop.py
  1. The script will open the Patreon post edit page in your default browser.
  2. It will find the newest file in ~/Library/Application Support/Rack2/recordings.
  3. The script will attempt to locate the 'Audio' button and upload area using image recognition.
  4. If a match is found, it will simulate clicking and dragging the file into the upload area.
  5. For troubleshooting, the script saves a screenshot of the matched region as matched_audio_button.png or matched_upload_area.png in the src directory.

Further Notes

  • This script requires pyautogui for simulating mouse actions.
  • pillow and pyscreenshot are used for image processing and saving matched regions.
  • You may need to grant accessibility permissions to your terminal or Python in macOS System Settings > Privacy & Security > Accessibility and Screen Recording.
  • The script uses a strict image matching threshold (default: 0.98). If the button is not found, update your screenshots or adjust the threshold in the script.
  • Screenshots for the 'Audio' button and upload area must be saved as audio_button.png and upload_area.png in the src directory. Make sure they match the browser's appearance, zoom, and resolution.

Contributing

Feel free to submit issues or pull requests if you have suggestions or improvements for the project.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Troubleshooting

  • If the script cannot find the button or upload area, check the saved matched images for debugging.
  • Update your reference screenshots if the Patreon UI changes.
  • Ensure your browser is at 100% zoom and on the same monitor/resolution as when you took the screenshots.

Testing

The old API-based uploader and tests are deprecated. Only the drag-and-drop script is supported.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages