Sign up here and you can log into the forum!

www.filmsenzalimiti.it - Plugin request

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

Re: www.filmsenzalimiti.it - Plugin request   

Postby mutulaki » Fri Nov 23, 2012 12:47 am

Hi all,

How to change meta data before launching a new video? or reinitialize these meta data and play new movie?

thanks and best regards,

m
mutulaki
DLX'er
 
Posts: 134
Joined: Thu Feb 02, 2012 1:38 am

Re: www.filmsenzalimiti.it - Plugin request   

Postby mad_ady » Fri Nov 23, 2012 2:23 am

In theory DMAOSD/MediaLogic should do it transparently. But, depending on media type reported by the server they can get confused. For example, I had some video podcasts that were being played in the background and I suspect the cause was the Content-Type reported by the server.

I'm not sure, but you should check what the server returns as content type for your clips (but in order to change it you would need to build a proxy and override the content type yourself).

But so far - it's a guess, I'm not sure...
User avatar
mad_ady
Developer
 
Posts: 4561
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: www.filmsenzalimiti.it - Plugin request   

Postby hernia » Sat Nov 24, 2012 1:03 am

Please can you make this plugin working fine?

thank you
hernia
DLX'er
 
Posts: 55
Joined: Wed Nov 21, 2012 1:18 am

Re: www.filmsenzalimiti.it - Plugin request   

Postby mutulaki » Thu Nov 29, 2012 3:32 am

Hi,

What does not work in this plugin. For me all is working well?
Best regards,

M
mutulaki
DLX'er
 
Posts: 134
Joined: Thu Feb 02, 2012 1:38 am

Re: www.filmsenzalimiti.it - Plugin request   

Postby simogere » Thu Nov 29, 2012 4:11 am

mutulaki wrote:Hi,

What does not work in this plugin. For me all is working well?
Best regards,

M


It seems to be 2 problems:

1- Any movie can't be played. OSD says "Unable to play the selected file. Please refer to the user manual for a list of supported file formats."

2- with some covers

eg: All Film -> Dead Snow, Ben 10: Destroy All Aliens, Amour, Final Fantasy: The spirit Within, Goon, Secret Window, Tanguy, L'occhio del ciclone,exc

The sources of these images are:

http://upload.wikimedia.org/
http://www.pianetafilm.it/
http://images3.wikia.nocookie.net/
http://jeffreyhill.typepad.com/
exc


Simone
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

Re: www.filmsenzalimiti.it - Plugin request   

Postby mutulaki » Thu Nov 29, 2012 4:17 am

I am currently using this code, can you try it?

Code: Select all
<?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(
      '0%:Search',
      '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 = explode(":", $cat);
      $items[] = array(
         'id'              => 'umsp://plugins/filmsenzalimiti/filmsenzalimiti?cat='.$cat[0],
         'dc:title'        => $cat[1],
         'upnp:class'      => 'object.container',
         'upnp:album_art'  => ''
      );
    }
  }

  return $items;

}

function filmsenzalimiti_showMoviesMenu(&$items, $cat) {

  if (strpos($cat,"%") !== false) {
     $pp = explode ("%", $cat);
     if (($pp[0] == '0') || ($pp[0] == '-1')) {
         if ($pp[0] == '0') {
            exec("sudo chmod 666 /tmp/ir_injection && sleep 2 && sudo echo E > /tmp/ir_injection &");
            return _pluginMain("");
         }
         else { // ($pp[1] == '-1')
            $i=0;
            $t = $pp[1];

            //http://www.filmsenzalimiti.it/search.php?keywords=igor&btn=Cerca

            $postdata = http_build_query(
               array(
                  'keywords' => $t,
                  'btn' => 'Cerca'
               )
            );
            $url = "http://www.filmsenzalimiti.it/search.php?".$postdata;
         }
      }
     else {
       $url = "http://www.filmsenzalimiti.it/browse-".$pp[1]."-videos-".$pp[0]."-date.html";
       $cat = $pp[1];
     }
  }
  else $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/filmsenzalimiti?movie=".$film[3]."&amp;title=".$film[7],
         'dc:title'        => $film[7],
         'upnp:album_art'  => $film[5],
         'upnp:class'      => 'object.container',
      );
    }

    preg_match("/<div class=\"pagination\">(.*?)<\/div>/", $html, $pages);
    if (isset($pages[1])) {
      $nb = preg_match_all("/<a href=\"(.*?)\">(.*?)<\/a>/", $pages[1], $next);
    }
    else $nb = 1;

    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 &raquo;<\/span>') != 0) $url='';
      $pat = "|browse-(.*?)-videos-(.*?)-date.html|";
      preg_match($pat,$next[1][$nb-1],$nextpage);

       if (intval($nextpage[2]) % 4 == 0) {
         $items[] = array(
            'id'              => "umsp://plugins/filmsenzalimiti/filmsenzalimiti?cat=".$nextpage[2]."%".$cat,
            'dc:title'        => "Next movies",
            'upnp:album_art'  => "",
            'upnp:class'      => 'object.container',
         );
       $url='';

       }

    }
    else $url='';

    if (strpos($html,'<span class="disabled">prossimo &raquo;</span>') != 0) $url='';

   }
return $items;
}

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=\"http:\/\/vk.com\/(.*?)\" width/", $html, $stream);
  $stream[1]="http://vk.com/".$stream[1];

  if ($stream[1] != "") {
  $streamurl="";
  $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=(.*?)&amp;vid=(.*?)&amp;oid=(.*?)&amp;host=(.*?)&amp;vtag=(.*?)&amp;ltag=(.*?)&amp;vkid=(.*?)&amp;/";
    preg_match($tmppattern, $tmphtml, $tmpids);
    $uid=$tmpids[1];
    $vtag=$tmpids[5];
    $host=$tmpids[4];
    $vkid=$tmpids[7];

    if ($uid == "0") {
      $streamurl='http://'.$host.'/assets/videos/'.$vtag.$vkid.'.vk.flv';
      //http://361.gt2.vkadre.ru/assets/videos/704b844fa974-68291181.vk.flv
    }
    else {
        $streamurl=$host.'u'.$uid.'/video/'.$vtag.'.360.mp4';
        //http://cs506611.userapi.com/u162550060/video/440520daa1.360.mp4
    }
  }
  else {
        preg_match("/(.*?)oid=(.*?)&id=(.*?)&hash=(.*?)&hd=(.*)/", $stream[1], $ids);
        $oid=$ids[2];
        $vid=$ids[3];
        if (strpos($stream[1], "hd=") != 0) {
         $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);

      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 {
         $items[] = array (
           'id'           => 'umsp://plugins/filmsenzalimiti/filmsenzalimiti',
           'parentID'     => 'umsp://plugins/filmsenzalimiti/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/filmsenzalimiti',
      'dc:title'        => 'Watch Now - '.$title,
      'upnp:class'      => 'object.item.videoItem',
      'res'             => $streamurl,
      'protocolInfo'    => 'http-get:*:*:*',
    );
  }

  else {
    $items[] = array (
      'id'           => 'umsp://plugins/filmsenzalimiti/filmsenzalimiti',
      'parentID'        => 'umsp://plugins/filmsenzalimiti/filmsenzalimiti',
      'dc:title'     => 'Error fetching video url',
      'upnp:class'   => 'object.container',
    );
  }

}


function _pluginSearch($s) {
   preg_match('/and dc:title contains "(.*?)"/', $s, $t);
   $t = $t[1];
   return filmsenzalimiti_showMoviesMenu($items, "-1%".$t);
}

function quickLog($msg) {
   file_put_contents('/var/log/apache2/proxylo.txt',$msg.PHP_EOL.PHP_EOL,FILE_APPEND);
   return 1;
}

?>


Enjoy
M
mutulaki
DLX'er
 
Posts: 134
Joined: Thu Feb 02, 2012 1:38 am

Re: www.filmsenzalimiti.it - Plugin request   

Postby simogere » Thu Nov 29, 2012 7:56 am

mutulaki wrote:I am currently using this code, can you try it?


Ehm.. :roll: How? :oops:
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

Re: www.filmsenzalimiti.it - Plugin request   

Postby recliq » Thu Nov 29, 2012 9:33 am

­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: www.filmsenzalimiti.it - Plugin request   

Postby mad_ady » Thu Nov 29, 2012 9:38 am

Eh, that's overkill...

@simogere: you should replace the contents of /tmp/umsp-plugins/filmsenzalimiti/filmsenzalimiti.php with what mutulaki provided. Save the new file and try to navigate/play back. Report back if it works or not.
Changes will not be saved across reboots, so it will be only for testing purposes.
User avatar
mad_ady
Developer
 
Posts: 4561
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: www.filmsenzalimiti.it - Plugin request   

Postby simogere » Thu Nov 29, 2012 12:23 pm

Thanks mad for the tip.

I tried, but nothing changed.

Simone
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

PreviousNext

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 2 guests