Salve a tutti ragazzi,

sto cercando di realizzare un sistema per far ricercare e scaricare gratuitamente video da youtube.

avrei bisogno di un aiuto col php e col java.

nei file allegati trovere le indicazioni commentate su dove avrei bisogno di una mano le ritroverete poichè sono segnalate da --------------------------------------------------------------------------------------------------

per vedere in azione il sistema potete andare al seguente link http://www.reggiopress.it/youtube

Grazie a tutti per la collaborazione se è necessario pagare per la consulenza sarò disposto a farlo

Codice PHP:

<script language="JavaScript" type="text/javascript">
//da qui rendo graggabili e prendo il testo dall'html --------------------------------------------------------------------------------------------------
Position.includeScrollOffsets = true;

window.onload = function()
{
    var t1 = document.getElementById("t1");
    add_divs(t1, 'td', 'draggable');
    var trs = t1.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++)
    {
        var divs = document.getElementsByClassName("draggable", trs[i]);
        
        for (var j = 0; j < divs.length; ++j)
        {
            new Draggable(divs[j], {ghosting:true, revert:true});
        }
    }

    var t2 = document.getElementById("t2");
    add_divs(t2, 'td', 'dropsite');
    var divs = document.getElementsByClassName("dropsite", t2);
    for (var j = 0; j < divs.length; ++j)
    {
        Droppables.add(divs[j], {accept:'draggable',
                                     hoverclass:'hoverclass123',
                                     onDrop:function(element, dropon, event)
                                         { debug("" + element.innerHTML + ""
                                                     + "\n")}});
    }
};

function debug(text)
{
   document.getElementById('debug').innerHTML
       = "

<form method='post' action='<?php echo $_SERVER['PHP_SELF']; ?>'><input style='display:none;' maxlength='44' type='text' name='url' value='"+ text +"' style='width: 300px' /><input type='submit' value='Go' /></form>";
}

function add_divs(table, tag, classname)
{
    var items = table.getElementsByTagName(tag);
    for (var i = 0; i < items.length; i++)
        items[i].innerHTML =
            "<div class='" + classname + "'>" + items[i].innerHTML + "</div>";
}


</script>


    </head>
<body>

<?php

$maxrecords
=5;
if (isset(
$_GET['keyword']) && trim($_GET['keyword'])!="") {
    
$keyword=$_GET['keyword'];
    
$keyword=urlencode($keyword);
}
if (isset(
$_GET['maxrecords']) && trim($_GET['maxrecords'])!="") {
    
$maxrecords=$_GET['maxrecords'];
}
?>
<form action="" onsubmit="<?php echo $_SERVER['PHP_SELF']; ?>;" method="get"><div>Search:<input type="text" name="keyword" value=""/> Records:<select name="maxrecords">
<?php
for ($i=2;$i<5;$i++){
    
$j=$i*1;
    if (
$maxrecords == $j) {
        echo 
"<option value='$j' selected='selected'>$j</option>";
    }
    else {
        echo 
"<option value='$j'>$j</option>";
    }
}
?>
</select> <input type="submit" name="submit" value="Search" /></div><div></div></form>
<div>


<?php
if (isset($_POST['url'])) {
    require_once 
'class.YouTubeParser.php';
    
$parser = new YouTubeParser();
    
$url trim(stripslashes($_POST['url']));
    if (!(
$link $parser->getVideoLink($url))) {
        echo 
$parser->errMsg;
    } else {
        echo 
'<div>[url="' $link '"]Download flv[/url]
[url="' 
$link '&fmt=17"]Download 3gp[/url]
[url="' 
$link '&fmt=18"]Download mp4[/url]</div>';
    }
    if (!(
$linkImg $parser->getVideoImg($url))) {
        echo 
$parser->errMsg;
    } else {
        echo 
'<div>[img]' $linkImg '[/img]</div>';
    }
    echo 
'

</body></html>'
;
}
?></div>
<div id="test" style="display:none; float:left;">
<table id="t1" style="width:800px;" class="sortable mytable">
<tr>
<?php
require_once("YouTubeAPI.inc.php");
$api=new YouTubeAPI($keyword,$maxrecords,1);
$result=$api->getStreamingLinks();

//use the below code to get the donload link from the youtube url
$downloadInfo=$api->getDownloadLink("http://www.youtube.com/watch?v=5WDlUPPnBAE");

$total=count($result);
for (
$i=0;$i<$total;$i++){
    
$mobileUrl=$flvUrl="#";
    
$imageSrc=$result[$i]['thumbnailUrl'];
    
$title=$result[$i]['title'];
    if (isset(
$result[$i]['flvurl'])) {
        
$flvUrl=$result[$i]['flvurl'];
    }
    if (isset(
$result[$i]['mobileurl'])) {
        
$mobileUrl=$result[$i]['mobileurl'];
        
    }
    
    
    
    
//vorrei rendere draggabbili solo i link $flvUrl che trovate qui sotto -----------------------------------------------------------------qui---------------------
    
    
    
echo '<td id="prova" style="cursor:pointer">' $title '
[img]' 
$imageSrc '[/img]</td>
<td>' 
$flvUrl '</td></div>';
}
?>
</tr>
</table>



Drop on this table:</p>
<table style="float:right;" id="t2" class="sortable mytable">
    <tr><td><div style="height:30px; width:300px;">Sposta qui</div></td></tr> 

    </table>
    <div style="float:left;" id="debug"></div>
</div>



<div id="link">
[url="#"]Nascondi[/url] | 
[url="#"]Mostra risultati[/url]
</div>