Plex Server Setup Guide
Connect EmbyTok to your Plex media server for a TikTok-style video browsing experience. This guide covers authentication, library access, and the unique aspects of Plex integration.Prerequisites
- Plex Media Server running on your network
- Server URL and port (e.g.,
http://192.168.1.10:32400) - X-Plex-Token for authentication
- Libraries containing video content
Getting Your X-Plex-Token
Plex uses token-based authentication. Here’s how to find your token:Step 1: Configure Plex Connection
Select Plex
Click the Plex button at the top of the login form. It should turn yellow when selected.
Enter Server Details
Fill in the following fields:Server Address:Username (optional):This is just a display name and can be anything.X-Plex-Token / Password (required):Paste the token you obtained in the previous section.
Authentication Flow
Plex authentication differs from Emby. Here’s what happens when you connect:Identity Verification
EmbyTok verifies your Plex server using the identity endpoint fromPlexClient.ts:37-60:
Response Structure
Plex returns machine information:PlexClient.ts:53-59:
The
machineIdentifier is stored as userId and used for constructing playlist URIs later.Step 2: Browse Libraries
After authentication, EmbyTok fetches your Plex libraries.Step 3: Video Browsing
Plex video fetching works differently than Emby but provides the same browsing experience.Fetching Videos
FromPlexClient.ts:128-163, EmbyTok requests videos using:
type=1: Movies/videos onlysort=addedAt:desc: Latest first (orrandomfor shuffle)X-Plex-Container-Start: Pagination offsetX-Plex-Container-Size: Items per page (50 for latest, 80 for random)
Plex to EmbyItem Mapping
Plex responses are transformed to EmbyTok’s internal format fromPlexClient.ts:166-186:
Orientation Filtering
Same as Emby, Plex videos are filtered by aspect ratio fromPlexClient.ts:74-89:
Video Playback
Plex playback uses a fallback strategy for maximum compatibility:Direct Play (Preferred)
If the video has a direct file path, EmbyTok uses direct play fromPlexClient.ts:188-197:
Transcode Fallback (HLS)
If direct play isn’t available:Image Thumbnails
Thumbnails are fetched via Plex’s photo transcoder fromPlexClient.ts:199-203:
Favorites System
Plex favorites use playlists namedTok-{LibraryName}, similar to Emby but with Plex’s URI-based system.
Finding Playlists
FromPlexClient.ts:207-220:
Adding to Favorites
When you like a video fromPlexClient.ts:266-281:
Removing from Favorites
FromPlexClient.ts:245-263:
Plex playlists store the
playlistItemID separately from the video’s ratingKey. EmbyTok handles this mapping automatically.Troubleshooting
Authentication Failed
Invalid Token
Invalid Token
- Verify your X-Plex-Token is correct
- Tokens can expire; generate a new one if needed
- Ensure no extra spaces when copying the token
Connection Refused
Connection Refused
- Verify Plex server is running
- Check firewall settings allow access to port 32400
- Try accessing
http://server-ip:32400/webdirectly
SSL/TLS Errors
SSL/TLS Errors
- Use
http://instead ofhttps://for local connections - If using Plex.tv remote access, use the secure URL provided by Plex
Videos Not Loading
- Check library permissions: Ensure your Plex account has access to the selected library
- Verify video formats: Direct play works best with H.264 MP4 files
- Test transcoding: If direct play fails, EmbyTok falls back to HLS transcoding
Favorites Not Working
- Playlist permissions: Ensure your account can create playlists
- Check machine identifier: EmbyTok needs the correct
machineIdentifierto build playlist URIs - Verify playlist exists: Look for playlists named
Tok-{LibraryName}in Plex Web
Poor Performance
- Use direct play: Ensure videos are in compatible formats (H.264/MP4)
- Reduce transcode load: Lower quality settings if using HLS transcoding
- Check network speed: Run a speed test from EmbyTok’s settings menu
Plex vs Emby Differences
| Feature | Plex | Emby |
|---|---|---|
| Authentication | X-Plex-Token | Username + Password |
| Playback | Direct Play or HLS | Direct Stream MP4 |
| Thumbnails | Photo Transcoder | Direct Image API |
| Playlists | URI-based | ID-based |
| Library IDs | String keys (“1”, “2”) | GUID strings |
Next Steps
- Learn about local folder browsing for offline access
- Set up network deployment for multi-device access
- Explore video browsing features including feed modes and orientation filters