Sign up here and you can log into the forum!

updated revision3 script

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

updated revision3 script   

Postby liskl » Thu Sep 16, 2010 7:10 am

posted a updated /usr/share/umsp/plugins/revision3.php with all revision3 shows added, i know not much but every little bit that makes things better is a step in the right direction

Code: Select all
<?php
# (C) 2010 Alex Meijer for Eminent Europe B.V.
#
# Revision: updated all current revision3 shows past and present - liskl
#
# This revision3 plugin is designed for Zoster's USMP server which runs (amongst others) inside the EM7075 and DTS variant.
# This code is GPL licensed. Please read it here: http://www.gnu.org/licenses/gpl.html
# In addtion to section 7 of the GPL terms, there is one additional term :
# G) You must keep this header intact when you intend to release modified copies of the program.
#
# Thank you, and enjoy this plugin.

// Testing section. You can use $in to test input/selection of feeds, urls etc.
//$in='';
//$in='feed=diggdialogg';
//$in='itemurl=http%3A%2F%2Frevision3.com%2Fhak5%2Ffeed%2FMP4-High-Definition';
//$in='itemurl=http%3A%2F%2Frevision3.com%2Fhak5%2Ffeed%2FMP4-Small';
// $in='itemurl=http%3A%2F%2Frevision3.com%2Fdiggdialogg%2Ffeed%2FMP4-High-Definition';

//$retMediaItems =_pluginMain($in);
//echo '<pre>';
//print_r ($retMediaItems);
//echo '</pre>';

function _pluginMain($prmQuery) {
#
# This function is started if user clicks on the 'Revision3' option in the menu
# It has no parameters and will run 'PluginCreateFeedlist' that returns an array with feeds.
# If run with a feed (/revision3.php?feed=animetv) it will run the function _pluginFeedResolution
# and if run with both present, it will return a list of items in the respective feed.
#
        $queryData = array();
        parse_str($prmQuery, $queryData);
//  print_r ($queryData);
//  print_r ($prmQuery);
        if ($queryData['feed'] !='') {
        $items = _pluginFeedResolution($queryData['feed']);
        return $items;
    } else {
        if ($queryData['itemurl'] !='') {
                $items = _pluginCreateVideoItems($queryData['itemurl']);
                return $items;
        } else {
                $items = _pluginCreateFeedList();
                return $items;
        } # end if
} # end function
}

function _pluginCreateFeedList($feed){
$arr = array( "appjudgment",
        "tbhs",
        "bytejacker",
        "dan30",
        "diggdialogg",
        "diggreel",
        "diggnation",
        "filmriot",
        "foodmob",
        "thegameshow",
        "geekbeattv",
        "hak5",
        "hdnation",
        "ifanboy",
        "instmsgs",
        "pennpoint",
        "rofl",
        "scamschool",
        "tekzilla",
        "tomstop5",
        "trs",
        "unboxingporn",
        "webzeroes",
        "xlr8rtv",
        "animetv",
        "coop",
        "ctrlaltchicken",
        "epicfu",
        "gigaom",
        "ifmini",
        "indigital",
        "bytes",
        "infected",
        "internetsuperstar",
        "jvsworld",
        "landlinetv",
        "lilsuperstar",
        "notmtv",
        "pixelperfect",
        "popsiren",
        "psbite",
        "rev3gazette",
        "socialbrew",
        "system",
        "thebroken",
        "webdrifter",
        "winelibraryreserve",
        "winelibrarytv"
        );
foreach ($arr as $key => $value)
        {
        $retMediaItems[] = array (
                            'id'            => 'umsp://plugins/revision3?feed=' . $value,
                            'dc:title'      => 'Revision3 - ' . ucfirst($value),
                            'res'           => 'umsp://plugins/revision3?feed=' . $value,
                        'upnp:class'    => 'object.container',
                            ); // end array building
        } // end foreach
return $retMediaItems;
} // end function

function _pluginFeedResolution($feed) {
#
        # Create the actual XML feed url with resolution selection added at the end.
        #
        $baseurl = "http://revision3.com/";
        $basereso = "/feed/MP4-Large";
        #
        # Create an array by filling it with the actual XML feed
        #
        # Create variants from $feed: ($feed holds the name, hak5 for ex.)
        #
        $baseurl = "http://revision3.com/";
        $basereso = "/feed/MP4-Large";
        $baseStr  = '/feed/MP4-Large';
        $feedurl = $baseurl . $feed . $basereso;
        $variants[] = array('desc' => 'Small',          'ext' => '/feed/MP4-Small');
        $variants[] = array('desc' => 'Large',          'ext' => '/feed/MP4-Large');
        $variants[] = array('desc' => 'HD 720p',        'ext' => '/feed/MP4-High-Definition');
        foreach ($variants as $variant) {
                $itemURL = str_replace($baseStr, $variant['ext'], $feedurl);
                $data = array(
                        'itemurl'       => $itemURL,
                );
                $dataString = http_build_query($data, 'pluginvar_');
                $retMediaItems[] = array (
                        'id'                    => 'umsp://plugins/revision3?'.$dataString.$reso,
                        'dc:title'              => $variant['desc'],
                        'res'                   => 'umsp://plugins/revision3?'.$dataString,
                        'upnp:class'    => 'object.container',
                );
        } # end foreach
        return $retMediaItems;
} # end function

function _pluginCreateVideoItems($prmQuery) {

        $reader = new XMLReader();
        $episodelistXML = file_get_contents($prmQuery);
        $reader->XML($episodelistXML);
        while ($reader->read()) {
                if ($reader->nodeType == XMLReader::ELEMENT) {
                        if ($reader->localName == 'title') {
                                $title = $reader->readString ('title');

                            } # end if
                        if ($reader->localName == 'enclosure') {
                                $location = $reader->getAttribute('url');
                                $data = array(
                                        'url'         => $location,
                                );
                                $dataString = http_build_query($data, 'pluginvar_');
                                $retMediaItems[] = array (
                                        'id'            => 'umsp://plugins/rev3-animetv?' . $dataString,
                                        'dc:title'      => $title,
                                        'res'           => $location,
                                        'upnp:class'    => 'object.item.videoitem',
                                        'protocolInfo'  => 'http-get:*:video/mp4:*',
                                );
                        } # end if
                } # end if
        } #end while
        return $retMediaItems;
} # end function
?>


anyway if you copy this revision3.php over to your usb stick and mount this one over the original like so

Option 1
Code: Select all
cd /conf/
wget http://home.liskl.com/wdtv/revision3.php.txt
mv revision3.php.txt revision3.php
mount -o bind /conf/revision3.php /usr/share/umsp/plugins/revision3.php

or

Option 2
Code: Select all
cd /tmp/media/usb/USB2/*/
wget http://home.liskl.com/wdtv/revision3.php.txt
mv revision3.php.txt revision3.php
mount -o bind /tmp/media/usb/USB2/*/revision3.php /usr/share/umsp/plugins/revision3.php


Option 3
Code: Select all
#paste php script source into which ever file option you chose
nano /tmp/media/usb/USB2/*/net.mounts
#scroll down to your xmounts if you have them and type
mount -o bind /tmp/media/usb/USB2/*/revision3.php /usr/share/umsp/plugins/revision3.php
# this will allow persistance of the script over reboots


remember that the * in the two commands above is a unique identifier for your particular usb device
liskl
Donor
 
Posts: 4
Joined: Thu Sep 02, 2010 4:49 am

Re: updated revision3 script   

Postby penone » Thu Sep 16, 2010 9:14 am

Thanks for this. Unfortunately for myself (wdtv plus owner) the revision3 hd feeds are useless as the video is 2x speed and audio is 1x. I believe that the new beta wd fw fixes this issue but I really do not want to install that as I am happy with b-rads fw.
Remember that YOU are responsible for what happens to your wdtv! any advice you read in the forum is just that - advice. You get what you pay for.
penone
Donor
 
Posts: 49
Joined: Wed Jul 07, 2010 5:02 am

Re: updated revision3 script   

Postby liskl » Fri Sep 17, 2010 3:24 am

i'm a plus owner myself and no problems with 720p revision3 streams, of course i got a 50mbit line entering the house though lol.
liskl
Donor
 
Posts: 4
Joined: Thu Sep 02, 2010 4:49 am

Re: updated revision3 script   

Postby penone » Fri Sep 17, 2010 11:39 am

liskl wrote:i'm a plus owner myself and no problems with 720p revision3 streams, of course i got a 50mbit line entering the house though lol.


Wow! 50mbit?!?!? Who is your service provider?!?!?

I always thought it was a problem with the encoding of the videos on the rev3 side. I honestly have not checked in a couple of weeks so maybe that issue was fixed but from reading their own forum the problem was the way the video was encoded and the inability of the wdtv to process it properly.
Remember that YOU are responsible for what happens to your wdtv! any advice you read in the forum is just that - advice. You get what you pay for.
penone
Donor
 
Posts: 49
Joined: Wed Jul 07, 2010 5:02 am

Re: updated revision3 script   

Postby PaulF » Fri Sep 17, 2010 2:02 pm

Instead of upgrading the rev3 php, I noticed revision3 podcasts have their own category in iTunes podcast categories. If you use iTunes, you can now export your subscriptions with chameleon_skin's web app.
User avatar
PaulF
Developer
 
Posts: 427
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: updated revision3 script   

Postby hydedrift » Wed Sep 29, 2010 6:29 pm

Is there a way to get this to stick after a power cycle. I went in thru the file manager and copy/pasted the code into the file. Saved and exited. Power cycled and the extra channels were mising. Noob to this so any help would be great.
hydedrift
Donor
 
Posts: 61
Joined: Thu Jun 24, 2010 6:50 pm

Re: updated revision3 script   

Postby b-rad.cc » Wed Sep 29, 2010 6:40 pm

i just committed this ;)

thank you liskl
PM's are for private matters only, please post public matters on the forum to help others who might have the same issue.
:mrgreen:
User avatar
b-rad.cc
WDLXTV Team
 
Posts: 3003
Joined: Sat Apr 03, 2010 9:35 am
Location: New York


Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 2 guests