Sign up here and you can log into the forum!

Indian Tv Channel

UMSP Plugin Depot, the place for sharing plugins & info about them. No requests, just plugins/code.

Indian Tv Channel   

Postby eskay » Thu Aug 11, 2011 12:46 pm

The plugin is based on the multiple forums http://bhejas.com/forum/index.php.
It parses this forum and generates list of channel and Tv serails based on the posting on forum. The video link posted for a specific episode will be displayed in youtube or dailymotion.
The two plugins, Dailymotion and Youtube subscription should be enabled to work. this is using the proxy of them.
So the second version is out :)
Changelog:
Code: Select all
Added suport for
"Bheja Fry
* Apni.tv
*tamiljothy
*sankave


Third version release
Code: Select all
Changelog::
* Given correct message if no video found to play.(Thanks Shunte)
* Support to play Live mms stream using MSDL app bin (visit http://forum.wdlxtv.com/viewtopic.php?f=40&t=3077 to download the app)
* Menu Live Tv appears only if MSDL apps installed
*Live stream takes 15-60 seconds to load.. if it is not loaded within that period then it means that stream is broken.
* added indian TV from idesitv and one Nepal tv (link given  by  @danepporambo)

Menu Live Tv appears only if MSDL apps installed

Guys enjoy :D ... remember one thing i am not the content provider but trying to play it on WDTV.. :mrgreen:
Last edited by eskay on Mon Sep 19, 2011 10:32 am, edited 3 times in total.
User avatar
eskay
Developer
 
Posts: 130
Joined: Mon Aug 02, 2010 12:56 pm
Location: SWITZERLAND

Re: Indian Tv Channel   

Postby mad_ady » Thu Aug 11, 2011 11:19 pm

I uploaded your code to the svn.
It seems to work just fine, just that some entries don't have videos - which I guess is normal for a forum.
User avatar
mad_ady
Developer
 
Posts: 3366
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Indian Tv Channel   

Postby eskay » Fri Aug 12, 2011 10:58 am

mad_ady wrote:I uploaded your code to the svn.
It seems to work just fine, just that some entries don't have videos - which I guess is normal for a forum.

Thanks a lot. It's true, there are some forum where there are either no feeds or feeds other than Dailymotion.
At the last moment i had to disable youtube as forum's user was banned on youtube :evil: . Once it is fixed, i will add a config option to choose default service.

if any one who have liked this plugin (any one there ;) ) can share some other sites like this which provide the tv serials content.
User avatar
eskay
Developer
 
Posts: 130
Joined: Mon Aug 02, 2010 12:56 pm
Location: SWITZERLAND

Re: Indian Tv Channel   

Postby rssothy » Fri Aug 12, 2011 4:14 pm

hi,
It's a nice plugin. I am looking for this longtime. Is that possible with this website http://tamiljothy.net/main . I tried with your plugin with modification. But no success. Can you help me to solve this.
rssothy
WDTVer
 
Posts: 25
Joined: Sun Apr 11, 2010 8:32 pm

Re: Indian Tv Channel   

Postby eskay » Sat Aug 13, 2011 3:52 am

thanks rssothy,
i think it is possible to create on as it uses the youtube as base media.
Can you pl let me know which section appeals more to you so that i can try at least one :)
User avatar
eskay
Developer
 
Posts: 130
Joined: Mon Aug 02, 2010 12:56 pm
Location: SWITZERLAND

Re: Indian Tv Channel   

Postby rssothy » Sat Aug 13, 2011 5:04 am

Thank you for the quick replay. I just modify yours and add the new web address. But when I check It gave me no list. What is the use of topmenu=y or NO. I am new to php.
pls guide me to success
Code: Select all
<?php
error_reporting(0);
include_once('/usr/share/umsp/funcs-log.php');
global $logLevel;
global $logIdent;
$logLevel = L_WARNING ;
$logIdent = 'TAMILTV';
//_logDebug("Begin");
//=======================================================================================================================
//                        Main Method
//================================================================================================================================
function _pluginMain($prmQuery) {
   $queryData = array();
   parse_str($prmQuery, $queryData);
   if ($queryData['url'] !='') {
      return _pluginCreateVideoItems($queryData);
   } else {
      $items = _pluginCreateCategoryList();
      return $items;
   }
}

//================================================================================================================================
//  Create the top menu item
//================================================================================================================================

function _pluginCreateCategoryList() {

   // Static Category list
   $categories = array(
   '12' => 'Cartoon',
   '4' => 'TV Shows Archive',
   '5' => 'Tamil New Movies Archive',
   '13' => 'Tamil Tele Dramas Archive',
   '45' => 'Live TV + Sports Archive',
   '47' => 'Vijay Tv Junior Super Stars Archive',
   '8' => 'Tamil Comedy Archive'
   
   );
   
   $images = array(
   '12' => 'http://t2.gstatic.com/images?q=tbn:ANd9GcTFPZQ3VPaitOam5Uug5jStpDZd06rS-6cjZHw0Em00rYhnFyeA',
   '4' => 'http://t0.gstatic.com/images?q=tbn:ANd9GcReGxtzbhJn7qsGJB9pFEJltaBcgJ3cVg0VZz0oZa7q7CE_F2Vk',
   '5' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcQzLEnZrwTYx7uWgiemMBYIYy9dwt7GN0-UQPFvMdgxH7idWhDW',
   '13' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcTsDYORKSNm9IwX3_B4AGd13UfMHgLxMLS8KfS_7bSOJKjj0Dm_-A',
   '45' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcSINhv1vXXIsM8qgAiXI7g0A6z2RxNTXNO0OBqjbc9shXneGwzVzA',
   '47' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcQkhr-h_WCQIOVCvUDIlpTJh6tX13aaRv6SxQR8syB5fs85WGsQ',
   '8' => 'http://t0.gstatic.com/images?q=tbn:ANd9GcTxD0lWBKIlm512XeffQG01eyUgAbg34sm8jAfO_pxbYDghn8p3Cg'

   );

   // Loop thru each category and create item list
   foreach ($categories as $url => $id)
   {
      $data = array(
      'url' => strtolower($url),
     'topmenu' => 'Y'
     );
     $dataString = http_build_query($data, 'pluginvar_','&amp;');
     $retMediaItems[] = array (
      'id' => 'umsp://plugins/tamiltv?' .$dataString,
      'dc:title' => $id,
     'upnp:album_art'=>  $images[$url],
      'upnp:class' => 'object.container',
     );
   }
   return $retMediaItems;
}

//================================================================================================================================
// Create details item for each selected category
//================================================================================================================================

function _pluginCreateVideoItems($queryData) {
   //_logDebug("URL::$url");

   switch($queryData['topmenu'])
   {
      case 'Y':
         return getListOfSerials($queryData);
      case 'YES':
         return getListOfSerials($queryData);
      case 'NO':
         return getVideoUrl($queryData['url']);
   }
}


//================================================================================================================================
// Get List of Serials for selected Channel like sony etc.
//================================================================================================================================

function getListOfSerials($queryData)
{
   if($queryData['topmenu']=='Y')
   {
      $pattern = '|<div>.*?<a href="main/.*?cat=(?P<link>.*?)"><strong>(?P<title>.*?)</strong>|mis';
      $topmenu='YES';
   }
   else
   {
      $pattern = '|href="main/.*?p=(?P<link>.*?)".*id="thread_title.*>(?P<title>.*?)</a>|mi';
      $topmenu='NO';
   }
   _logDebug("Url:::".'http://tamiljothy.net/main/?cat='.$queryData['url'] );

   $content=file_get_contents('http://tamiljothy.net/main/?cat='.$queryData['url']);
   if(preg_match_all($pattern, $content, $ulrarr))
   {
      _logDebug("Media items=". print_r($ulrarr['link'],true));
      _logDebug("Media items=". print_r($ulrarr['title'],true));
      $medialist = array_combine($ulrarr['link'], $ulrarr['title']);
      foreach ($medialist as $url => $title)
      {
         if(strpos($title,'Discussion'))
         continue;
         $data = array(
                 'url' => $url,
                 'topmenu' => $topmenu
         );

         $dataString = http_build_query($data, 'pluginvar_','&amp;');
         $retMediaItems[] = array (
                 'id' => 'umsp://plugins/tamiltv?' . $dataString,
                 'dc:title' => $title,
                 'upnp:class' => 'object.container',
         );
      }
      return $retMediaItems;
   }
}




//================================================================================================================================
// Get list of part of each episode
//================================================================================================================================

function getVideoUrl($forumid)
{
   //_logDebug("url=".$forumid);
   $content=file_get_contents('http://tamiljothy.net/main/?p='. $forumid);
   $pattern = '|Watch in(?P<service>.*?)</u>.*?Pa(?P<linkdata>.*?)font|mis';
   if(preg_match_all($pattern, $content, $ulrarr))
   {
      _logDebug("Services=". print_r($ulrarr['service'],true));
     
      $medialist = array_combine($ulrarr['service'], $ulrarr['linkdata']);
      //$defservice=getConfigData(); //todo
      foreach ($medialist as $service => $linkdata)
      {
         if(strpos($service,'D'))
         {
            $proxy="http://".$_SERVER['HTTP_HOST']."/umsp/plugins/dailymotion/dailymotion-proxy.php?v=http://dailymotion.com/video/";
            $service="Dailymotion :";
         }
         elseif (strpos($service,'Y'))
         {
            continue;
            $proxy="http://".$_SERVER['HTTP_HOST']."/umsp/plugins/youtube-subscriptions/youtube-subscriptions-proxy.php?video_id=";
            $service="Youtube :";
         }
         else
            continue;
         $pattern = '|l=(?P<url>.*?)[">]|mis';
         _logDebug("Services=". print_r($linkdata,true));
         if(preg_match_all($pattern, $linkdata, $urlarr))
         {
            $part=0;
            _logDebug("Links=". print_r($urlarr['url'],true));
            foreach ($urlarr['url'] as $url)
            {
               $retMediaItems[] = array (
                 'id' => 'umsp://plugins/tamiltv?' . $url,
                 'dc:title' => $service.'-Part '.++$part,
                 'res' => $proxy. $url,
                 'upnp:class' => 'object.item.videoitem',
                 'protocolInfo' => '*:*:*:*'
               );
            }
         }
      }
   }
   
   return $retMediaItems;

}


?>
rssothy
WDTVer
 
Posts: 25
Joined: Sun Apr 11, 2010 8:32 pm

Re: Indian Tv Channel   

Postby eskay » Sat Aug 13, 2011 6:09 am

rssothy wrote:Thank you for the quick replay. I just modify yours and add the new web address. But when I check It gave me no list. What is the use of topmenu=y or NO. I am new to php.
pls guide me to success


Topmenu was used to find which level of forum you are in.
I will look into ur code and link and let you know how to make it work
User avatar
eskay
Developer
 
Posts: 130
Joined: Mon Aug 02, 2010 12:56 pm
Location: SWITZERLAND

Re: Indian Tv Channel   

Postby eskay » Sat Aug 13, 2011 7:49 am

Here you go Tamil Tv Channel.....

Code: Select all
<?php
error_reporting(0);
include_once('/usr/share/umsp/funcs-log.php');
global $logLevel;
global $logIdent;
$logLevel = L_ALL ;
$logIdent = 'TAMILTV';
//_logDebug("Begin");
//=======================================================================================================================
//                        Main Method
//================================================================================================================================
function _pluginMain($prmQuery) {
   $queryData = array();
   parse_str($prmQuery, $queryData);
   if ($queryData['url'] !='') {
      return _pluginCreateVideoItems($queryData);
   } else {
      $items = _pluginCreateCategoryList();
      return $items;
   }
}

//================================================================================================================================
//  Create the top menu item
//================================================================================================================================

function _pluginCreateCategoryList() {

   // Static Category list
   $categories = array(
   '12' => 'Cartoon',
   '4' => 'TV Shows Archive',
   '5' => 'Tamil New Movies Archive',
   '13' => 'Tamil Tele Dramas Archive',
   '45' => 'Live TV + Sports Archive',
   '47' => 'Vijay Tv Junior Super Stars Archive',
   '8' => 'Tamil Comedy Archive'
   
   );

   // Requires to display album at change as per your requirement
//   $images = array(
//   '12' => 'http://t2.gstatic.com/images?q=tbn:ANd9GcTFPZQ3VPaitOam5Uug5jStpDZd06rS-6cjZHw0Em00rYhnFyeA',
//   '4' => 'http://t0.gstatic.com/images?q=tbn:ANd9GcReGxtzbhJn7qsGJB9pFEJltaBcgJ3cVg0VZz0oZa7q7CE_F2Vk',
//   '5' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcQzLEnZrwTYx7uWgiemMBYIYy9dwt7GN0-UQPFvMdgxH7idWhDW',
//   '13' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcTsDYORKSNm9IwX3_B4AGd13UfMHgLxMLS8KfS_7bSOJKjj0Dm_-A',
//   '45' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcSINhv1vXXIsM8qgAiXI7g0A6z2RxNTXNO0OBqjbc9shXneGwzVzA',
//   '47' => 'http://t3.gstatic.com/images?q=tbn:ANd9GcQkhr-h_WCQIOVCvUDIlpTJh6tX13aaRv6SxQR8syB5fs85WGsQ',
//   '8' => 'http://t0.gstatic.com/images?q=tbn:ANd9GcTxD0lWBKIlm512XeffQG01eyUgAbg34sm8jAfO_pxbYDghn8p3Cg'
//
//   );

   // Loop thru each category and create item list
   foreach ($categories as $url => $id)
   {
      $data = array(
      'url' => strtolower($url),
     'topmenu' => 'Y'
     );
     $dataString = http_build_query($data, 'pluginvar_','&amp;');
     $retMediaItems[] = array (
      'id' => 'umsp://plugins/tamiltv?' .$dataString,
      'dc:title' => $id,
    // 'upnp:album_art'=>  $images[$url],
      'upnp:class' => 'object.container',
     );
   }
   return $retMediaItems;
}

//================================================================================================================================
// Create details item for each selected category
//================================================================================================================================

function _pluginCreateVideoItems($queryData) {
   //_logDebug("URL::$url");

   switch($queryData['topmenu'])
   {
      case 'Y':
         return getListOfSerials($queryData);
      case 'YES':
         return getListOfSerials($queryData);
      case 'NO':
         return getVideoUrl($queryData['url']);
   }
}


//================================================================================================================================
// Get List of Serials for selected Channel like sony etc.
//================================================================================================================================

function getListOfSerials($queryData)
{
     $pattern = '|entry-title.*?p=(?P<link>.*?)".*?>(?P<title>.*?)</a>|mis';
     $topmenu='NO';
   _logDebug("Url:::".'http://tamiljothy.net/main/?cat='.$queryData['url'] );
   $content=file_get_contents('http://tamiljothy.net/main/?cat='.$queryData['url']);
   if(preg_match_all($pattern, $content, $ulrarr))
   {
      _logDebug("Media items=". print_r($ulrarr['link'],true));
      _logDebug("Media items=". print_r($ulrarr['title'],true));
      $medialist = array_combine($ulrarr['link'], $ulrarr['title']);
      foreach ($medialist as $url => $title)
      {
          $data = array(
                 'url' => $url,
                 'topmenu' => $topmenu
         );

         $dataString = http_build_query($data, 'pluginvar_','&amp;');
         $retMediaItems[] = array (
                 'id' => 'umsp://plugins/tamiltv?' . $dataString,
                 'dc:title' => $title,
                 'upnp:class' => 'object.container',
         );
      }
      return $retMediaItems;
   }
}




//================================================================================================================================
// Get list of part of each episode
//================================================================================================================================

function getVideoUrl($forumid)
{
   //_logDebug("url=".$forumid);
   $content=file_get_contents('http://tamiljothy.net/main/?p='. $forumid);
   $pattern = '|embed/(?P<link>.*?)\?rel|mis';
    $proxy="http://".$_SERVER['HTTP_HOST']."/umsp/plugins/youtube-subscriptions/youtube-subscriptions-proxy.php?video_id=";
    $part=0;
     
   if(preg_match_all($pattern, $content, $ulrarr))
   {
      _logDebug("urls=". print_r($ulrarr['link'],true));
            foreach ($ulrarr['link'] as $url)
            {
                _logDebug("url=".$url);
               $retMediaItems[] = array (
                 'id' => 'umsp://plugins/tamiltv?' . $url,
                 'dc:title' => 'Part '.++$part,
                 'res' => $proxy. $url,
                 'upnp:class' => 'object.item.videoitem',
                 'protocolInfo' => '*:*:*:*'
               );
            }
     
   }
   else
   {
         $pattern = '|youtube.com/v/(?P<link>.*?)&|mis';
         preg_match_all($pattern, $content, $ulrarr);
          foreach ($ulrarr['link'] as $url)
            {
                _logDebug("url=".$url);
               $retMediaItems[] = array (
                 'id' => 'umsp://plugins/tamiltv?' . $url,
                 'dc:title' => 'Part '.++$part,
                 'res' => $proxy. $url,
                 'upnp:class' => 'object.item.videoitem',
                 'protocolInfo' => '*:*:*:*'
               );
            }
   }
   
    _logDebug("mediaitems=". print_r($retMediaItems,true));   
   return $retMediaItems;
}


?>



let me know if working .It's a difficult site to work with as each page has content written differently. Looks like a premature website.. :evil:
And I have one question can we put all these branches, under indian tv channels... i.e. a menu item within that
@mad_ady : what do you think
User avatar
eskay
Developer
 
Posts: 130
Joined: Mon Aug 02, 2010 12:56 pm
Location: SWITZERLAND

Re: Indian Tv Channel   

Postby rssothy » Sat Aug 13, 2011 10:04 am

Thanks Eskay,
Yes that's a good idea to put all of them in one plug is good.
Thank you very much for the help.Yes It's up. Thanks a lot. Is it possible to sort by date.
rssothy
WDTVer
 
Posts: 25
Joined: Sun Apr 11, 2010 8:32 pm

Re: Indian Tv Channel   

Postby mad_ady » Sat Aug 13, 2011 11:26 am

I haven't tried the code yet (busy weekend), but I think you should think about adding the content under the existing plugin. You could add another menu level, or even merge the results from both sites under the same menu.

If you were to make a new plugin for it, I can almost bet 90% of the code would be the same as indiantv. The problem with code reuse in a new plugin is if you ever make an improvement to the original code, you'll have to make it as well to the other copies, and it's a bit more difficult to manage. This is why I think it's better suited to be merged. Also, I suspect the content is somewhat related. (Although, this is only my opinion. Other plugins share 90% of the code but remain spearated, so it's your call in the end).

The problem with forums is - if the users don't follow the same guidelines when posting new content, you have very little chance of making a good parser to catch everything. Unfortunately there is no magic way of fixing things, so you'll have to decide if it's worth the trouble.
User avatar
mad_ady
Developer
 
Posts: 3366
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Next

Return to UMSP Plugins

Who is online

Users browsing this forum: No registered users and 0 guests