Skip to content

About

A Homebrew Nintendo Switch sysmodule for automatic upload screen captures to Telegram/Discord/ntfy

Topics

Resources

Stars

16 stars

Watchers

2 watching

Forks

Repository files navigation

NX-ScreenUploader

English | 中文

NX-ScreenUploader automatically sends screen captures (both images and videos) taken on your Nintendo Switch to Telegram and/or ntfy.sh so that you can more easily access and share them.

This project was forked from bakatrouble/sys-screenuploader and musse/sys-screen-capture-uploader and yuno-kojo/sys-screen-capture-uploader. It differs from the original project because no intermediate server is needed. The screen captures are directly uploaded to the Telegram or ntfy.sh or Discord.

Features

  • Automatically uploads screenshots and screen recordings taken on the Switch
  • Multiple upload destinations: Telegram/Discord/ntfy.sh/Immich
  • Custom Telegram Bot API URL support (for reverse proxy)
  • Custom new screen capture check interval support
  • Less memory usage compared to the original project (from ~1.852 MB to ~1.339 MB)
  • No more fatal crashes when opening nxmenu in applet mode alongside other sysmodules

Supported Upload Destinations

  • Telegram: Uploads screen captures to a chat with your own Telegram bot. You can then easily access and share the captures from your Telegram.
  • ntfy.sh: Uploads screen captures to a specified ntfy.sh topic. You can subscribe to this topic using the ntfy mobile app or web interface to receive the captures as notifications.
  • Discord: Uploads screen captures to a specified channel in your Discord server using a Discord bot. You can then view and share the captures from that channel.
  • Immich: Uploads screen captures to your self-hosted Immich instance using its API. You can then view and manage the captures from the Immich web interface or mobile app.

Requirements

You need a Nintendo Switch running Atmosphere, a custom firmware which will allow you to run homebrew. Check this guide if you don't know how to hack your Switch.

Setup

You can choose to upload to Telegram, ntfy.sh, or both. Configure at least one upload destination.

Prepare Destinations

At least one upload destination must be configured.

Telegram

To use Telegram, you must create your own Telegram bot. It will send your Switch screen captures to you (and only to you) on a private chat.

  1. Create a Telegram bot. Choose any name and username of your preference. Note down its API Token.
  2. Send any message to your bot from the Telegram user that should receive the screenshots.
  3. Open https://api.telegram.org/bot<your-bot-token>/getUpdates on your browser. You should see a single result with your message. Note down the chat ID (.result[0].message.chat.id in jq filter notation).

ntfy.sh

ntfy.sh is a simple HTTP-based pub-sub notification service. You can use the public instance or host your own.

Note that ntfy.sh topics are public by default. Anyone who knows your topic name can publish or subscribe to it. Therefore, it's recommended to choose a unique and hard-to-guess topic name. You can also protect your topic with an access token.

  1. Choose a unique, hard-to-guess topic name (e.g., my-switch-captures-abcdefg)
  2. (Optional) If you want to protect your topic, create an access token at ntfy.sh/account
  3. Subscribe to your topic using the ntfy mobile app or web interface (e.g., https://ntfy.sh/my-switch-captures-abcdefg)

Discord

To use Discord, you must create your own Discord APP and Bot. It will send your Switch screen captures to a specified channel in your server.

Discord configuration is a little more complex than Telegram and ntfy.sh.

Follow Creating a Bot Account to obtain your Bot Token and invite the bot to your server with the appropriate permissions (at least "Send Messages").

Then get the Channel ID of the channel where you want the screenshots to be sent. You can do this by enabling Developer Mode in Discord settings, then right-clicking on the desired channel and selecting "Copy Channel ID".

Immich

To use Immich, you must have a self-hosted Immich instance and create an API token for authentication. Grab it from https://my.immich.app/user-settings?isOpen=api-keys

Installation

Once you have prepared your upload destination(s), you can install the sysmodule on your Switch:

  1. Download the latest release and extract it somewhere.
  2. Copy config/NX-ScreenUploader/config.ini.template to config/NX-ScreenUploader/config.ini and configure your upload destination(s):
    • For Telegram: Set telegram = true in [general], then configure bot_token and chat_id in [telegram] section
    • For ntfy.sh: Set ntfy = true in [general], then configure topic (and optionally token) in [ntfy] section
    • For Discord: Set discord = true in [general], then configure bot_token and channel_id in [discord] section
    • For Immich: Set immich = true in [general], then configure server_url and api_key in [immich] section
    • You can enable destinations simultaneously
    • Optional: upload timeouts and retries can be adjusted in the [upload] section, see Upload Tuning
  3. Copy the release contents to the root of your SD card.

Upload Tuning (optional)

config.ini ships with values that work well on a normal home network, so this section only matters when uploads time out or a destination throttles you. All keys belong to the [upload] section at the end of the file.

Key Default Description
image_connect_timeout / video_connect_timeout 10 / 15 Seconds allowed for establishing the connection.
image_idle_timeout / video_idle_timeout 30 / 60 Abort the transfer when it stays below low_speed_limit for this many seconds.
image_total_timeout / video_total_timeout 60 / 300 Hard limit in seconds for a single attempt.
low_speed_limit 1 Bytes per second that still count as progress.
image_max_attempts / video_max_attempts 2 / 3 Total attempts per channel for one file, 1 disables retries.
retry_base_ms 1000 Delay before the first retry.
retry_max_ms 15000 Upper bound for the exponential backoff.
retry_after_cap_ms 60000 Upper bound for a Retry-After wait requested by the server.
image_item_budget / video_item_budget 0 Seconds a single file may occupy the upload queue, 0 means unlimited.

How retries behave:

  • Only failures that can succeed later are retried: timeouts, connection errors, HTTP 408/425/429 and 5xx. A 401, 403, 404 or 413 gives up immediately, so a wrong token or an oversized file does not waste minutes.
  • Delays start at retry_base_ms, double up to retry_max_ms and carry a ±20% jitter. A Retry-After header sent by the server takes precedence, capped at retry_after_cap_ms.
  • Retries are spread across the regular detection loop instead of blocking it, so the sysmodule keeps detecting new captures while a file waits for its next attempt. Once *_max_attempts rounds are used up (or the item budget is exhausted) the file is dropped and an error is logged.
  • Every attempt is bounded by its total timeout, so the worst case for one file is roughly enabled_channels × attempts × total_timeout. Set video_item_budget (for example to 600) to enforce a hard ceiling.

Development

Dependencies

You can install devkitpro-pacman and then install the needed dependencies with:

sudo dkp-pacman -Syu
sudo dkp-pacman -S devkitA64 switch-dev switch-curl switch-zlib

Check the following links for additional details on how to set up your environment for Switch homebrew development:

Build

To build the project, you also need CMake.

bash scripts/build.sh
bash scripts/release.sh

Or manually:

mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../devkita64-libnx.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

You should now have a Makefile inside the build directory and can simply run make to build the project. The relevant binary file is NX-ScreenUploader.nsp.

After building the project, you can generate a release by running scripts/release.sh from the repository root. This will create the correct directory structure that should be copied to the root of your SD card and also a zip file containing all these files.

Credits

About

A Homebrew Nintendo Switch sysmodule for automatic upload screen captures to Telegram/Discord/ntfy

Topics

Resources

Stars

16 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages