The sync tool copies files directly from the filesystem, not through Plex streaming.
┌─────────────┐ ┌──────────────┐ ┌─────────┐
│ Plex Server │──────▶│ Your Mac │──────▶│ iPod │
│ │ API │ │ Copy │ │
│ Metadata │ │ File Access │ │ Storage │
└─────────────┘ └──────────────┘ └─────────┘
│ │
│ │
▼ ▼
File Paths Actual Files
Setup:
Your Mac
├── Plex Server (running locally)
└── Music files at: /Users/jarren/Music/
How it works:
- Plex says: "Song is at
/Users/jarren/Music/Artist/Song.mp3" - Script accesses file directly (local filesystem)
- Copies to iPod ✅
Config needed:
# No path mapping needed!
path_mapping:
server_path: ""
local_path: ""Setup:
Server (192.168.1.50)
├── Plex Server (running)
└── Music files at: /mnt/music/
Your Mac (192.168.1.100)
├── Connects to Plex via API
└── Needs to mount server's /mnt/music/
The Problem:
Plex reports: /mnt/music/Artist/Song.mp3
Your Mac thinks: "I don't have /mnt/music/!"
Result: ✗ File not found
The Solution - Mount & Map:
# Create mount point
mkdir -p ~/Music/ServerMusic
# Mount the server's music share
mount_smbfs //username@192.168.1.50/music ~/Music/ServerMusicNow your Mac can access files at:
~/Music/ServerMusic/Artist/Song.mp3
Edit config.yaml:
plex:
url: "http://192.168.1.50:32400"
# ... other settings ...
path_mapping:
server_path: "/mnt/music" # Server's path
local_path: "/Users/jarren/Music/ServerMusic" # Your Mac's mountPlex reports: /mnt/music/Artist/Album/Song.mp3
↓ (path mapping)
Script translates: /Users/jarren/Music/ServerMusic/Artist/Album/Song.mp3
↓
Script accesses: ~/Music/ServerMusic/Artist/Album/Song.mp3
↓
Copies to iPod: /Volumes/IPOD/Music/Artist/Album/Song.mp3
To find what path Plex uses:
- Open a song in Plex Web
- Click "..." → "Get Info"
- Look at the file path shown
- Example:
/mnt/media/music/Artist/Song.mp3 - The prefix is:
/mnt/media/music
- Go to Settings → Libraries → Music
- View the library folder path
- That's your server path
# Get a track's path
curl -X GET "http://YOUR_PLEX_IP:32400/library/sections/1/all?X-Plex-Token=YOUR_TOKEN" | grep -o '<Part.*file="[^"]*"' | head -1
# Look for the file="..." attribute
# Example output: file="/mnt/music/..."# Interactive (prompts for password)
mount_smbfs //username@server-ip/music ~/Music/ServerMusic
# With credentials
mount_smbfs //username:password@server-ip/music ~/Music/ServerMusic# Mount NFS share
sudo mount -t nfs server-ip:/export/music ~/Music/ServerMusic
# Add to /etc/fstab for automatic mounting
server-ip:/export/music /Users/jarren/Music/ServerMusic nfs auto,noowners 0 0mount_afp afp://username@server-ip/music ~/Music/ServerMusic- Finder → Go → Connect to Server (⌘K)
- Enter:
smb://server-ip/music - Connect and authenticate
- Note where it mounts (usually
/Volumes/music) - Use that as
local_path
To mount automatically when syncing:
Create ~/sync-ipod-with-mount.sh:
#!/bin/bash
# Mount server music
echo "Mounting server music..."
if [ ! -d ~/Music/ServerMusic/Artist ]; then
mkdir -p ~/Music/ServerMusic
mount_smbfs //username@server-ip/music ~/Music/ServerMusic
fi
# Mount iPod
if [ ! -d /Volumes/IPOD ]; then
diskutil mount /dev/disk4s2
fi
# Run sync
cd /Users/jarren/Nextcloud/Documents/Resources/Scripts/plex-ipod-playlist-sync
python3 plex_ipod_sync.py "$@"
# Cleanup
read -p "Unmount server and iPod? (y/n) " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
umount ~/Music/ServerMusic
diskutil unmount /Volumes/IPOD
fiFor NFS shares, add to /etc/fstab:
server-ip:/export/music /Users/jarren/Music/ServerMusic nfs auto,noowners 0 0
Then it mounts automatically at boot.
✗ File not found: /mnt/music/Artist/Song.mp3
Causes:
- Server mount not active
- Wrong path mapping
- File actually missing
Fix:
# Check if server is mounted
ls ~/Music/ServerMusic/
# If empty or error, remount
mount_smbfs //user@server/music ~/Music/ServerMusic
# Verify file exists
ls ~/Music/ServerMusic/Artist/Song.mp3If files still not found after configuring mapping:
-
Check exact paths:
# What does Plex report? # Run sync with --dry-run and look at error messages # Does local path exist? ls -la /Users/jarren/Music/ServerMusic/
-
Test translation manually:
# Test in Python server = "/mnt/music/test.mp3" local = server.replace("/mnt/music", "/Users/jarren/Music/ServerMusic", 1) print(local) # Should output: /Users/jarren/Music/ServerMusic/test.mp3
-
Verify exact prefixes match:
- Server path:
/mnt/music✓ - Server path:
/mnt/music/✗ (trailing slash) - Must match exactly!
- Server path:
Permission denied: /Users/jarren/Music/ServerMusic/...
Fix:
- Check mount permissions
- May need to mount with your user ID
- For SMB:
mount_smbfs -o nosuid,noowners ...
For a typical LAN server setup:
plex:
url: "http://192.168.1.50:32400"
use_token: true
token: "abc123xyz"
music_library: "Music"
# Server reports paths like: /mnt/media/music/...
# But files are mounted at: ~/Music/ServerMusic/...
path_mapping:
server_path: "/mnt/media/music"
local_path: "/Users/jarren/Music/ServerMusic"
ipod:
mount_point: "/Volumes/IPOD"
music_dir: "/Volumes/IPOD/Music"
playlist_dir: "/Volumes/IPOD/Playlists"- Mount server music directory on Mac
- Verify files are accessible:
ls ~/Music/ServerMusic/ - Find server path from Plex
- Configure path mapping in config.yaml
- Test with
--dry-runfirst - Check for "File not found" errors
- Adjust paths if needed
- Run actual sync
Created: 2025-10-29 For: Plex to iPod Playlist Sync Tool