bouke_
%Europe/Berlin %577 %2008, 14:51
Hey, mijn vraag is of het mogelijk is om een video van youtube direct te uploaden naar blip zonder dat je hem eerst zelf moet downloaden. Ik heb een (werkend) script om video's te uploaden naar blip. En een script om .mp4 video's de downloaden van youtube. Maar hoe kan ik die aan elkaar koppelen.
Script om te uploaden naar Blip
<form action="http://uploads.blip.tv/" method="post" enctype="multipart/form-data" id="form_post" name="form_post" >
<input type="hidden" name="post" id="post" value="1"/>
<input type="hidden" name="skin" id="skin" value="api"/>
<input type="hidden" name="userlogin" id="userlogin" value="Gebruikersnaam"/>
<input type="hidden" name="password" id="password" value="******"/>
<label>
File:<input type="file" name="file" id="file"/>
</label>
<label>
Title:
<input type="text" name="title" id="title" />
</label>
<input type="submit" name="button" id="button" value="Submit" />
</form>
Script om te downloaden van Youtube
<?PHP if(!empty($_GET['name'])) {
$location = htmlspecialchars($_GET['name']);
try {
$handle = fopen($location, "r");
if($handle) {
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
$result1 = preg_match("/&t=([\w]*)&/",$contents,$tickets);
$result2 = preg_match("/v=(\w*)/",$location,$video_id);
if($result1) {
echo "<a href = \"http://www.youtube.com/get_video?video_id=";
echo $video_id[1];
echo "&t=";
echo $tickets[1];
echo "&fmt=18\">Download link.</a>";
echo "<br>";
echo "Sla mp4 op.";
}
else echo "Fout1";
}
else echo "\nFout2";
}
catch(Exception $e) {echo "Fout3";}
}
else echo "Geen Invoer :(";
?>
Script om te uploaden naar Blip
<form action="http://uploads.blip.tv/" method="post" enctype="multipart/form-data" id="form_post" name="form_post" >
<input type="hidden" name="post" id="post" value="1"/>
<input type="hidden" name="skin" id="skin" value="api"/>
<input type="hidden" name="userlogin" id="userlogin" value="Gebruikersnaam"/>
<input type="hidden" name="password" id="password" value="******"/>
<label>
File:<input type="file" name="file" id="file"/>
</label>
<label>
Title:
<input type="text" name="title" id="title" />
</label>
<input type="submit" name="button" id="button" value="Submit" />
</form>
Script om te downloaden van Youtube
<?PHP if(!empty($_GET['name'])) {
$location = htmlspecialchars($_GET['name']);
try {
$handle = fopen($location, "r");
if($handle) {
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
$result1 = preg_match("/&t=([\w]*)&/",$contents,$tickets);
$result2 = preg_match("/v=(\w*)/",$location,$video_id);
if($result1) {
echo "<a href = \"http://www.youtube.com/get_video?video_id=";
echo $video_id[1];
echo "&t=";
echo $tickets[1];
echo "&fmt=18\">Download link.</a>";
echo "<br>";
echo "Sla mp4 op.";
}
else echo "Fout1";
}
else echo "\nFout2";
}
catch(Exception $e) {echo "Fout3";}
}
else echo "Geen Invoer :(";
?>