<?php session_start();?>
<?php include('php_gene1.php'); ?>
<?php include('../_cfg/config.php');?>
<?php include('php_session.php');?>
<?php $tipo=$_POST['tipo']; ?>
<?php $lang=$_POST['lang']; ?>
<?php $guia2=$_POST['guia']; ?>
<?php // $_SESSION['guias']=''; ?>
<?php //$cate0=$_POST['cate0']; ?>

<?php
function Xcateg1des($lang,$cat1des)
{
 	include('../_cfg/config.php');
		$cat1_sql='select distinct jwtv_categ1,jwtv_categ1d, jwtv_lang from jwtv0 where jwtv_categ1d!="" and jwtv_categ1d is not null ';
		$cat1_sql.='and jwtv_categ1="'.$cat1des.'" ';
		$cat1_sql.='and jwtv_lang="'.$lang.'" ';
		$cat1_res=msql_query($cat1_sql,$link_vcrx);
// 	echo '<br>'.$cat1_sql;
// 	echo '<br>'.msql_error();
		$cat1des='';
		if(msql_num_rows($cat1_res)!=0){$cat1des=msql_result($cat1_res,0,'jwtv_categ1d');}
		return $cat1des;
}
?>

<?php
function getlang()
{
 	include('../_cfg/config.php');
	$jworg='https://mediator.jw.org/v1/languages/S/web';
	$jworg='https://mediator.jw.org/v1/languages/_/web';
	$page = file_get_contents($jworg);
	$conta=0;
	$lenguage=explode(',{',$page);

			$xtag=substr($page,$xkey);
			$xtag=substr($xtag,strpos($xtag,'"name":')+8);
			$xtag=substr($xtag,0,strpos($xtag,'description')-3);

	
	for($conta0=0; $conta0<=count($lenguage); $conta0++)
	{
			$xkey=
			$codigo=$lenguage[$conta0];
			$codigo=substr($codigo,0,strpos($codigo,'"locale"')-2);
			$codigo=substr($codigo,strrpos($codigo,'"')+1);
			$descri=$lenguage[$conta0];
			$descri=substr($descri,0,strpos($descri,'"isLangPair"')-2);
			$descri=substr($descri,strrpos($descri,'"')+1);
			$jwtv_sql='insert into lang0(lang_codigo) value("'.$codigo.'")';
			$jwtv_res=msql_query($jwtv_sql,$link_vcrx);	
		
			$jwtv_sql='update lang0 set ';
			$jwtv_sql.='lang_descri="'.$descri.'" ';
			$jwtv_sql.='where lang_codigo="'.$codigo.'"';
			$jwtv_res=msql_query($jwtv_sql,$link_vcrx);	
		
			$jwtv_sql='delete from lang0 where lang_descri ="" or lang_descri is null';
			$jwtv_res=msql_query($jwtv_sql,$link_vcrx);	
	}
}
?>

<?php
function getjwtv_0($lang) 
{
	$jworg='https://mediator.jw.org/v1/categories/'.$lang.'/';
	$jworg1=$jworg.'VideoOnDemand?detailed=1';
	$page = file_get_contents($jworg1);
	$array = (json_decode($page,true));	

	$object = (json_decode($page));	
	$categ=$object->{'category'};
	
	$object2=json_decode(var_dump($categ));
 	$subcateg=$object2->{'subcategories'};
	
	$object3=json_decode(var_dump($subcateg));
//  	echo $object2->{'key'};
	
// 	echo $object3;
	
	
	
// 	echo $obj->{'used'};
//	
	
	
// 	echo '******************';
 
// 	$someArray =$array;
//   foreach ($someArray as $key => $value)
// 	{
// 		$array2 = (json_decode($value["category"] ,true));	
// 		echo $array2;
// 		$someArray2 =$array2;
// 		foreach ($someArray2 as $key => $value)
// 		{
// 			echo '<br>';
// 			echo '<br>*/*/*/*/*/';
// 			echo '<br>';
// 			echo $value["subcategories"] . "<br>";
// 	//     echo $value["category"] . ", " . $value["gender"] . "<br>";
// 		}
//   }	
	
// 	echo $page;
// 	echo $obj[0];
	
// 	echo $obj[0];
	
// 	echo $obj->{"category"};
// 	echo '<br>';
// 	echo $obj->{"subcategories"};
	
}

?>


<?php
function getjwtv0($tipo,$lang,$guia2)
{
	$jworg='https://mediator.jw.org/v1/categories/'.$lang.'/';
	$jworg1=$jworg.'VideoOnDemand?detailed=1';
	$page = file_get_contents($jworg1);
	
	$categoria=array();
	$conta=0;
	$campo=explode('"media"',$page);
	for($conta0=0; $conta0<=count($campo); $conta0++)
	{
	// 	echo '<br>'.$conta0.'==>'.$campo[$conta0];
		$categ=explode(",",$campo[$conta0]);
		for($conta1=0; $conta1<=count($categ); $conta1++)
		{
	// 		echo '<br>'.$conta0.'==>'.$categ[$conta1];

			$tag='key":';
			if(mb_stristr($categ[$conta1],$tag))
			{
				$xtag=substr($categ[$conta1],strpos($categ[$conta1],$tag)+strlen($tag)+1);
				$categoria[$conta0][0]=substr($xtag,0,strrpos($xtag,'"'));
			}

			$tag='name":';
			if(mb_stristr($categ[$conta1],$tag))
			{
				$xtag=substr($categ[$conta1],strpos($categ[$conta1],$tag)+strlen($tag)+1);
				$categoria[$conta0][1]=substr($xtag,0,strrpos($xtag,'"'));
			}

			$tag='_rph';
			if(mb_stristr($categ[$conta1],$tag))
			{
				$xtag=substr($categ[$conta1],strpos($categ[$conta1],'https://'));
				$categoria[$conta0][2]=substr($xtag,0,strrpos($xtag,'"'));
// 				echo '<br>'.$categoria[$conta0][2];
			}

	// 		$tag='_wss';
	// 		if(mb_stristr($campo[$conta1],$tag))
	// 		{
	// 			if(mb_stristr($campo[$conta1],'sm":'))
	// 			{
	// 			$xtag=substr($campo[$conta1],strpos($campo[$conta1],'https://'));
	// 			$categoria[$conta0][3]=substr($xtag,0,strrpos($xtag,'"'));
	// 			}
	// 		}
		}	
	}
	
// 		$conta0++;
// 	$categoria[$conta1][0]='Audio';
// 	$categoria[$conta1][1]='Audio';
// 	$categoria[$conta1][2]='';
	
// 	for($conta1=0; $conta1<=count($categoria); $conta1++)
// 	{
// 		echo '<br>';
// 		echo $categoria[$conta1][0];
// 		echo '<br>';
// 		echo $categoria[$conta1][1];
// 		echo '<br>';
// 		echo $categoria[$conta1][2];
// 	}
	
	for($conta1=0; $conta1<=count($categoria); $conta1++)
	{getjwtv1($categoria[$conta1][0],$categoria[$conta1][1],$lang,$guia2,$categoria[$conta1][2],($conta1)+1);}
echo '<br>**** '.$_SESSION['guias'].'-'.$guia2.' ***';
	{getjwtv1('Audio','Audio',$lang,$guia2,'',21);}
	
	
}
?>

<?php
function getjwtv11($categ0,$categ0d,$lang,$guia2,$categ0img,$categ0n)
{
 	include('../_cfg/config.php');

	$fecha1 = date('Y-m-j');
	
// 	$fecha7 = strtotime ('-7 days',strtotime($fecha1));
	$fecha7 = strtotime ('-3650 days',strtotime($fecha1));
	$fecha7 = date ( 'Y-m-j' , $fecha7 );

// 	$fecha9 = strtotime ('-7 days',strtotime($fecha1));
	$fecha9 = strtotime ('-3650 days',strtotime($fecha1));
	$fecha9 = date ( 'Y-m-j' , $fecha9 );
	
	
	$jworg='https://mediator.jw.org/v1/categories/'.$lang.'/';
	$jworg1=$jworg.$categ0.'?detailed=1';
	$page = file_get_contents($jworg1);

if(1==1)
{	
	$json1=json_decode($page,true,512,JSON_BIGINT_AS_STRING);
// 	$json1=json_decode($page,false,512,JSON_BIGINT_AS_STRING);
	echo $json1->category;
	foreach ($json1 as $key1=>$val1)
	{
		echo '<br>1'.str_repeat('*',1);
		echo $key1.'==>'.$val1;
		foreach($val1 as $key2=>$val2)
		{
			echo '<br>2'.str_repeat('*',2);echo $key2.'==>'.$val2;
			if(gettype($val2)=="array")
			{
				foreach($val2 as $key3=>$val3)
				{
					echo '<br>3'.str_repeat('*',3);echo $key3.'==>'.$val3;
					// Aqui los videos
					if(gettype($val3)=="array")
					{
						foreach($val3 as $key4=>$val4)
						{
							echo '<br>4'.str_repeat('*',4);echo $key4.'==>'.$val4;
							if(gettype($val4)=="array")
							{
								foreach($val4 as $key5=>$val5)
								{
									echo '<br>5'.str_repeat('*',5);echo $key5.'==>'.$val5;
									if(gettype($val5)=="array")
									{
										foreach($val5 as $key6=>$val6)
										{
											// Aqui los guid
											echo '<br>6'.str_repeat('*',6);echo $key6.'==>'.$val6;
											if(gettype($val6)=="array")
											{
												foreach($val6 as $key7=>$val7)
												{
													echo '<br>7'.str_repeat('*',7);echo $key7.'==>'.$val7;
													if(gettype($val7)=="array")
													{	
														foreach($val7 as $key8=>$val8)
														{
															//a qui los archivos mp4
															echo '<br>8'.str_repeat('*',8);echo $key8.'==>'.$val8;
															if(gettype($val8)=="array")
															{
																foreach($val8 as $key9=>$val9)
																{
																	echo '<br>9'.str_repeat('*',9);echo $key9.'==>'.$val9;
																}	
															}
														}
													}
												}
											}
										}	
									}
								}	
							}
						}
					}
				}
			}
		}
		echo '<br>';
		echo '***************************************';
		echo '<br>';
	}	
	echo '*** FIN ***';
	return ;
	
}	

}
?>

<?php
function getjwtv1($categ0,$categ0d,$lang,$guia2,$categ0img,$categ0n)
{
 	include('../_cfg/config.php');

	$fecha1 = date('Y-m-j');
	
// 	$fecha7 = strtotime ('-7 days',strtotime($fecha1));
	$fecha7 = strtotime ('-3650 days',strtotime($fecha1));
	$fecha7 = date ( 'Y-m-j' , $fecha7 );

// 	$fecha9 = strtotime ('-7 days',strtotime($fecha1));
	$fecha9 = strtotime ('-3650 days',strtotime($fecha1));
	$fecha9 = date ( 'Y-m-j' , $fecha9 );
	
	
	$jworg='https://mediator.jw.org/v1/categories/'.$lang.'/';
	$jworg1=$jworg.$categ0.'?detailed=1';
	$page = file_get_contents($jworg1);

if($_SESSION['guias']=='S')
{
	if ($guia2!='')
	{
		if(mb_stristr($page,$guia2))
		{
			$page=substr($page,0,strpos($page,$guia2));
			$guia2='';
		}
		else{return;}
	} ;
	echo '<br>'.$guia2.'<br>'; 
}
		
	$page1=substr($page,0,strpos($page,'"subcategories":'));
	$page2=substr($page,  strpos($page,'"subcategories":'));
	$page2=substr($page2,strpos($page2,'"guid":'));

	$conta=0;
	while (strlen($page2)>0)
	{
		$conta++;
		$poskey=strrpos($page2,'"guid":');
		$page3=substr($page2,$poskey);

			$titulo='';
			$filempg='';
			$filempgmp3='';
			$filempg240='';
			$filempg360='';
			$filempg480='';
			$filempg720='';
			$filempg1080='';
		
			$filempgmp3s='';
			$filempg240s='';
			$filempg360s='';
			$filempg480s='';
			$filempg720s='';
			$filempg1080s='';
		
			$filevtt='';
			$fileimg='';
			$fileimg1='';
			$fileimg2='';
			$subtit='';
		
			$segundos=0;
		
// 		$campo=explode('","',$page3);
		$campo=explode(',"',$page3);
		for($conta3=0; $conta3<=count($campo); $conta3++)
		{
			if(1==2)
			{echo '<br>'.$conta3.'==>'.$campo[$conta3];}

			$tag='guid":';
			if(mb_stristr($campo[$conta3],$tag))
			{
				$xtag=substr($campo[$conta3],strpos($campo[$conta3],':"')+2);
				$xtag=substr($xtag,0,strrpos($xtag,'"'));
				$guia=$xtag;
			}

			$tag='title":';
			if(mb_stristr($campo[$conta3],$tag))
			{
			  $xtag=substr($campo[$conta3],strpos($campo[$conta3],':"')+2);
				if($categ1=='KingdomMelodies')
				{
					$xtag=str_replace('-','',$xtag);
					$xtag=str_replace('"','',$xtag);
				}
				$titulo=$xtag;
			}
			
			$tag='primaryCategory":';
			if(mb_stristr($campo[$conta3],$tag))
			{
			  $xtag=substr($campo[$conta3],strpos($campo[$conta3],':"')+2);
				$xtag=substr($xtag,0,strrpos($xtag,'"'));
				$categ1=$xtag;
			}

			$tag='progressiveDownloadURL":';
			if(mb_stristr($campo[$conta3],$tag))
			{
			  $xtag=substr($campo[$conta3],strpos($campo[$conta3],'https://'));
				$xtag=substr($xtag,0,strpos($xtag,'"'));
				$filempg=$xtag;
				if(!mb_stristr($filempg,'s-Sub'))
				{
				if(mb_stristr($filempg,'1080P')){$filempg1080=$filempg;}
				if(mb_stristr($filempg,'720P')){$filempg720=$filempg;}
				if(mb_stristr($filempg,'480P')){$filempg480=$filempg;}
				if(mb_stristr($filempg,'360P')){$filempg360=$filempg;}
				if(mb_stristr($filempg,'240P')){$filempg240=$filempg;}
				if(mb_stristr($filempg,'.mp3')){$filempgmp3=$filempg;}
				}
				if(mb_stristr($filempg,'s-Sub'))
				{
				if(mb_stristr($filempg,'1080P')){$filempg1080s=$filempg;}
				if(mb_stristr($filempg,'720P')){$filempg720s=$filempg;}
				if(mb_stristr($filempg,'480P')){$filempg480s=$filempg;}
				if(mb_stristr($filempg,'360P')){$filempg360s=$filempg;}
				if(mb_stristr($filempg,'240P')){$filempg240s=$filempg;}
				if(mb_stristr($filempg,'.mp3')){$filempgmp3s=$filempg;}
				}
			}

			$tag='subtitled":';
			if(mb_stristr($campo[$conta3],$tag))
			{
// 				$xtag=substr($campo[$conta3],strpos($campo[$conta3],$tag)+strlen($tag)+0);
// 				$subtit=substr($xtag,0,4);
			}

			$tag='subtitles":';
			if(mb_stristr($campo[$conta3],$tag))
			{
			  $xtag=substr($campo[$conta3],strpos($campo[$conta3],'https://'));
				$xtag=substr($xtag,0,strpos($xtag,'"'));
// 				$xtag=substr($campo[$conta3],strpos($campo[$conta3],':"')+2);
				$filevtt=$xtag;
			}

			
			$tag='_rph';
			if(mb_stristr($campo[$conta3],$tag))
			{
				$xtag=substr($campo[$conta3],strpos($campo[$conta3],'https://'));
				$fileimg=substr($xtag,0,strrpos($xtag,'"'));
			}

			$tag='_wss';
			if(mb_stristr($campo[$conta3],$tag))
			{
				if(mb_stristr($campo[$conta3],'sm":'))
				{
				$xtag=substr($campo[$conta3],strpos($campo[$conta3],'https://'));
				$fileimg1=substr($xtag,0,strrpos($xtag,'"'));
				}
			}

			$tag='_sqr';
			if(mb_stristr($campo[$conta3],$tag))
			{
				if(mb_stristr($campo[$conta3],'sm":'))
				{
				$xtag=substr($campo[$conta3],strpos($campo[$conta3],'https://'));
				$fileimg2=substr($xtag,0,strrpos($xtag,'"'));
				}
			}
			
			$tag='_univ_';
			if(mb_stristr($campo[$conta3],$tag))
			{
				if(mb_stristr($campo[$conta3],'md":'))
				{
				$xtag=substr($campo[$conta3],strpos($campo[$conta3],'https://'));
				$fileimg3=substr($xtag,0,strrpos($xtag,'"'));
				}
			}

			$tag='firstPublished":';
			if(mb_stristr($campo[$conta3],$tag))
			{$publicado=substr($campo[$conta3],strpos($campo[$conta3],$tag)+strlen($tag)+1,10);}

			$tag='modifiedDatetime":';
			if(mb_stristr($campo[$conta3],$tag))
			{$actualizado=substr($campo[$conta3],strpos($campo[$conta3],$tag)+strlen($tag)+1,10);}

// 			$tag='durationFormattedHHMM":';
			$tag='duration":';
			if(mb_stristr($campo[$conta3],$tag))
			{$segundos=substr($campo[$conta3],strpos($campo[$conta3],$tag)+strlen($tag)+0,5);}
		}
		
		$page2=substr($page2,0,$poskey);
		
		$xtag='';
		$xkey='"key":"'.$categ1.'"';
		$xkey=strpos($page,$xkey);
		if ($xkey==0) 
		{
			if(mb_stristr($categ1,'ChildrenSongs'))
			{
// 				$xkey='"key":"'.'ChildrensSongs'.'"';
// 				$xkey=strpos($page,$xkey);
			}	
		}

		if ($xkey>0) 
		{
			$xtag=substr($page,$xkey);
			$xtag=substr($xtag,strpos($xtag,'"name":')+8);
			$xtag=substr($xtag,0,strpos($xtag,'description')-3);
		}
	// 		else
	// 		{echo '<br><br>'.$categ1;}
		$categ1d=$xtag;
		
		$titulo=str_replace(chr(92),'',$titulo);
		$titulo=str_replace(chr(92),'',$titulo);
 		$titulo=str_replace('"',"-",$titulo);
 		$titulo=str_replace('"',"-",$titulo);
		$categ0=str_replace('VOD','',$categ0);
		$categ1=str_replace('VOD','',$categ1);

// 		if ($guia=='5536534d7f0bc1fc2706ddd9'){die();}
				if(mb_stristr($guia,'5631009479892656f9a3f769'))
				{
// 					echo '<br>';
// 					echo '<br>'.$campo[$conta3];
// 					echo '<br>';
// 					echo '<br>'.$page2;
// 					echo '<br>';
// 					die ('*** FIN');
				}

		if(1==2)
		{
			echo '<br>';
			echo '--->'.$titulo;
			echo '<br>'.$categ0;
			echo '--->'.$categ0d;
			echo '<br>'.$categ1;
			echo '--->'.$categ1d;
			echo '<br>'.$publicado;
			echo '--->'.$actualizado;
			echo '<br>'.$filempg;
			echo '<br>'.$fileimg;
			echo '<br>'.$fileimg1;
			echo '<br>'.$fileimg2;
			echo '<br>*'.$subtit;
			echo '<br>'.$filevtt;
			echo '<br>';
			echo '<img src="'.$fileimg.'" height="80" width="80">';
			echo '<img src="'.$fileimg2.'" height="76" width="136">';
		}

		
		if($guia==$guia2){$_SESSION['guias']='G';}

		
// 		if ($titulo!="" and $_SESSION['guias']=='G');	
		if ($titulo!="" and $_SESSION['guias']=='G');	
			{

				if($guia!="" )
				{
				$bold='';
				if($actualizado>=$fecha7){$bold='font-weight:bold;';}	
				echo '<br>';
				echo '<span id="'.$guia.'" style="font-family:courier;font-size:12px; '.$bold.'">';
				echo 'GUIA:'.$guia;
				echo ' /'.$lang.' /'.$categ0.' /'.$categ1;
				echo ' /'.$titulo;
// 				echo ' <br>'.str_repeat('_',4).$filempg;
// 				echo ' <br>'.str_repeat('_',4).$filevtt;
// 				echo ' <br>'.str_repeat('_',4).$fileimg;
// 				echo ' <br>'.str_repeat('_',4).$fileimg1;
// 				echo ' <br>'.str_repeat('_',4).$fileimg2;
				echo '</span>';
				}

// 		if(mb_stristr($titulo,'JW Broad') and mb_stristr($titulo,'2017'))
// 		{echo '===>'.$titulo.':::'.$actualizado.':::::'.$fecha9.'::::::'.$fecha7;}


				if($actualizado>=$fecha9)
				{	
					{		
					$codigo=$guia.$lang.$categ0.$categ1;
					$jwtv_sql='insert into jwtv0(jwtv_codigo) value("'.$codigo.'")';
					$jwtv_res=msql_query($jwtv_sql,$link_vcrx);	
// 					if(msql_errno()>0){echo '<br>****'.msql_error();}

					if($filempgmp3==''){$filempgmp3=$filempg;}
					if($filempg240==''){$filempg240=$filempg;}
					if($filempg360==''){$filempg360=$filempg;}
					if($filempg480==''){$filempg480=$filempg;}
					if($filempg720==''){$filempg720=$filempg;}
					if($filempg1080==''){$filempg1080=$filempg;}

					if($filempgmp3s==''){$filempgmp3s=$filempgmp3;}
					if($filempg240s==''){$filempg240s=$filempg240;}
					if($filempg360s==''){$filempg360s=$filempg360;}
					if($filempg480s==''){$filempg480s=$filempg480;}
					if($filempg720s==''){$filempg720s=$filempg720;}
					if($filempg1080s==''){$filempg1080s=$filempg1080;}

					if($fileimg==''){$fileimg=$fileimg1;}
					if($fileimg==''){$fileimg=$fileimg2;}
					if($fileimg==''){$fileimg=$fileimg3;}
					}

					{
					$jwtv_sql='update jwtv0 set ';
					$jwtv_sql.='jwtv_idate=now(),';
					$jwtv_sql.='jwtv_lang="'.$lang.'",';
					$jwtv_sql.='jwtv_guia="'.$guia.'",';
					$jwtv_sql.='jwtv_categ0="'.$categ0.'",';
					$jwtv_sql.='jwtv_categ0d="'.$categ0d.'",';
					$jwtv_sql.='jwtv_categ0n="'.$categ0n.'",';
					$jwtv_sql.='jwtv_categ1="'.$categ1.'",';
					$jwtv_sql.='jwtv_categ1d="'.$categ1d.'",';
		// 			$jwtv_sql.='jwtv_categ1n="'.$categ1n.'",';
					$jwtv_sql.='jwtv_descri="'.$titulo.'",';
					$jwtv_sql.='jwtv_title="'.$titulo.'",';
					$jwtv_sql.='jwtv_media="'.$filempg.'",';

		// 			$jwtv_sql.='jwtv_media1080="'.$filempg1080.'",';
					$jwtv_sql.='jwtv_media720="'.$filempg720.'",';
					$jwtv_sql.='jwtv_media480="'.$filempg480.'",';
					$jwtv_sql.='jwtv_media360="'.$filempg360.'",';
					$jwtv_sql.='jwtv_media240="'.$filempg240.'",';
					$jwtv_sql.='jwtv_mediamp3="'.$filempgmp3.'",';

		// 			$jwtv_sql.='jwtv_media1080s="'.$filempg1080s.'",';
					$jwtv_sql.='jwtv_media720s="'.$filempg720s.'",';
					$jwtv_sql.='jwtv_media480s="'.$filempg480s.'",';
					$jwtv_sql.='jwtv_media360s="'.$filempg360s.'",';
					$jwtv_sql.='jwtv_media240s="'.$filempg240s.'",';
					$jwtv_sql.='jwtv_mediamp3s="'.$filempgmp3s.'",';

					$jwtv_sql.='jwtv_image="'.$fileimg.'",';
					$jwtv_sql.='jwtv_image0="'.$categ0img.'",';
					$jwtv_sql.='jwtv_subtt="'.$filevtt.'",';
					$jwtv_sql.='jwtv_publi="'.$publicado.'",';
					$jwtv_sql.='jwtv_modif="'.$actualizado.'",';

					$jwtv_sql.='jwtv_segundos="'.$segundos.'",';
					$jwtv_sql.='jwtv_status="-" ';
					$jwtv_sql.='where jwtv_codigo="'.$codigo.'"';
					
					
					if($actualizado>=$fecha7)
					{
						$jwtv_res=msql_query($jwtv_sql,$link_vcrx);	
						if(msql_errno()>0)
						{
							echo '<br>**** ERROR : '.$jwtv_sql;
							echo '<br>**** ERROR : '.msql_error();
						}
					}

					if($guia=='553647727f0bc1fc27069de5')
					{
		// 				echo '<br>*************'.$jwtv_sql;
					}

				}
				}	
				$_SESSION['lguia']=$guia; 
		
// 			if(!$jwtv_res or 1==1)
// 			{
// 			echo '<br>****'.$jwtv_sql;	
// 			echo '<br>****'.msql_error();
// 			}
// 			if(mb_stristr($titulo,'establecido')){die('');}
		
			}
	}
	
}

?>

<?php
function genxspf($lang)
{
 	include('../_cfg/config.php');

		$jwtv_sql='delete from jwtv0 where jwtv_guia="" or jwtv_guia is null';
		$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	
// 	$jwtv_sql='update jwtv0 set jwtv_categ1d=jwtv_categ1 where jwtv_categ1d="" or jwtv_categ1d is null';
// 	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);

	
			$jwtv_sql='select distinct jwtv_categ1,jwtv_categ1d, jwtv_lang from jwtv0';
			$jwtv_sql.=' where jwtv_lang="'.$lang.'" and jwtv_categ1d!="" and jwtv_categ1d is not null';
			$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
			while($jwtv_aso=msql_fetch_assoc($jwtv_res))
			{
// 				$cat1_sql='update jwtv0 set jwtv_categ1d="'.$jwtv_aso['jwtv_categ1d'].'" ';
// 				$cat1_sql.='where jwtv_categ1="'.$jwtv_aso['jwtv_categ1'].'" and jwtv_lang="'.$jwtv_aso['jwtv_lang'].'" and (jwtv_categ1d="" or jwtv_categ1d is null)';
// 				$cat1_res=msql_query($cat1_sql,$link_vcrx);
			}
	
		$rutatv='../../iptv/jwtv/';
		if (!file_exists($rutatv)){mkdir($rutatv);}
		$main_date = date("Y-m-d\TH:i:s", time());
	
		$name= 	'jwtv'.'.xspf';
		$xml1 = $rutatv.$name ;

		$xml=new DomDocument("1.0","UTF-8");
		$xml->xmlStandalone = true;

		$playlist=$xml->createElement("playlist");	
		$playlist=$xml->appendChild($playlist);
		$playlist->setAttribute("xmlns","http://xspf.org/ns/0/");
		$playlist->setAttribute("version", "1");
		{
			$datetl=$xml->createElement("date",$main_date);	
			$datetl=$playlist->appendChild($datetl);

			$tracklist=$xml->createElement("trackList");	
			$tracklist=$playlist->appendChild($tracklist);
			{
				$jwtv_sql ='select distinct jwtv_lang, lang_descri from jwtv0 left join lang0 on jwtv_lang=lang_codigo ';
				$jwtv_sql.='where jwtv_guia!="" ';
// 				$jwtv_sql.='order by length(jwtv_lang), jwtv_lang';
				$jwtv_sql.='order by length(jwtv_lang), lang_descri ';
				$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
				
	
				while($jwtv_aso=msql_fetch_assoc($jwtv_res))
				{
					$resol='';
					{
						$title="JWTV ".$jwtv_aso['jwtv_lang'];
						$title="".$jwtv_aso['jwtv_lang'].'-'.ucfirst($jwtv_aso['lang_descri']);
						$title=ucfirst($jwtv_aso['lang_descri']);
						$media='http://iptv.vcrxol.com/jwtv/jwtv_'.$jwtv_aso['jwtv_lang'].'.xspf';
						$image='http://iptv.vcrxol.com/icon/logo_'.$jwtv_aso['jwtv_lang'].'.jpg';
						{	
							$track=$xml->createElement("track");	
							$track=$tracklist->appendChild($track);
							$track->appendChild($xml->createElement("title",$title));
							$track->appendChild($xml->createElement("location",$media));
							$track->appendChild($xml->createElement("image",$image));
						}
					}	
				}	
			}
		}
		$xml->formatOut=true;
		$xml->save($xml1);
		echo '<br>*** '.$name;
	

	$jwtv_sql='select distinct jwtv_lang from jwtv0 ';
	if($lang!="")
	{$jwtv_sql.='where jwtv_lang="'.$lang.'" ';}
	$jwtv_sql.='order by length(jwtv_lang), jwtv_lang';
	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	while($jwtv_aso=msql_fetch_assoc($jwtv_res))
	{genxspf0($jwtv_aso['jwtv_lang']);}
	
	
	$jwtv_sql='select distinct jwtv_lang from jwtv0 ';
	if($lang!="")
	{$jwtv_sql.='where jwtv_lang="'.$lang.'" ';}
	$jwtv_sql.='order by length(jwtv_lang), jwtv_lang';
	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	while($jwtv_aso=msql_fetch_assoc($jwtv_res))
	{
// 		genxspf1($jwtv_aso['jwtv_lang'],'1080');
		genxspf1($jwtv_aso['jwtv_lang'],'720');
		genxspf1($jwtv_aso['jwtv_lang'],'480');
		genxspf1($jwtv_aso['jwtv_lang'],'360');
		genxspf1($jwtv_aso['jwtv_lang'],'240');
		genxspf1($jwtv_aso['jwtv_lang'],'mp3');
	}

	if(1==1)
	{
	$jwtv_sql='select distinct jwtv_categ0,jwtv_lang,jwtv_categ0n from jwtv0 ';
	if($lang!="")
	{$jwtv_sql.='where jwtv_lang="'.$lang.'" ';}
	$jwtv_sql.='order by length(jwtv_lang), jwtv_lang, jwtv_categ0n';
	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	while($jwtv_aso=msql_fetch_assoc($jwtv_res) )
	{
// 		genxspf2('',$jwtv_aso['jwtv_categ0'],$jwtv_aso['jwtv_lang'],'0','1080');
		genxspf2('',$jwtv_aso['jwtv_categ0'],$jwtv_aso['jwtv_lang'],'0','720');
		genxspf2('',$jwtv_aso['jwtv_categ0'],$jwtv_aso['jwtv_lang'],'0','480');
		genxspf2('',$jwtv_aso['jwtv_categ0'],$jwtv_aso['jwtv_lang'],'0','360');
		genxspf2('',$jwtv_aso['jwtv_categ0'],$jwtv_aso['jwtv_lang'],'0','240');
		genxspf2('',$jwtv_aso['jwtv_categ0'],$jwtv_aso['jwtv_lang'],'0','mp3');
	}
	}
// 	echo '<br>*****';
// 	die();

	if(1==1)
	{
// 	$jwtv_sql='select distinct jwtv_categ1, jwtv_lang from jwtv0 order by length(jwtv_lang), jwtv_lang, jwtv_categ0n, jwtv_categ1 ';
// 	$jwtv_sql='select distinct jwtv_categ1, jwtv_lang from jwtv0 ';
	$jwtv_sql='select distinct jwtv_categ0n,jwtv_categ1, jwtv_lang from jwtv0 ';
	if($lang!="")
	{$jwtv_sql.='where jwtv_lang="'.$lang.'" ';}
	$jwtv_sql.='order by length(jwtv_lang), jwtv_lang,  jwtv_categ0n, jwtv_categ1 ';
	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	while($jwtv_aso=msql_fetch_assoc($jwtv_res))
	{
// // 		genxspf2($jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','1080');
// 		genxspf2($jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','720');
// 		genxspf2($jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','480');
// 		genxspf2($jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','360');
// 		genxspf2($jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','240');
// 		genxspf2($jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','mp3');

// 		genxspf2($jwtv_aso['jwtv_categ0n'],$jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','1080');
		genxspf2($jwtv_aso['jwtv_categ0n'],$jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','720');
		genxspf2($jwtv_aso['jwtv_categ0n'],$jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','480');
		genxspf2($jwtv_aso['jwtv_categ0n'],$jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','360');
		genxspf2($jwtv_aso['jwtv_categ0n'],$jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','240');
		genxspf2($jwtv_aso['jwtv_categ0n'],$jwtv_aso['jwtv_categ1'],$jwtv_aso['jwtv_lang'],'1','mp3');
	
	}

	}
	
}

?>

<?php
function genxspf0($lang)
{
include('../_cfg/config.php');

		$rutatv='../../iptv/jwtv/';
		if (!file_exists($rutatv)){mkdir($rutatv);}
		$main_date = date("Y-m-d\TH:i:s", time());

		$name= 	'jwtv_'.$lang.'.xspf';
		$xml1 = $rutatv.$name ;


		$xml=new DomDocument("1.0","UTF-8");
		$xml->xmlStandalone = true;

		$playlist=$xml->createElement("playlist");	
		$playlist=$xml->appendChild($playlist);
		$playlist->setAttribute("xmlns","http://xspf.org/ns/0/");
		$playlist->setAttribute("version", "1");
		{

			$tracklist=$xml->createElement("trackList");	
			$tracklist=$playlist->appendChild($tracklist);

			// CAT 0
			{

				$arr = array('720','480', '360', '240','mp3');
				foreach ($arr as &$resol) 
				{
				$media='http://iptv.vcrxol.com/jwtv/jwtv_'.$lang.$resol.'.xspf';
				$title=$resol;
				$image='http://iptv.vcrxol.com/icon/logo'.$resol.'.jpg';
					
				$trackok=1;
				if ($trackok==1)
				{	
					$track=$xml->createElement("track");	
					$track=$tracklist->appendChild($track);

// 					$nodo=$xml->createElement("title",$title);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("title",$title));

// 					$nodo=$xml->createElement("location",$media);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("location",$media));

// 					$nodo=$xml->createElement("image",$image);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("image",$image));
				}

				}	
		
			}

	
		}

		$xml->formatOut=true;
		// $strings_xml=$xml->saveXML();
		$xml->save($xml1);
		echo '<br>*** '.$name;
	
	
	
}
?>


<?php
function genxspf1($lang,$resol)
{

// if($resol!=720){return;}
	
include('../_cfg/config.php');
	
		$xcolu=8;
		$ccolu=0;	

		$rutatv='../../iptv/jwtv/';
		if (!file_exists($rutatv)){mkdir($rutatv);}
		$main_date = date("Y-m-d\TH:i:s", time());

		$name= 	'jwtv_'.$lang.$resol.'.xspf';
		$xml1 = $rutatv.$name ;


		$xml=new DomDocument("1.0","UTF-8");
		$xml->xmlStandalone = true;

		$playlist=$xml->createElement("playlist");	
		$playlist=$xml->appendChild($playlist);
		$playlist->setAttribute("xmlns","http://xspf.org/ns/0/");
		$playlist->setAttribute("version", "1");
		{

// 			$datetl=$xml->createElement("date",$main_date);	
// 			$datetl=$playlist->appendChild($datetl);

			$tracklist=$xml->createElement("trackList");	
			$tracklist=$playlist->appendChild($tracklist);

			//ULTIMOS
			{
				$jwtv_sql ='select *  ';
				$jwtv_sql.='from jwtv0 where jwtv_lang="'.$lang.'" ';
				if($resol=='mp3')
				{$jwtv_sql.='and jwtv_categ0 like "Audio%" ';}
				else
				{$jwtv_sql.='and jwtv_categ0 not like "Audio%" ';}
				$jwtv_sql.='group by jwtv_guia ';
				$jwtv_sql.='order by jwtv_publi desc, jwtv_guia desc ';
				$jwtv_sql.='limit '.$xcolu;
				$jwtv_res=msql_query($jwtv_sql,$link_vcrx);

				while($jwtv_aso=msql_fetch_assoc($jwtv_res))
				{
				$media=$jwtv_aso['jwtv_media'.$resol];
				$title=$jwtv_aso['jwtv_title'];
				if($jwtv_aso['jwtv_categ0']=='Audio'){$title='♪ '.$title;	}
				if ($title==""){$title=$jwtv_aso['jwtv_categ1d'];}
				$image=$jwtv_aso['jwtv_image'];
					
				$trackok=1;
				if ($trackok==1)
				{	
					$track=$xml->createElement("track");	
					$track=$tracklist->appendChild($track);

// 					$nodo=$xml->createElement("title",$title);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("title",$title));

// 					$nodo=$xml->createElement("location",$media);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("location",$media));

// 					$nodo=$xml->createElement("image",$image);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("image",$image));
				}

				}	
	
			}

			// CAT 0
			{
	
				$jwtv_sql ='select jwtv0.*, jwtv_categ0 as categ,jwtv_categ0d as categd, 0 as numcat, max(jwtv_image0) as image0 ';
				$jwtv_sql.='from jwtv0 where jwtv_lang="'.$lang.'" ';
				if($resol=='mp3')
				{$jwtv_sql.='and jwtv_categ0 like "Audio%" ';}
// 				else
// 				{$jwtv_sql.='and jwtv_categ0 not like "Audio%" ';}
				$jwtv_sql.='group by jwtv_categ0d ';
				$jwtv_sql.='order by jwtv_categ0n ';
				$jwtv_res=msql_query($jwtv_sql,$link_vcrx);

				while($jwtv_aso=msql_fetch_assoc($jwtv_res))
				{
				$media='http://iptv.vcrxol.com/jwtv/jwtv_'.$jwtv_aso['jwtv_lang'].$resol.'_'.$jwtv_aso['numcat'].$jwtv_aso['categ'].'.xspf';
				$title=strtoupper2($jwtv_aso['categd']);
				if ($title==""){$title=$jwtv_aso['categ'];}
				$title='* '.$title;
				$image=$jwtv_aso['image0'];
				if($image=="" and $jwtv_aso['categ']=="Audio"){$image='http://iptv.vcrxol.com/icon/logomp3.jpg';}
					
				$trackok=1;
				if ($trackok==1)
				{	
					$track=$xml->createElement("track");	
					$track=$tracklist->appendChild($track);

// 					$nodo=$xml->createElement("title",$title);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("title",$title));

// 					$nodo=$xml->createElement("location",$media);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("location",$media));

// 					$nodo=$xml->createElement("image",$image);	
// 					$nodo=$track->appendChild($nodo);
					$track->appendChild($xml->createElement("image",$image));
					
					$ccolu++;
				}

				}	
		
			}

			// CAT 1
			{
				$jwtv_sql ='select jwtv0.*, ';
				$jwtv_sql.='jwtv_categ1 as categ, max(jwtv_categ1d) as categd, 1 as numcat,';
				$jwtv_sql.='count(jwtv_categ0n) as contador0,';
				$jwtv_sql.='max(jwtv_image0) as image0, ';
				$jwtv_sql.='max(jwtv_image) as image ';
				$jwtv_sql.='from jwtv0 where jwtv_lang="'.$lang.'" ';
				if($resol=='mp3')
				{$jwtv_sql.='and jwtv_categ0 like "Audio%" ';}
// 				else
// 				{$jwtv_sql.='and jwtv_categ0 not like "Audio%" ';}
				$jwtv_sql.='group by jwtv_categ0,jwtv_categ1 ';
				$jwtv_sql.='order by jwtv_categ0n, contador0 desc, jwtv_categ1d, jwtv_categ1';
				$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	
				$lcateg0="";
				while($jwtv_aso=msql_fetch_assoc($jwtv_res))
				{
				$jwtv_sql2 ='select * from jwtv0 where jwtv_categ1d="'.$jwtv_aso['categd'].'" ';
				$jwtv_sql2.='and jwtv_categ0="'.$jwtv_aso['jwtv_categ0'].'"';
				$jwtv_sql2.='and jwtv_lang="'.$lang.'"';
				$jwtv_res2=msql_query($jwtv_sql2,$link_vcrx);
				$categ0=msql_result($jwtv_res2,0,'jwtv_categ0');
				$categ1=msql_result($jwtv_res2,0,'jwtv_categ1');

				$media='http://iptv.vcrxol.com/jwtv/jwtv_'.$jwtv_aso['jwtv_lang'].$resol.'_'.$jwtv_aso['numcat'].$jwtv_aso['categ'].'_'.$jwtv_aso['jwtv_categ0n'].'.xspf';
				$title=$jwtv_aso['categd'];
				if ($title==""){$title=categ1des($lang,$jwtv_aso['jwtv_categ1']);}
				if ($title==""){$title=$jwtv_aso['jwtv_categ1'];}
				$image=$jwtv_aso['image0'];
				if($image==""){$image=$jwtv_aso['image'];}
				if(mb_stristr($categ0,'Audio'))
				{
					if(mb_stristr($categ1,'Piano')){$title='♪ '.$title;}
					if(mb_stristr($categ1,'Orchestra')){$title='♫ '.$title;}
					if(mb_stristr($categ1,'Melodies')){$title='♪♫ '.$title;}
				}

				if($lcateg0!=$jwtv_aso['jwtv_categ0'])
				{
					while(($ccolu % $xcolu)>0)
					{
					$track=$xml->createElement("track");	
					$track=$tracklist->appendChild($track);
					$track->appendChild($xml->createElement("title","-"));
					$track->appendChild($xml->createElement("location",""));
					$track->appendChild($xml->createElement("image",""));
					$ccolu++;
					}
				}
					
				$trackok=1;
				if ($trackok==1)
				{	
					$track=$xml->createElement("track");	
					$track=$tracklist->appendChild($track);
					$track->appendChild($xml->createElement("title",$title));
					$track->appendChild($xml->createElement("location",$media));
					$track->appendChild($xml->createElement("image",$image));
					$ccolu++;
				}

				$lcateg0=$jwtv_aso['jwtv_categ0'];
					
				}	
		
			}
	
		}

		$xml->formatOut=true;
		// $strings_xml=$xml->saveXML();
		$xml->save($xml1);
		echo '<br>*** '.$name;
	
	
	
}
?>


<?php
function genxspf2($cat0n,$categ,$lang,$numcat,$resol)
{
 	include('../_cfg/config.php');
	
$rutatv='../../iptv/jwtv/';
if (!file_exists($rutatv)){mkdir($rutatv);}
	
if($categ==""){return;}
$name = 	'jwtv_'.$lang.$resol.'_'.$numcat.$categ;
if($numcat=='1')
{$name.= 	'_'.$cat0n;}
$name.='.xspf';


$xml1 = $rutatv.$name ;

echo '<br>'.$name;	

$main_date = date("Y-m-d\TH:i:s", time());
	
$xml=new DomDocument("1.0","UTF-8");
$xml->xmlStandalone = true;

$playlist=$xml->createElement("playlist");	
$playlist=$xml->appendChild($playlist);
$playlist->setAttribute("xmlns","http://xspf.org/ns/0/");
$playlist->setAttribute("version", "1");
{
	
	$datetl=$xml->createElement("date",$main_date);	
	$datetl=$playlist->appendChild($datetl);
	
	$tracklist=$xml->createElement("trackList");	
	$tracklist=$playlist->appendChild($tracklist);
	{
	
		$jwtv_sql ='select * from jwtv0 ';
		$jwtv_sql.='where jwtv_lang="'.$lang.'" ';
		$jwtv_sql.='and jwtv_categ'.$numcat.'="'.$categ.'" ';
		$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
		$categ0=msql_result($jwtv_res,0,'jwtv_categ0');
		$categ1=msql_result($jwtv_res,0,'jwtv_categ1');

		$jwtv_sql ='select * from jwtv0 ';
		$jwtv_sql.='where jwtv_lang="'.$lang.'" ';
		$jwtv_sql.='and jwtv_categ'.$numcat.'="'.$categ.'" ';
		if($numcat=='1')
		{$jwtv_sql.='and jwtv_categ0n="'.$cat0n.'"';
		}
		if($resol=='mp3')
		{$jwtv_sql.='and jwtv_categ0 like "Audio%" ';}		
// 		else 
// 		{$jwtv_sql.='and jwtv_categ0 not like "Audio%" ';}
		$jwtv_sql.=' group by jwtv_guia ';

		$orderby ='order by jwtv_modif desc';	
		if($categ0=='Audio' and mb_stristr('KNOPV',substr($categ1,0,1)))
		{$orderby ='order by jwtv_title ';}
		if($categ0=='Audio' and mb_stristr('D',substr($categ1,0,1)))
		{$orderby ='order by jwtv_publi ';}

// 		$jwtv_sql.='group by jwtv_title ';

		$jwtv_sql.=$orderby;
// 		 echo '<br>'.$jwtv_sql;
	
		$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	
		while($jwtv_aso=msql_fetch_assoc($jwtv_res))
		{
			$media=$jwtv_aso['jwtv_media'.$resol];
			$medias=$jwtv_aso['jwtv_media'.$resol.'s'];

			if(mb_stristr($jwtv_aso['jwtv_categ0'],'Music') or mb_stristr($jwtv_aso['jwtv_categ1'],'Song'))
			{$media=$medias;}
			
			$title=$jwtv_aso['jwtv_title'];
			$image=$jwtv_aso['jwtv_image'];
			{	
				$track=$xml->createElement("track");	
				$track=$tracklist->appendChild($track);

// 				$nodo=$xml->createElement("title",$title);	
// 				$nodo=$track->appendChild($nodo);
				$track->appendChild($xml->createElement("title",$title));

// 				$nodo=$xml->createElement("location",$media);	
// 				$nodo=$track->appendChild($nodo);
				$track->appendChild($xml->createElement("location",$media));

// 				$nodo=$xml->createElement("image",$image);	
// 				$nodo=$track->appendChild($nodo);
				$track->appendChild($xml->createElement("image",$image));

// 				$nodo=$xml->createElement("album",$jwtv_aso['jwtv_categ'.$numcat.'']);	
// 				$nodo=$track->appendChild($nodo);
				$track->appendChild($xml->createElement("album",$jwtv_aso['jwtv_categ'.$numcat.'']));

	// 			$nodo=$xml->createElement("artist",$jwtv_aso['jwtv_categ1d']);	
	// 			$nodo=$track->appendChild($nodo);

	// 			$nodo=$xml->createElement("date",$jwtv_aso['jwtv_modif']);	
	// 			$nodo=$track->appendChild($nodo);

// 				$nodo=$xml->createElement("identifier",$jwtv_aso['jwtv_guia']);	
// 				$nodo=$track->appendChild($nodo);
				$track->appendChild($xml->createElement("identifier",$jwtv_aso['jwtv_guia']));

// 				$nodo=$xml->createElement("info","https://tv.jw.org");	
// 				$nodo=$track->appendChild($nodo);
				$track->appendChild($xml->createElement("info","https://tv.jw.org"));

			}
		}
	}

}
	
$xml->formatOut=true;
// $strings_xml=$xml->saveXML();
$xml->save($xml1);
	
	
}
?>

<?php
function genm3u()
{
 	include('../_cfg/config.php');
	
	$rutatv='../../iptv/jwtv/';
	if (!file_exists($rutatv)){mkdir($rutatv);}
	
	if($categ==""){return;}

	$jwtv_sql='delete from jwtv0 where jwtv_guia="" or jwtv_guia is null';
	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);

	$jwtv_sql ='select * from jwtv0 ';
	$jwtv_sql.='where jwtv_lang="'.$lang.'" ';

	$jwtv_sql ='select distinct lang_codigo, lang_descri from lang0 join jwtv0 on lang_codigo=jwtv_lang ';
	$jwtv_sql.='  order by length(trim(lang_codigo)),lang_codigo';
	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
	echo 'AQUI';
	ob_start(); 
	echo '#EXTM3U';
	
	while($jwtv_aso=msql_fetch_assoc($jwtv_res))
	{
		echo ' #EXTINF:-1 ';
		echo ' tvg-id="" ';
		echo ' tvg-name="'.$jwtv_aso['lang_descri'].'" ';
		echo ' tvg-logo=http://iptv.vcrxol.com/icon/logo_'.$jwtv_aso['lang_codigo'].'.jpg ';
		echo ' group-title=""';
		echo ','.$jwtv_aso['lang_descri'].'" ';
		echo 'http://iptv.vcrxol.com/jwtv/'.'jwtv_'.$jwtv_aso['lang_codigo'].'.m3u';
	// 	#EXTINF:-1 
	// 		tvg-id="" tvg-name="PPV1 (partidos)" tvg-logo="http://iptveiksprivado.com/images/vod/eventosppv.png"
	// 		group-title="Eventos",PPV1 (partidos)
	// 		http://www.jomyson.com:8000/live/vicore1/248989/2875.ts

	}	
	
	$obstart = ob_get_clean();

// 	$media='http://iptv.vcrxol.com/jwtv/jwtv_'.$jwtv_aso['jwtv_lang'].$resol.'_'.$jwtv_aso['numcat'].$jwtv_aso['categ'].'.xspf';
	
	$name= 	'jwtv.m3u';
	$name= 	'jwtv_'.$lang.'.m3u';
	$m3ufile = $rutatv.$name ;
	file_put_contents($m3ufile,$obstart);

	
}

?>

<?php 
// set_time_limit(0);
// echo '***'.$tipo;
if ($guia2==''){$_SESSION['guias']='G';}
else{$_SESSION['guias']='S';} 

// echo shell_exec('whoami');
//   system("php _borra1.php");
// if(file_exists('../../_lib/_borra1.php')){echo '1';}else{echo '0';};
//   system("php ../../_lib/_borra1.php");

// getjwtv_0('S');
die('YA ESTA AUTOMATIZADO EN CJ')
	if ($tipo=='MENU')
	{ 
 		getlang();

		
			$jwtv_sql='select distinct jwtv_categ1,jwtv_categ1d, jwtv_lang from jwtv0 where jwtv_categ1d!="" and jwtv_categ1d is not null';
			$jwtv_res=msql_query($jwtv_sql,$link_vcrx);
			while($jwtv_aso=msql_fetch_assoc($jwtv_res))
			{
// 				$cat1_sql='update jwtv0 set jwtv_categ1d="'.$jwtv_aso['jwtv_categ1d'].'" where jwtv_categ1="'.$jwtv_aso['jwtv_categ1'].'" and jwtv_lang="'.$jwtv_aso['jwtv_lang'].'" and (jwtv_categ1d="" or jwtv_categ1d is null)';
// 				$cat1_res=msql_query($cat1_sql,$link_vcrx);
			}

		echo'<br>';
		echo'<table>';
		echo'<tr>';
		$ptabla='lang'; $pcaption=' LENGUAJE'; $pidtxt='jwtv_lang'; $pobj=3;  include('vrgetcod.php');
		echo'</tr>';
		echo'<tr>';
		echo'<td>';
		$pcaption=' GET'; $pidtxt='jwtv_get'; $ponclick="jwib_jwtv1('GET',jwtv_lang.value)"; include('vrbutton.php');
		echo'</td>';
		echo'<td>';
		$pcaption=' XSPF'; $pidtxt='jwtv_xspf'; $ponclick="jwib_jwtv1('XSPF',jwtv_lang.value)"; include('vrbutton.php');
		echo'</td>';
		echo'</tr>';
		echo'</table>';

		echo'<br>';
		echo'<table>';
		echo'<tr>';
		echo'<td>';
		$pcaption='Prueba'; $pidtxt='jwtv_cele'; $ponclick="jwib_jwtv1('CELE')"; include('vrbutton.php');
		echo'</td>';
		echo'</tr>';
		echo'</table>';
		echo 'M3U';
		echo genm3u();
		

	}

	if ($tipo=='XSPF')
	{ 
		genxspf($lang);
	}
// 		echo '<div>'.'style="font-family:courier;"';

	if ($tipo=='GET')
	{
		echo '<br>'.'*** INICIO ***'.'<br>';
		getjwtv0($tipo,$lang,$guia2);
		echo '<br>'.'*** FIN ***'.'<br>';
// 		genxspf($lang);
// 		$_SESSION['lguia']=''; 
	} 
// 	 	{getjwtv1('Audio','Audio',$lang,$guia2,'',21);}


	$jwtv_sql='delete from jwtv0 where jwtv_media is null or jwtv_media=""';
	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);	

// 	$jwtv_sql='update jwtv0 set jwtv_image0=jwtv_image, jwtv_image1=jwtv_image where jwtv_categ0 like "Audio%"';
// 	$jwtv_res=msql_query($jwtv_sql,$link_vcrx);	




?>



<?php
// {"category":
//  {"key":"VideoOnDemand","type":"container","name":"Videos","description":"Conozca nuestra videoteca","tags":["RokuCategorySelectionPosterScreen","IncludeInJWORGAllVideosCatList","WebIncludeSubCategoriesInNav","RokuCategoryGrid"],"images":{"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pss_xs.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pss_md.png"},"pns":{"lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pns_lg.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pns_md.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pns_xs.png"},"sqs":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_sqs_sm.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_sqs_xs.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pnr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pnr_xs.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_pnr_md.png"},"sqr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_sqr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_sqr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_sqr_xs.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_sqr_md.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_wss_xs.png"},"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_wsr_xs.png"},"lsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_lsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_lsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_lsr_xs.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_lsr_md.png"},"lss":{"lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_lss_lg.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_lss_md.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_lss_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_psr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_psr_xs.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod_psr_md.png"}},"parentCategory":null,
// 	"subcategories":[
// 		{"key":"VODStudio","type":"container","name":"Desde nuestro estudio","description":"Programas mensuales presentados por los miembros del Cuerpo Gobernante de los Testigos de Jehová y los ayudantes de sus comités","tags":["RokuCategoryGridScreen","JWORGExclude","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/vod-studio_rph.png"}},"media":[]},
// 		{"key":"VODChildren","type":"container","name":"Niños","description":"Animaciones que enseñan lecciones importantes de la Biblia","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/children_rph.png"}},"media":[]},
// 		{"key":"VODTeenagers","type":"container","name":"Jóvenes","description":"Películas, programas y entrevistas que destacan la importancia de seguir los consejos de la Biblia y tener valores morales","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/teenagers_rph.png"}},"media":[]},
// 		{"key":"VODFamily","type":"container","name":"Familia","description":"Familias cristianas que se enfrentan a los problemas","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/family_rph.png"}},"media":[]},
// 		{"key":"VODProgramsEvents","type":"container","name":"Programas espirituales","description":"Emisión de programas espirituales o reportajes sobre los aspectos destacados de estos","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/programs-events_rph.png"}},"media":[]},
// 		{"key":"VODOurActivities","type":"container","name":"Qué hacemos","description":"Reportajes sobre la impresión de publicaciones que realizan los testigos de Jehová a nivel mundial, las obras de construcción que llevan a cabo y la ayuda que brindan a los afectados por desastres naturales","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/activities_rph.png"}},"media":[]},
// 		{"key":"VODMinistry","type":"container","name":"Nuestras reuniones y predicación","description":"Un vistazo a los esfuerzos que hacen los Testigos en todo el mundo para dar clases gratuitas de la Biblia","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/ministry_rph.png"}},"media":[]},
// 		{"key":"VODOurOrganization","type":"container","name":"Nuestra organización","description":"Reportajes sobre el funcionamiento de nuestras sucursales, las obras de construcción que llevamos a cabo y los programas educativos que impartimos","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/organization_rph.png"}},"media":[]},
// 		{"key":"VODBible","type":"container","name":"La Biblia","description":"Cómo traducimos, imprimimos y enseñamos la Palabra de Dios","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/bible_rph.png"}},"media":[]},
// 		{"key":"VODMovies","type":"container","name":"Películas","description":"Películas basadas en relatos bíblicos y situaciones de la vida actual","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/movies_rph.png"}},"media":[]},
// 		{"key":"VODMusicVideos","type":"container","name":"Música","description":"Canciones que fortalecen la fe de personas de todas las edades","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_wss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_rps.png"},"sqr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_sqr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_sqr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_sqr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_sqr_xs.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_pnr_xs.png"},"lsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_lsr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_lsr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_lsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_lsr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/music_rph.png"}},"media":[]},
// 		{"key":"VODIntExp","type":"container","name":"Entrevistas y experiencias","description":"Testigos de Jehová de distintos antecedentes relatan experiencias personales que muestran el poder que tiene la Biblia en la vida de las personas","tags":["RokuCategoryGridScreen","RokuCategoryCarouselList"],"images":{"wsr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_wsr_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_wsr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_wsr_xs.png"},"wss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_wss_sm.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_wss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_wss_xs.png"},"pss":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pss_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pss_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pss_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pss_xs.png"},"rps":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_rps.png"},"pnr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pnr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pnr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pnr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_pnr_xs.png"},"psr":{"sm":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_psr_sm.png","md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_psr_md.png","lg":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_psr_lg.png","xs":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_psr_xs.png"},"rph":{"md":"https://assetsnffrgf-a.akamaihd.net/assets/x/jwb/categories/interviews-experiences_rph.png"}},"media":[]}
// 	]}
// }

?>