Hi guys, is there anybody that could create a plugin for this italian streaming site?
Thanks in advance, Simo.
<?php
function _pluginMain($prmQuery) {
$items = filmsenzalimiti($prmQuery);
return $items;
}
function filmsenzalimiti($prmQuery) {
parse_str($prmQuery, $queryData);
$items = array();
if(isset($queryData['cat']) && $queryData['cat']!="")
filmsenzalimiti_showMoviesMenu($items, $queryData['cat']);
else if(isset($queryData['movie']) && $queryData['movie']!="")
filmsenzalimiti_watch($items, $queryData['movie'], $queryData['title']);
else {
if (file_exists ('/var/log/apache2/proxylo.txt')) unlink('/var/log/apache2/proxylo.txt');
$cats = array(
'allfilms All Films',
'animazione Animazione',
'anime Anime',
'avventura Avventura',
'azione Azione',
'cinesuccessi Cinesuccessi',
'cofanetti Cofanetti',
'commedia Commedia',
'demenziale Demenziale',
'documentario Documentario',
'drammatico Drammatico',
'fantascienza Fantascienza',
'horror Horror',
'musical Musical',
'natale Natale',
'parodia Parodia',
'poliziesco Poliziesco',
'romantico Romantico',
'sportivo Sportivo',
'thriller Thriller',
);
foreach($cats as $cat) {
$cat = preg_replace("/\t+/", ":", $cat);
$cat = explode(":", $cat);
$cat[1] = str_replace(''', '\'', $cat[1]);
$cat[1] = str_replace("\'", "\\'' ", $cat[1]);
$items[] = array(
'id' => 'umsp://plugins/filmsenzalimiti?cat='.$cat[0],
'dc:title' => $cat[1],
'upnp:class' => 'object.container',
'upnp:album_art' => ''
);
}
}
return $items;
}
function filmsenzalimiti_showMoviesMenu(&$items, $cat) {
$url = "http://www.filmsenzalimiti.it/browse-".$cat."-videos-1-date.html";
while ($url != '') {
$html = @file_get_contents($url);
$html = str_replace("\r","",$html);
$html = str_replace("\n"," ",$html);
$pattern = "/<li class=\"video\">(\s*?)<div class=\"video_i\">(\s*?)<a href=\"(.*?)\">(\s*?)<img src=\"(.*?)\"(\s*?)alt=\"(.*?)\"/";
preg_match_all($pattern, $html, $films, PREG_SET_ORDER);
foreach($films as $film) {
$film[7] = str_replace('&', 'and', $film[7]);
$film[7] = str_replace("'", " ", $film[7]);
$items[] = array(
'id' => "umsp://plugins/filmsenzalimiti?movie=".$film[3]."&title=".$film[7],
'dc:title' => $film[7],
//'upnp:album_art' => $film[5],
'upnp:class' => 'object.container',
);
}
preg_match("/<div class=\"pagination\">(.*?)<\/div>/", $html, $pages);
$nb = preg_match_all("/<a href=\"(.*?)\">(.*?)<\/a>/", $pages[1], $next);
if(isset($next[1][$nb-1]) && $next[1][$nb-1]!=""){
$url="http://www.filmsenzalimiti.it/".$next[1][$nb-1];
if (strpos($html,'<span class="disabled">prossimo »<\/span>') != 0) $url='';
}
else {$url='';}
if (strpos($html,'<span class="disabled">prossimo »</span>') != 0) $url='';
}
}
function filmsenzalimiti_watch(&$items, $id, $title) {
ini_set('user_agent', 'Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2');
$url = $id;
$html = file_get_contents($url);
preg_match("/<iframe src=\"(.*?)\" width/", $html, $stream);
if ($stream[1] != "") {
preg_match("/(.*?)oid=(.*?)&id=(.*?)&hash=(.*?)&hd=(.*)/", $stream[1], $ids);
$oid=$ids[2];
$vid=$ids[3];
$hd=$ids[5];
$tmpurl='http://vk.com/video'.$oid.'_'.$vid;
$cmd ="wget --header=\"Cookie: \$Version=1; remixchk=5; remixsid=; remixdt=; remixflash=11.1.102; \$Domain=vk.com\" -S ".$tmpurl." -O - | grep vtag";
$tmphtml = exec($cmd);
$streamurl="";
if (strpos($tmphtml, "vtag") != 0) {
$tmppattern="/nvar vars = {\"uid\":\"(.*?)\",\"vid\":\"(.*?)\",\"oid\":\"(.*?)\",\"host\":\"(.*?)\",\"vtag\":\"(.*?)\"/";
$tmphtml = str_replace("\\","",$tmphtml);
preg_match($tmppattern, $tmphtml, $tmpids);
$uid=$tmpids[1];
$vtag=$tmpids[5];
$host=$tmpids[4];
$streamurl='http://cs'.$host.'.vkontakte.ru/u'.$uid.'/video/'.$vtag.'.360.mp4';
}
else {
$cmd ="wget --header=\"Cookie: \$Version=1; remixchk=5; remixsid=; remixdt=; remixflash=11.1.102; \$Domain=vk.com\" -S ".$stream[1]." -O - | grep flashvars";
$tmphtml = exec($cmd);
if (strpos($tmphtml, "flashvars") != 0) {
$tmppattern="/flashvars=uid=(.*?)&vid=(.*?)&oid=(.*?)&host=(.*?)&vtag=(.*?)&ltag=/";
preg_match($tmppattern, $tmphtml, $tmpids);
$uid=$tmpids[1];
$vtag=$tmpids[5];
$host=$tmpids[4];
$streamurl=$host.'u'.$uid.'/video/'.$vtag.'.360.mp4';
}
else {
$items[] = array (
'id' => 'umsp://plugins/filmsenzalimiti',
'parentID' => 'umsp://plugins/filmsenzalimiti',
'dc:title' => 'This video has been removed from public access',
'upnp:class' => 'object.container',
'protocolInfo' => '*:*:*:*'
);
return;
}
}
$items[] = array(
'id' => 'SubItem01',
'parentID' => 'umsp://plugins/filmsenzalimiti',
'dc:title' => 'Watch Now - '.$title,
'upnp:class' => 'object.item.videoItem',
'res' => $streamurl,
'protocolInfo' => 'http-get:*:*:*',
);
}
else {
$items[] = array (
'id' => 'umsp://plugins/filmsenzalimiti',
'parentID' => 'umsp://plugins/filmsenzalimiti',
'dc:title' => 'Error fetching video url',
'upnp:class' => 'object.container',
);
}
}
function quickLog($msg) {
file_put_contents('/var/log/apache2/proxylo.txt',$msg.PHP_EOL.PHP_EOL,FILE_APPEND);
return 1;
}
?>
<?php
include ('info.php');
// Does this WEC version support custom hooks?
if ((defined('WECVERSION')) && (WECVERSION >= 3)) {
include_once('/usr/share/umsp/funcs-config.php');
// Insert badge if we have one
if ((isset($pluginInfo['thumb']))&&($pluginInfo['thumb']!=''))
{
$desc = '<div style="float: left; padding: 4px 10px 4px 4px;"><img src="'.$pluginInfo['thumb'].'" width="60" height="60" alt="logo"></div>'
.'<div>'.$pluginInfo['name']." v".$pluginInfo['version']." (".$pluginInfo['date'].") by "
.$pluginInfo['author'].".<br>".$pluginInfo['desc']."<br>Information: <a href='".$pluginInfo['url']."'>".$pluginInfo['url']."</a>"
.'</div>';
}
elseif ((isset($pluginInfo['art']))&&($pluginInfo['art']!=''))
{
$desc = '<div style="float: left; padding: 4px 10px 4px 4px;"><img src="'.$pluginInfo['art'].'" width="60" height="60" alt="logo"></div>'
.'<div>'.$pluginInfo['name']." v".$pluginInfo['version']." (".$pluginInfo['date'].") by "
.$pluginInfo['author'].".<br>".$pluginInfo['desc']."<br>Information: <a href='".$pluginInfo['url']."'>".$pluginInfo['url']."</a>"
.'</div>';
}
else
{
$desc = $pluginInfo['name'].' v'.$pluginInfo['version'].' ('.$pluginInfo['date'].') by '
.$pluginInfo['author'].'.<br>'.$pluginInfo['desc']."<br>Information: <a href='".$pluginInfo['url']."'>".$pluginInfo['url'].'</a>';
}
$key = strtoupper("{$pluginInfo['id']}_DESC");
$wec_options[$key] = array(
'configname' => $key,
'configdesc' => $desc,
'longdesc' => '',
'group' => $pluginInfo['name'],
'type' => WECT_DESC,
'page' => WECP_UMSP,
'displaypri' => -25,
'availval' => array(),
'availvalname' => array(),
'defaultval' => '',
'currentval' => ''
);
$wec_options[$pluginInfo['id']] = array(
'configname' => $pluginInfo['id'],
'configdesc' => 'Enable '.$pluginInfo['name'].' UMSP plugin',
'longdesc' => '',
'group' => $pluginInfo['name'],
'type' => WECT_BOOL,
'page' => WECP_UMSP,
'displaypri' => -10,
'availval' => array('off','on'),
'availvalname' => array(),
'defaultval' => '',
'currentval' => '',
'readhook' => wec_umspwrap_read,
'writehook' => wec_umspwrap_write,
'backuphook' => NULL,
'restorehook' => NULL
);
}
?>
<?php
# meta-name="filmsenzalimiti"
# meta-desc="filmsenzalimiti.it"
# meta-author="mutulaki"
# meta-date="2012-03-07"
# meta-version="0.0.1"
# meta-type="umsp"
# meta-url=""
# meta-filename="filmsenzalimiti.php"
# meta-id="filmsenzalimiti"
# meta-basefirmware="*"
# meta-thumbnail="http://www.filmsenzalimiti.it/templates/Ruby162/images/logo.gif"
# meta-rating="General"
# meta-category="Entertainment"
$pluginInfo = array (
'name' => 'filmsenzalimiti',
'desc' => 'filmsenzalimiti.it',
'author' => 'mutulaki',
'date' => '2012-03-07',
'version' => '0.0.1',
'url' => '',
'id' => 'filmsenzalimiti',
'thumb' => 'http://www.filmsenzalimiti.it/templates/Ruby162/images/logo.gif',
'art' => 'http://www.filmsenzalimiti.it/templates/Ruby162/images/logo.gif',
);
?>
<?php
include('info.php');
# _DONT_RUN_CONFIG_ gets set by external scripts that just want to get the pluginInfo array via include() without running any code. Better solution?
if ( !defined('_DONT_RUN_CONFIG_') )
{
include_once('/usr/share/umsp/funcs-config.php');
# Check for a form submit that changes the plugin status:
if ( isset($_GET['pluginStatus']) )
{
$writeResult = _writePluginStatus($pluginInfo['id'], $_GET['pluginStatus']);
}
# Read the current status of the plugin ('on'/'off') from conf
$pluginStatus = _readPluginStatus($pluginInfo['id']);
# New or unknown plugins return null. Add special handling here:
if ( $pluginStatus === null )
$pluginStatus = 'off';
# _configMainHTML generates a standard plugin dialog based on the pluginInfo array:
$retHTML = _configMainHTML($pluginInfo, $pluginStatus);
echo $retHTML;
# Add additonal HTML or code here
# _configMainHTML doesn't return end tags so add them here:
echo '</body>';
echo '</html>';
}
?>
$myMediaItems[] = array(
'id' => 'umsp://plugins/filmsenzalimiti',
'parentID' => '0',
'dc:title' => 'filmsenzalimiti',
'upnp:class' => 'object.container',
'upnp:album_art'=> '',
);
Notice: Undefined offset: 1 in /tmp/umsp-plugins/filmsenzalimiti/filmsenzalimiti.php on line 47
Notice: Undefined offset: 1 in /tmp/umsp-plugins/filmsenzalimiti/filmsenzalimiti.php on line 85
Users browsing this forum: No registered users and 1 guest