parser for tvali.eu, need help

Discuss your Lua playlist, album art and interface scripts.
Ymmu M'Kursa
New Cone
New Cone
Posts: 1
Joined: 27 Jul 2012 13:27

parser for tvali.eu, need help

Postby Ymmu M'Kursa » 27 Jul 2012 14:18

There is a streaming source on the web - tvali.eu
In part it streams russian Cartoon Network channel but in a tricky way.
I've created VLC parser and it doesn't work properly. First, my parser doesn't work at all if I don't watch the tvali channel through their own player in browser previously.
Second, when I watch the channel by VLC after mentioned manipulations, the video stops every two or three seconds, VLC buffers current flv chunk in playlist again and again so it becomes useless to use it.
Why do I want to see the stream by VLC and not form tvali web page? Because VLC allows resizing video window, placing it anywhere on the screen and keeping it on top over the other windows. Help me to write REAL working parser.
I didn't get it how to attach a file to the post so I paste my wrong working lua code for vlc and html code of the page with tvali web player.
I start it in VLC with http://rustv-player.ru/channel/tv/70920_list.php (list of current tvali chunks to play on the time)
LUA CODE:
function probe()
return vlc.access == "http" and string.match( vlc.peek( 512 ), "http://tvali.eu" )
end

function parse()

item = {}
k = 1
while true
do
line = vlc.readline()
if not line
then
break
end

i = 1

while string.find( line, "http://tvali.eu", i )
do

j, i = string.find( line, "http://tvali.eu", i )
if k > 144
then
path = string.sub ( line, j, j + 61 )
path = vlc.strings.decode_uri( path )
table.insert(item, {path = path; url = vlc.path;})
end

k = k + 1
end

end
return item
end
P.S. I know it looks like being written by a code monkey and I could inmprove the code according programming rules and aesthetics but I didn't, sorry.

TVALI ORIGINAL TV PLYER html code
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="Channel" content="RusTV Player">
<script language="javascript" type="text/javascript">
<!--
function MM_swapImgRestore() {
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;}
function MM_preloadImages() {
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}}
function MM_findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;}
function MM_swapImage() {
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
//-->
</script>
</head>
<body bgcolor="#000000">

<div id="Server_1" style="position:absolute; left:45px; top:-2px; z-index:11"><a onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav110','','images/b1.gif',1)" href="cartoon.htm"><img name="nav110" onload="MM_preloadImages('images/b1.gif')" alt="" border="0" src="images/a1.gif"></a></div>

<div id="Server_2" style="position:absolute; left:145px; top:-2px; z-index:12"><a onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav120','','images/b2.gif',1)" href="cartoon-2.htm"><img name="nav120" onload="MM_preloadImages('images/b2.gif')" alt="" border="0" src="images/a2.gif"></a></div>

<script type="text/javascript" src="http://tvali.ge/tv/swfobjectold.js"></script>

<div align="center" id="player" style="position:absolute; left:10px; top:30px; z-index:1"><embed type="application/x-shockwave-flash" src="http://tvali.eu/145F6ACB/mediaplayerpl.swf" width="570" height="387" style="undefined" id="player" name="player" quality="high" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" flashvars="width=574&height=420&file=http://rustv-player.ru/channel/tv/70920 ... een"></div>

<script type="text/javascript">
document.write('<img height="1" width="1" src="http://tvali.ge/streamgadget.php"><img height="1" width="1" src="http://tvali.ge/index.php?action=sat&ch ... 0952"><img height="1" width="1" src="http://tvali.ge/index.php?action=sat&ch ... 0952"><img height="1" width="1" src="http://tvali.ge/popup.php">');


{ var s1 = new SWFObject("http://tvali.eu/145F6ACB/mediaplayerpl. ... ","387","7");
s1.addParam('allowscriptaccess','always');
s1.addParam('allowfullscreen','true');
s1.addVariable("width","574");
s1.addVariable("height","420");
s1.addVariable("file","http://rustv-player.ru/channel/tv/70920_list.php");
s1.addVariable("displayheight","220");
s1.addVariable("backcolor","1B2437");
s1.addVariable("frontcolor","cccCCC");
s1.addVariable("lightcolor","eeEEEE");
s1.addVariable("screencolor","000000");
s1.addVariable('autostart','true');
s1.addVariable('repeat','list');
s1.addVariable("overstretch","uniform");
s1.addVariable("controlbar","over");
s1.addVariable("item","144");
s1.addVariable('playlist', "right");
s1.addVariable('playlistsize', "70");
s1.addVariable("skin","http://rustv-player.ru/channel/styles/overlay.swf");
s1.addVariable("shuffle","false");
s1.addVariable("autoscroll","false");
s1.addVariable("thumbsinplaylist","true");
s1.addVariable('bufferlength','4');
s1.addVariable("titlesinplaylist","false");
s1.addVariable("streamer","lighttpd");
s1.addVariable("icons","true");
s1.addVariable("linktarget","_blank");
s1.addVariable("displayclick","fullscreen");
s1.addParam('wmode','transparent');
s1.write("player");
}


</script><img height="1" width="1" src="http://tvali.ge/streamgadget.php"><img height="1" width="1" src="http://tvali.ge/index.php?action=sat&ch ... 0952"><img height="1" width="1" src="http://tvali.ge/index.php?action=sat&ch ... 0952"><img height="1" width="1" src="http://tvali.ge/popup.php"></body></html>

Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 26 guests