Scusate se apro discussioni ancora su questo argomento, ma non riesco a capire perchè non va?![]()
Ho questo codice per il caricamento di video su youtube:
Youtube_setup.php
Caricamento.phpCodice PHP:<?php
require_once 'Zend/Loader.php'; // verificare che la cartella Zend sia nell'include_path
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// URL per l'autenticazione
$authenticationURL= 'http://www.google.com/youtube/accounts/ClientLogin';
// Credo un client http per il login
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
$username = 'r.stagi96@gmail.com',
$password = 'k10041996b',
$service = 'youtube',
$client = null,
$source = 'Applicazione',
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
// Un breve nome per l'applicazione
$applicationId = 'Applicazione';
// Client ID e developer key
$clientId = '676353228006.apps.googleusercontent.com';
$developerKey = 'AI39si6G7Gocf37uwBQCV4MRwY9crMFcblZOAwc-tl9JpQjYz25HMzEu0v7CUZ8rGfEjbgw2QFntBQ70WCRSO3lOON7c8VDVeg';
// Creo quindi l'oggetto $youtube
$youtube = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
?>
Codice PHP:<?php
//Inclusione del file creato in precedenza (vedi pagina 1 di questo articolo)
require_once 'youtube_setup.php';
// Creo l'oggetto VideoEntry
$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();
$myVideoEntry->setVideoTitle('Filmato di esempio');
$myVideoEntry->setVideoDescription('Un upload di esempio, con caricamento via browser, effettuato mediante la YouTube API via PHP');
// Categoria (deve essere una categoria valida)
$myVideoEntry->setVideoCategory('Howto');
// Tags
$myVideoEntry->SetVideoTags('upload, esempio, html.it');
// Indirizzo per generare un token
$tokenHandlerUrl = 'http://gdata.youtube.com/action/GetUploadToken';
// Genero il token associato alla VideoEntry
$tokenArray = $youtube->getFormUploadToken($myVideoEntry, $tokenHandlerUrl);
$tokenValue = $tokenArray['token'];
$postUrl = $tokenArray['url'];
// Indirizzo di rindirizzamento dopo aver caricato il video
$nextUrl = 'http://mio-indirizzo.html.it/youtube_upload';
// Costruisco il form
$form = '<form action="'. $postUrl .'?nexturl='. $nextUrl .
'" method="post" enctype="multipart/form-data">'.
'<input name="file" type="file"/>'.
'<input name="token" type="hidden" value="'. $tokenValue .'"/>'.
'<input value="Carica il video" type="submit" />'.
'</form>';
echo $form;
?>
E puntualmente aprendo caricamento.php mi si presenta quest'errore:
Vi prego aiutatemicodice:Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Unable to Connect to ssl://www.google.com:443. Error #1924720603: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?' in C:\server\php\extras\library\Zend\Gdata\ClientLogin.php:141 Stack trace: #0 C:\server\www\myserver.dev\public_html\youtube_setup.php(19): Zend_Gdata_ClientLogin::getHttpClient('nome_utente-google', 'password', 'youtube', NULL, 'Applicazione', NULL, NULL, 'https://www.goo...') #1 C:\server\www\myserver.dev\public_html\caricamento.php(3): require_once('C:\server\www\m...') #2 {main} thrown in C:\server\php\extras\library\Zend\Gdata\ClientLogin.php on line 141![]()

Rispondi quotando
Ho cercato di tutto... tranne "attivare"
