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 » Thu Nov 29, 2012 2:00 pm

What does not work? Can you explain?

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 2:09 pm

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
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

Re: www.filmsenzalimiti.it - Plugin request   

Postby mutulaki » Fri Nov 30, 2012 1:13 am

Can you give me explicitely which film does not work?
I will check it.

best regards,

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

Re: www.filmsenzalimiti.it - Plugin request   

Postby simogere » Fri Nov 30, 2012 1:20 am

mutulaki wrote:Can you give me explicitely which film does not work?
I will check it.

best regards,

M


All them. You have a PM.
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

Re: www.filmsenzalimiti.it - Plugin request   

Postby mutulaki » Fri Nov 30, 2012 5:25 am

Hi mad_ady,

can you please update this plugin to svn?

the videos can be now watched - thanks to the help of simogere - but there is still a problem with thumbnails that sometimes are not displayed.

simogere will ask you directly why these thumbs are not displayed even if they can be watched when downloaded on wdtv.


Code: Select all
<?php
// Plugin to watch films on www.filmsenzalimiti.it
// (C) 2012 mutulaki
// 30.11.2012

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'], $queryData['thumb']);
  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]."&amp;thumb=".urlencode($film[5]),
         '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, $thumb) {

  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.'/videos/'.$vtag.'.360.mp4';
        //http://cs506611.userapi.com/u162550060/videos/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.'/videos/'.$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;
      }

    }
quicklog('$title= '.$title);
quicklog('$url= '.$streamurl);
quicklog('$thumb= '.urldecode($thumb));
    $items[] = array(
      'id'              => 'SubItem01',
      'parentID'        => 'umsp://plugins/filmsenzalimiti/filmsenzalimiti',
      'dc:title'        => 'Watch Now - '.$title,
      'upnp:class'      => 'object.item.videoItem',
     'upnp:album_art'  => urldecode($thumb),
      '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;
}

?>


Many thanks for all

M
Last edited by mutulaki on Fri Nov 30, 2012 5:44 am, edited 1 time in total.
mutulaki
DLX'er
 
Posts: 134
Joined: Thu Feb 02, 2012 1:38 am

Re: www.filmsenzalimiti.it - Plugin request   

Postby simogere » Fri Nov 30, 2012 5:37 am

Come on mutulaki, thanks to you! :D

Here some examples of the images path not shown

Code: Select all
http://upload.wikimedia.org/wikipedia/en/thumb/7/70/Secret_Window_movie.jpg/220px-Secret_Window_movie.jpg

http://upload.wikimedia.org/wikipedia/en/thumb/0/0b/Goonfinalposter.jpg/220px-Goonfinalposter.jpg

http://upload.wikimedia.org/wikipedia/en/thumb/9/95/Amour-poster-french.jpg/220px-Amour-poster-french.jpg

http://upload.wikimedia.org/wikipedia/en/thumb/3/34/Final_Fantasy_The_Spirits_Within_(2011_film)_poster.jpg/220px-Final_Fantasy_The_Spirits_Within_(2011_film)_poster.jpg

http://jeffreyhill.typepad.com/.a/6a00d8341d417153ef011570294814970b-pi


It seem to be two different kind of problems:
- path with more than one ".jpg"
- path without ".jpg"

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

Re: www.filmsenzalimiti.it - Plugin request   

Postby hernia » Fri Nov 30, 2012 9:59 am

mutulaki wrote:Hi mad_ady,

can you please update this plugin to svn?

the videos can be now watched - thanks to the help of simogere - but there is still a problem with thumbnails that sometimes are not displayed.

simogere will ask you directly why these thumbs are not displayed even if they can be watched when downloaded on wdtv.


Code: Select all
<?php
// Plugin to watch films on www.filmsenzalimiti.it
// (C) 2012 mutulaki
// 30.11.2012

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'], $queryData['thumb']);
  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]."&amp;thumb=".urlencode($film[5]),
         '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, $thumb) {

  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.'/videos/'.$vtag.'.360.mp4';
        //http://cs506611.userapi.com/u162550060/videos/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.'/videos/'.$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;
      }

    }
quicklog('$title= '.$title);
quicklog('$url= '.$streamurl);
quicklog('$thumb= '.urldecode($thumb));
    $items[] = array(
      'id'              => 'SubItem01',
      'parentID'        => 'umsp://plugins/filmsenzalimiti/filmsenzalimiti',
      'dc:title'        => 'Watch Now - '.$title,
      'upnp:class'      => 'object.item.videoItem',
     'upnp:album_art'  => urldecode($thumb),
      '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;
}

?>


Many thanks for all

M


THAAAAAANK YOU !!!! NOW Working fine !!!! :)
hernia
DLX'er
 
Posts: 55
Joined: Wed Nov 21, 2012 1:18 am

Re: www.filmsenzalimiti.it - Plugin request   

Postby mad_ady » Sun Dec 02, 2012 11:35 am

Uploaded to svn.

Regarding the missing thumbnails: I'm not sure. Maybe too many requests for images are made to one server and it times out/returns a HTTP 500 error message when asked for more. Or maybe DMAOSD is lazy and fails to ask for some.

I've seen something similar with other plugins - especially when there were many items that needed to be loaded.
A clearer picture can be obtained only with a packet capture...
User avatar
mad_ady
Developer
 
Posts: 4522
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: www.filmsenzalimiti.it - Plugin request   

Postby simogere » Mon Dec 17, 2012 12:18 am

Any new patch?
User avatar
simogere
Donor
 
Posts: 153
Joined: Tue May 11, 2010 9:50 pm

Re: www.filmsenzalimiti.it - Plugin request   

Postby hernia » Wed Jan 02, 2013 5:30 am

if the film is composed of two files, displays only the first, like this:

http://www.filmsenzalimiti.it/film/colpi-di-fulmine-video_4d1577343.html

can you fix it?

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

PreviousNext

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 2 guests

cron