/remarkable-file-upload-python

Utility to upload folders to your remarkable 2 using python

Primary LanguagePython

Remarkable File Upload Script

A Python script to upload multiple files from a folder to a Remarkable device via its web interface.

Connect the tablet over USB.

I didnt take the time to reverse how the folder selection is made. So simply open the target folder through the web interface beforehand and then run the script.

Associated HTTP requests :

GET /documents/<parent_folder_uuid> HTTP/1.1
Host: 10.11.99.1
sentry-trace: <uselesstracking>
Accept-Language: en-US,en;q=0.9
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
baggage: <uselesstracking>
Accept: */*
Referer: http://10.11.99.1/
Accept-Encoding: gzip, deflate, br
Connection: keep-alive


POST /upload HTTP/1.1
Host: 10.11.99.1
Content-Length: 748202
sentry-trace: <uselesstracking>
Accept-Language: en-US,en;q=0.9
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryPegqNbDC4ubNjzpE
baggage: <uselesstracking>
Accept: */*
Origin: http://10.11.99.1
Referer: http://10.11.99.1/
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

------WebKitFormBoundaryPegqNbDC4ubNjzpE
Content-Disposition: form-data; name="file"; filename=yourfile.pdf"
Content-Type: application/pdf
...
------WebKitFormBoundaryPegqNbDC4ubNjzpE--

HTTP/1.1 201 
Content-Type: application/json; charset=ISO-8859-1
Content-Length: 30

{"status":"Upload successful"}

Features

  • Upload multiple files from a folder in one command
  • Filter files by extension (e.g., only PDFs)
  • Configurable delay between uploads to avoid overwhelming the server
  • Detailed progress reporting and error handling
  • Supports the exact HTTP format used by the Remarkable web interface

Installation

  1. Install Python 3.6 or higher
  2. Install dependencies:
    pip install -r requirements.txt

Usage

Basic Usage

Upload all files from a folder:

python upload_files.py /path/to/your/files

Advanced Usage

Upload only PDF files with a 2-second delay between uploads:

python upload_files.py /path/to/your/files --extensions pdf --delay 2

Upload to a different server:

python upload_files.py /path/to/your/files --server http://192.168.1.100/upload

Upload without any delay between files:

python upload_files.py /path/to/your/files --no-delay

Command Line Options

  • folder: Path to the folder containing files to upload (required)
  • --server, -s: Server upload URL (default: http://10.11.99.1/upload)
  • --extensions, -e: File extensions to include (e.g., pdf epub)
  • --delay, -d: Delay between uploads in seconds (default: 1.0)
  • --no-delay: Upload files without any delay

Examples

# Upload all files from current directory
python upload_files.py .

# Upload only PDF and EPUB files
python upload_files.py /Documents --extensions pdf epub

# Upload with 5-second delay between files
python upload_files.py /Downloads --delay 5

# Upload to a different Remarkable device
python upload_files.py /Books --server http://192.168.1.50/upload

Expected Server Response

The script expects the server to respond with:

{"status": "Upload successful"}

Error Handling

The script provides detailed error reporting for:

  • Network connectivity issues
  • File not found errors
  • Invalid server responses
  • HTTP errors

Notes

  • The script uses the same HTTP headers as the original browser request
  • Files are uploaded as multipart form data
  • The script includes a 1-second delay between uploads by default to avoid overwhelming the server
  • All file extensions are matched case-insensitively

Troubleshooting

  1. Connection refused: Make sure your Remarkable device is connected to the same network and the web interface is accessible
  2. Upload failed: Check that the file format is supported by your Remarkable device
  3. Permission denied: Ensure you have read access to the files you're trying to upload