Bueno pues yo dejo otro granito de arena:
Cinetube - Documentales
Cinetube - Películas Anime
Lo que no sé hacer funcionar bien son las carátulas. ¿Alguien puede revisarlo?
La forma de instalarlo es como los otros.
Añadir a /etc/umsp/media-items.php las siguientes líneas:
#------------------------------
$myMediaItems[] = array(
'id' => 'umsp://plugins/cinetube-pelis-anime',
'parentID' => '0',
'restricted' => '1',
'dc:creator' => 'myCreator',
'dc:title' => 'Cinetube - Peliculas Anime',
'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'=> '',
'duration' => 'myDur3',
'size' => 'mySize3',
'bitrate' => 'myBitr',
'protocolInfo' => '*:*:*:*',
'resolution' => 'myReso',
'colorDepth' => 'myColor',
);
#------------------------------
$myMediaItems[] = array(
'id' => 'umsp://plugins/cinetube-documentales',
'parentID' => '0',
'restricted' => '1',
'dc:creator' => 'myCreator',
'dc:title' => 'Cinetube - Documentales',
'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'=> '',
'duration' => 'myDur3',
'size' => 'mySize3',
'bitrate' => 'myBitr',
'protocolInfo' => '*:*:*:*',
'resolution' => 'myReso',
'colorDepth' => 'myColor',
);
#------------------------------
Crear el siguiente archivo dentro de /etc/umsp/plugins/cinetube-pelis-anime.php
<?php
function _pluginMain($prmQuery) {
$queryData = array();
parse_str($prmQuery, $queryData);
if ($queryData['category_url'] !='') {
$items = _pluginCreateMovieItems($queryData['category_url'],20);
return $items;
} elseif ($queryData['movie_url'] !='') {
$items = _pluginCreateVideoItems($queryData['movie_url']);
return $items;
} else {
$items = _pluginCreateCategoryList();
return $items;
}
}
function _pluginCreateCategoryList() {
$categories = array(
'Acción' => 'accion',
'Artes Marciales' => 'artes-marciales',
'Aventura' => 'aventura',
'Ciencia Ficción' => 'ciencia-ficcion',
'Comedia' => 'comedia',
'Deportes' => 'deportes',
'Drama' => 'drama',
'Fantástico' => 'fantastico',
'Infantil' => 'infantil',
'Policiaco' => 'policiaco',
'Romance' => 'romance',
'Thriller' => 'thriller'
);
foreach ($categories as $name => $id) {
$url = "http://www.cinetube.es/peliculas-anime/" . $id . "/";
$data = array(
'category_url' => $url
);
$dataString = http_build_query($data, 'pluginvar_');
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-pelis-anime?' . $dataString,
'dc:title' => html_entity_decode($name,0,"UTF-8"),
'upnp:class' => 'object.container',
);
}
return $retMediaItems;
}
function _pluginCreateMovieItems($url,$pageCount) {
for ($i = 1; $i <= $pageCount; $i++) {
$html = file_get_contents($url . $i . ".html");
preg_match_all('/<p class="white">(.*?)<\/p><\/a>/',$html,$title);
if (empty($title[1])) break;
preg_match_all('/<div class="pelicula_img"><img src="(http:\/\/caratulas.cinetube.es\/pelisa\/.*?)" alt/',$html,$poster);
preg_match_all('/<div class="peli_item textcenter"><a href="(.*)">/',$html,$link);
for ($z = 0; $z < sizeof($title[1]); $z++) {
$data = array(
'movie_url' => "http://www.cinetube.es" . $link[1][$z]
);
$dataString = http_build_query($data, 'pluginvar_');
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-pelis-anime?' . $dataString,
'dc:title' => html_entity_decode($title[1][$z],0,"UTF-8"),
'upnp:album_art'=> $poster[1][$z+20],
'upnp:class' => 'object.container',
);
}
}
return $retMediaItems;
}
function _pluginCreateVideoItems($url) {
$html = file_get_contents($url);
preg_match_all('/<div class="tit_opts"><a href="(.*megavideo.*.html?)">/',$html,$megavid);
preg_match('/<h1 class="bold">(.*?)<\/h1>/',$html,$title);
if (file_exists('/conf/config')) {
$config = file_get_contents('/conf/config');
if(preg_match('/MEGA_AUTH=\'(.+)\'/', $config, $config_result)) {
$auth = $config_result[1];
preg_match_all('/<div class="tit_opts"><a href="(.*megaupload.*.html?)"/',$html,$megaup);
}
}
for ($z = 0; $z < sizeof($megavid[1]); $z++) {
$html = file_get_contents("http://www.cinetube.es" . $megavid[1][$z]);
preg_match_all('/<li id="http:\/\/www.megavideo.com\/\?v=(.*?)">/',$html,$id);
for ($i = 0; $i < sizeof($id[1]); $i++) {
$part = (sizeof($id[1]) > 1) ? "/" . ($i+1) : "";
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-pelis-anime?' . $id[1][$i],
'dc:title' => html_entity_decode($title[1],0,"UTF-8") . " (Megavideo #" . ($z+1) . $part . ")",
'res' => "http://localhost/umsp/plugins/megavideo-proxy.php?id=" . $id[1][$i],
'upnp:class' => 'object.item.videoitem',
'protocolInfo' => '*:*:*:*'
);
}
}
for ($z = 0; $z < sizeof($megaup[1]); $z++) {
$html = file_get_contents("http://www.cinetube.es" . $megaup[1][$z]);
preg_match_all('/<a href="http:\/\/www.megaupload.com\/\?d=(.*?)" target=/',$html,$id);
$opts = array(
'http' => array(
'method' => "HEAD",
'max_redirects' => '0',
'header' => 'Cookie: user=' . $auth . "\r\n"
)
);
$context = stream_context_create($opts);
for ($i = 0; $i < sizeof($id[1]); $i++) {
$getHeaders = @file_get_contents("http://www.megaupload.com/?d=" . $id[1][$i], false, $context);
if (preg_match('/location: (.+)/',$http_response_header[3],$res)) {
$part = (sizeof($id[1]) > 1) ? "/" . ($i+1) : "";
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-pelis-anime?' . $id[1][$i],
'dc:title' => html_entity_decode($title[1],0,"UTF-8") . " (Megaupload #" . ($z+1) . $part . ")",
'res' => $res[1],
'upnp:class' => 'object.item.videoitem',
'protocolInfo' => '*:*:*:*'
);
}
}
}
return $retMediaItems;
}
?>
Crear el siguiente archivo dentro de /etc/umsp/plugins/cinetube-documentales.php
<?php
function _pluginMain($prmQuery) {
$queryData = array();
parse_str($prmQuery, $queryData);
if ($queryData['category_url'] !='') {
$items = _pluginCreateMovieItems($queryData['category_url'],20);
return $items;
} elseif ($queryData['movie_url'] !='') {
$items = _pluginCreateVideoItems($queryData['movie_url']);
return $items;
} else {
$items = _pluginCreateCategoryList();
return $items;
}
}
function _pluginCreateCategoryList() {
$categories = array(
'Arte y cine' => 'arte-y-cine',
'Biografias' => 'biografias',
'Ciencia y tecnologia' => 'ciencia-y-tecnologia',
'Deporte' => 'deporte',
'Historia' => 'historia',
'Naturaleza' => 'naturaleza',
'Otros' => 'otros',
'Politica' => 'politica',
'Serie documental' => 'serie-documental',
'Social' => 'social'
);
foreach ($categories as $name => $id) {
$url = "http://www.cinetube.es/documentales/" . $id . "/";
$data = array(
'category_url' => $url
);
$dataString = http_build_query($data, 'pluginvar_');
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-documentales?' . $dataString,
'dc:title' => html_entity_decode($name,0,"UTF-8"),
'upnp:class' => 'object.container',
);
}
return $retMediaItems;
}
function _pluginCreateMovieItems($url,$pageCount) {
for ($i = 1; $i <= $pageCount; $i++) {
$html = file_get_contents($url . $i . ".html");
preg_match_all('/<p class="white">(.*?)<\/p><\/a>/',$html,$title);
if (empty($title[1])) break;
preg_match_all('/<div class="pelicula_img"><img src="(http:\/\/caratulas.cinetube.es\/docus\/.*?)" alt/',$html,$poster);
preg_match_all('/<div class="peli_item textcenter"><a href="(.*)">/',$html,$link);
for ($z = 0; $z < sizeof($title[1]); $z++) {
$data = array(
'movie_url' => "http://www.cinetube.es" . $link[1][$z]
);
$dataString = http_build_query($data, 'pluginvar_');
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-documentales?' . $dataString,
'dc:title' => html_entity_decode($title[1][$z],0,"UTF-8"),
'upnp:album_art'=> $poster[1][$z+20],
'upnp:class' => 'object.container',
);
}
}
return $retMediaItems;
}
function _pluginCreateVideoItems($url) {
$html = file_get_contents($url);
preg_match_all('/<div class="tit_opts"><a href="(.*megavideo.*.html?)">/',$html,$megavid);
preg_match('/<h1 class="bold">(.*?)<\/h1>/',$html,$title);
if (file_exists('/conf/config')) {
$config = file_get_contents('/conf/config');
if(preg_match('/MEGA_AUTH=\'(.+)\'/', $config, $config_result)) {
$auth = $config_result[1];
preg_match_all('/<div class="tit_opts"><a href="(.*megaupload.*.html?)"/',$html,$megaup);
}
}
for ($z = 0; $z < sizeof($megavid[1]); $z++) {
$html = file_get_contents("http://www.cinetube.es" . $megavid[1][$z]);
preg_match_all('/<li id="http:\/\/www.megavideo.com\/\?v=(.*?)">/',$html,$id);
for ($i = 0; $i < sizeof($id[1]); $i++) {
$part = (sizeof($id[1]) > 1) ? "/" . ($i+1) : "";
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-documentales?' . $id[1][$i],
'dc:title' => html_entity_decode($title[1],0,"UTF-8") . " (Megavideo #" . ($z+1) . $part . ")",
'res' => "http://localhost/umsp/plugins/megavideo-proxy.php?id=" . $id[1][$i],
'upnp:class' => 'object.item.videoitem',
'protocolInfo' => '*:*:*:*'
);
}
}
for ($z = 0; $z < sizeof($megaup[1]); $z++) {
$html = file_get_contents("http://www.cinetube.es" . $megaup[1][$z]);
preg_match_all('/<a href="http:\/\/www.megaupload.com\/\?d=(.*?)" target=/',$html,$id);
$opts = array(
'http' => array(
'method' => "HEAD",
'max_redirects' => '0',
'header' => 'Cookie: user=' . $auth . "\r\n"
)
);
$context = stream_context_create($opts);
for ($i = 0; $i < sizeof($id[1]); $i++) {
$getHeaders = @file_get_contents("http://www.megaupload.com/?d=" . $id[1][$i], false, $context);
if (preg_match('/location: (.+)/',$http_response_header[3],$res)) {
$part = (sizeof($id[1]) > 1) ? "/" . ($i+1) : "";
$retMediaItems[] = array (
'id' => 'umsp://plugins/cinetube-documentales?' . $id[1][$i],
'dc:title' => html_entity_decode($title[1],0,"UTF-8") . " (Megaupload #" . ($z+1) . $part . ")",
'res' => $res[1],
'upnp:class' => 'object.item.videoitem',
'protocolInfo' => '*:*:*:*'
);
}
}
}
return $retMediaItems;
}
?>