Plex/Plex Media Server

Plex
Plex - Plex Media Server: Your Media on all of Your Devices - Plex.tv - http://plex.tv/

Plex Download - https://plex.tv/downloads

myPlex Account - https://my.plexapp.com/

Plex Media Center bridges the gap between your computer and your home theater, doing so with a visually appealing user interface that provides instant access to your media.

http://www.plexapp.com/ now redirects http://plex.tv/

CentOS 6 Install
Install package: wget http://downloads.plexapp.com/plex-media-server/0.9.9.16.555-50cd0c3/plexmediaserver-0.9.9.16.555-50cd0c3.x86_64.rpm yum install plexmediaserver-0.9.9.16.555-50cd0c3.x86_64.rpm
 * 1) 64bit install

wget http://downloads.plexapp.com/plex-media-server/0.9.9.16.555-50cd0c3/plexmediaserver-0.9.9.16.555-50cd0c3.i386.rpm yum install plexmediaserver-0.9.9.16.555-50cd0c3.i386.rpm
 * 1) 32bit install

Reboot server: reboot

Enable syslog logging: sed -i 's/# export PLEX_MEDIA_SERVER_USE_SYSLOG=true/export PLEX_MEDIA_SERVER_USE_SYSLOG=true/g' /etc/sysconfig/PlexMediaServer

Start service: chkconfig plexmediaserver on service plexmediaserver restart

Connect to server: http://MYSERVER:32400/web


 * Accept End User License Agreement
 * Wait for Plex Server to fully start
 * Sign In with Plex Account (optional)
 * Name Server
 * Provide announcement email
 * Create Media Library (Movies)
 * /movies/plex
 * Install (or skip) channels

--

This adds the following yum repo, which appears to be broken:

/etc/yum.repos.d/plex.repo: [PlexRepo] name=PlexRepo baseurl=http://plex.r.worldssl.net/PlexMediaServer/fedora-repo/release/$basearch/ enabled=1 gpgkey=https://plexapp.com/plex_pub_key.pub gpgcheck=1

So to update, just download the latest RPM.

--

mkdir /movies echo "prime:/data/movies     /movies                 nfs     defaults        0 0" >> /etc/fstab mount /movies
 * 1) mount movie share

--

Apache yum -y install apache php ln -s /var/www/html /www cd /www cat > index.php << "EOF" > /etc/default/plexmediaserver

Start service: chkconfig plexmediaserver on service plexmediaserver restart

Connect to server: http://MYSERVER:32400/web


 * Accept End User License Agreement
 * Wait for Plex Server to fully start
 * Sign In with Plex Account (optional)
 * Name Server
 * Provide announcement email
 * Create Media Library (Movies)
 * /movies/plex
 * Install (or skip) channels

--

This adds the following apt repo, ?which appears to be broken:?

/etc/apt/sources.list.d/plexmediaserver.list: deb http://plex.r.worldssl.net/PlexMediaServer/ubuntu-repo lucid main

So to update, just download the latest DEB.

--

Preference File: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Preferences.xml

Library: /var/lib/plexmediaserver/Library

--

mkdir /movies echo "prime:/data/movies     /movies                 nfs     defaults        0 0" >> /etc/fstab mount /movies
 * 1) mount movie share

--

Apache yum -y install apache php ln -s /var/www/html /www cd /www cat > index.php << "EOF" <?php header('Location: http://plex:32400/web/'); EOF chkconfig httpd on service httpd restart

Plex.tv Connect
WARNING: To see the "Server" options, you need to connect to the Plex server from localhost or local network.

Firewall
What network ports do I need to allow through my firewall to enable access? 

TCP 32400 (for access to the Plex Media Server) [required]

UDP 1900 (for access to the Plex DLNA Server)

TCP 32469 (for access to the Plex DLNA Server)

UDP 5353 (for Bonjour/Avahi if you are using these products for service discovery) [recommended for iOS clients]

Web Interface
How do I access the Plex media management interface? 

http://YourServerIP:32400/web

Command Line Mangement
Get sections: curl http://plex:32400/library/sections key="1"

Refresh section: curl http://plex:32400/library/sections/1/refresh

Maybe something more convoluted: curl http://127.0.0.1:32400/library/sections|grep "title="| awk -F = '{print $6" "$7" "$8}'| \ sed 's/ art//g'|sed 's/title//g'| sed 's/type//g'| awk -F \" '{print "Section=\""$6"\" ID="$2}'

References:
 * PlexNine AdvancedInfo - Plex - http://wiki.plexapp.com/index.php/PlexNine_AdvancedInfo

Refresh on startup hack
/etc/init.d/plexmediaserver


 * 1) diff -u plexmediaserver.original plexmediaserver


 * 1) patch -p0 < plexmediaserver.patch

plexmediaserver.patch: --- plexmediaserver.original   2013-12-21 09:20:54.818961489 -0700 +++ plexmediaserver    2014-01-18 16:02:28.986902515 -0700 @@ -127,9 +127,22 @@        fi }

+refresh_movies { + for i in `seq 1 10`; do +    echo "Refreshing movies ..." +   curl http://plex:32400/library/sections/1/refresh +   if [ $? -eq 0 ] ; then +     return 0 +   fi +    sleep 1 + done +} + case "$1" in       start)                start +               # refresh movies +               refresh_movies                ;;        stop) stop @@ -138,6 +151,8 @@               stop sleep 1 start +              # refresh movies +              refresh_movies ;;       status)                check_status

Download Video

 * 1) http://plexapp.com
 * 2) select video
 * 3) Click "Info" icon
 * 4) Click "View XML" link
 * 5) Get &lt;Part id="3486" key="/library/parts/3486/file.mkv"
 * 6) * Collect Title and Year for file name
 * 7) Swap file url with current url, and append X-Plex-Token
 * 8) * Example: http://76.23.10.61:32400/library/metadata/3727?X-Plex-Token=e2KtFxEqtiuUSfqpdbN8

Subtitle
save the .srt file as "[movie].eng.srt"

Script
git clone https://gist.github.com/3183688e946a2c444efc.git

See plex.py

imuxsock begins to drop messages
imuxsock begins to drop messages from pid 21238 due to rate-limiting

/etc/rsyslog.conf $SystemLogRateLimitInterval 0 $SystemLogUsePIDFromSystem on
 * 1) $SystemLogRateLimitBurst 50

Test syslog rate limiting: n=1000 i=0

while [ $i -lt $n ] do logger "This is Testmessage #$i" echo "Messages: $i" i=`expr $i + 1` done