Restricted plugins

From WikiDLXTV
Revision as of 00:59, 16 December 2010 by Mad ady (Talk | contribs) (Moved the scripts to /conf/S99user-script for efficiency. Added instructions on how to create a umsp-plugins.tgz)

Jump to: navigation, search

Description

The restricted plugins are a set of UMSP plugins that are considered unsuitable for everyone (because of their adult content) and are not available as part of the regular plugin pack. You can follow these instructions to enable these plugins for your WDTV.

Currently, the restricted plugins offer access to these sites:

  • Tube8
  • Pornhub

Dependencies

  • UMSP media server must be on
config_tool -c UMSP='ON'
  • Apache must be on
config_tool -c APACHE='ON'

Configuration

The configuration steps consist of downloading the restricted plugins and enabling them in the UMSP media server.

  • Using a text editor (or file transfer tool/webend) create (or append to) /conf/S99user-script with this content:
#!/bin/sh
#update umsp restricted plugins from SVN
logger -t $0 'Obtaining restricted svn UMSP plugins...'
eval `grep SVNLOGIN= /conf/config`
if [ $SVNLOGIN != "" ]; then
  USER=`echo $SVNLOGIN | cut -d: -f1`
  PASS=`echo $SVNLOGIN | cut -d: -f2`
else
  USER="guest"
  PASS="guest"
fi
online.delayer 30
logger -t $0 "exporting all restricted umsp plugins from svn"
svn export --trust-server-cert --non-interactive --no-auth-cache --force --username $USER --password $PASS https://svn.wdlxtv.com/svn/UMSP/restricted-plugins/ /tmp/umsp-plugins
  • Make the file executable
# chmod a+x /conf/S99user-script
  • You should now run the script and see if it works. Output should be similar to this (unless you are running other commands inside it):
# /bin/sh /conf/S99user-script 
sh: : unknown operand
A    /tmp/umsp-plugins
A    /tmp/umsp-plugins/pornhub.php
A    /tmp/umsp-plugins/tube8.php
Exported revision 71.
  • You need to add the plugins to your UMSP configuration by editing (or creating if it doesn't exist) /conf/umsp.php and adding these lines:
<?php
global $myMediaItems;

//Pornhub
$myMediaItems[] = array(   
  'id'         => 'umsp://plugins/pornhub',   #Attribute of item
  'parentID'      => '0',                     #Attribute of item
  'restricted'   => '1',                     #Attribute of item
  'dc:creator'   => 'myCreator',
  'dc:title'      => 'Pornhub',
  'dc:date'      => '2009-12-30',
  'upnp:author'   => 'myAuthor',
  'upnp:artist'   => 'myArtist',
  'upnp:album'   => 'myAlbum',
  'upnp:genre'   => 'myGenre',
  'upnp:length'   => '2:10:20',
  'desc'         => 'myDesc',
  'upnp:class'   => 'object.container',
  'upnp:album_art'=> 'http://phimviet247.com/getvideo/images/pornhub_logo_h50.png',
  'duration'      => 'myDur3',            #Attribute of res
  'size'         => 'mySize3',            #Attribute of res in bytes
  'bitrate'      => 'myBitr',            #Attribute of res
  'protocolInfo'   => '*:*:*:*',      #Attribute of res
  'resolution'   => 'myReso',            #Attribute of res
  'colorDepth'   => 'myColor',            #Attribute of res
);
                                                           
//Tube8
$myMediaItems[] = array(   
  'id'         => 'umsp://plugins/tube8',   #Attribute of item
  'parentID'      => '0',                     #Attribute of item
  'restricted'   => '1',                     #Attribute of item
  'dc:creator'   => 'myCreator',
  'dc:title'      => 'Tube8',
  'dc:date'      => '2009-12-30',
  'upnp:author'   => 'myAuthor',
  'upnp:artist'   => 'myArtist',
  'upnp:album'   => 'myAlbum',
  'upnp:genre'   => 'myGenre',
  'upnp:length'   => '2:10:20',
  'desc'         => 'myDesc',
  'upnp:class'   => 'object.container',
  'upnp:album_art'=> 'http://fsb.zedge.net/content/5/2/8/2/1-3446061-5282-t.jpg',
  'duration'      => 'myDur3',            #Attribute of res
  'size'         => 'mySize3',            #Attribute of res in bytes
  'bitrate'      => 'myBitr',            #Attribute of res
  'protocolInfo'   => '*:*:*:*',      #Attribute of res
  'resolution'   => 'myReso',            #Attribute of res
  'colorDepth'   => 'myColor',            #Attribute of res
);
                                                           
?>
  • After saving /conf/umsp.php you should see the new entries when navigating in Videos -> Media Servers -> UMSP
  • OPTIONAL: There is an alternate way that avoids downloading the plugins on startup, so you can skip the first 3 steps. You will need to download the plugins once and add the files (*.php) to a tgz archive in /conf/umsp-plugins.tgz. You can achive this by running these commands (assuming you have downloaded the relevant php files from the SVN in /tmp/umsp-plugins) from your wdtv:
# cd /tmp/umsp-plugins
# tar zcvf /conf/umsp-plugins.tgz tube8.php pornhub.php

Troubleshooting

  • If you are not getting the correct output after running /conf/update-umsp-restricted.sh make sure the script is correct and the lines don't overflow. Also, check for extra spaces at the end of rows and missing spaces before/after [] (bash is strict regarding whitespace close to square brackets)
  • If you can download the plugins, but they don't show up in UMSP, make sure you have correctly edited /conf/umsp.php. You can check for syntax errors with
# php5-cgi -l /conf/umsp.php
No syntax errors detected in /conf/umsp.php

Developer/Changelog

The plugins were developed by rezmus.