Commit e8a3a914 authored by Rohit Yadav's avatar Rohit Yadav

YouTube: Fix YouTube API changes.

This patch fixes authentication http post url and couple of minor changes
recently introduced in YouTube APIs.
parent bc4352f7
......@@ -65,7 +65,6 @@ void
YouTubeAuthenticator::authInit()
{
m_isAuthenticated = false;
m_nick.clear();
m_authString.clear();
m_authError.clear();
}
......@@ -141,13 +140,6 @@ YouTubeAuthenticator::getAuthString()
return m_authString;
}
const QString&
YouTubeAuthenticator::getNick()
{
return m_nick;
}
void
YouTubeAuthenticator::setCredentials( const QString& username, const QString& password )
{
......@@ -161,7 +153,7 @@ YouTubeAuthenticator::setPOSTData()
{
m_postData.clear();
m_postData += QString("accountType=HOSTED_OR_GOOGLE&Email=%1&Passwd=%2"
"&service=youtube&source=VLMC").arg(m_username, m_password);
"&service=youtube&source=VLMC").arg( m_username, m_password );
}
void
......@@ -192,14 +184,9 @@ YouTubeAuthenticator::setAuthData( QByteArray& data )
m_authString = tokenList.at(1);
continue;
}
if( tokenList.at(0) == "YouTubeUser" )
{
m_nick = tokenList.at(1);
}
}
if( !m_authString.isEmpty() && !m_nick.isEmpty() && m_authError.isEmpty() )
if( !m_authString.isEmpty() && m_authError.isEmpty() )
m_isAuthenticated = true;
emit authOver();
......
......@@ -25,7 +25,7 @@
#include <QObject>
#define LOGIN_URL "https://www.google.com/youtube/accounts/ClientLogin"
#define LOGIN_URL "https://www.google.com/accounts/ClientLogin"
class QByteArray;
class QNetworkAccessManager;
......@@ -46,7 +46,6 @@ class YouTubeAuthenticator : public QObject
bool isAuthenticated();
const QString& getAuthString();
const QString& getNick();
void setServiceProvider( YouTubeService* service );
void setCredentials( const QString& username, const QString& password );
......@@ -70,7 +69,6 @@ class YouTubeAuthenticator : public QObject
/* Youtube tokens */
QString m_authString;
QString m_nick;
bool m_isAuthenticated;
QString m_authError;
......
......@@ -85,7 +85,7 @@ YouTubeUploader::uploadInit()
" <media:description type='plain'>%2</media:description>\r\n" // 2 description
" <media:category scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>%3\r\n" // 3 category
" </media:category>\r\n"
" <media:keywords>%4</media:keywords>\r\n%5" // 4 key words, 5 private video // 5 isPrivate
" <media:keywords>%4</media:keywords>\r\n%5" // 4 key words, 5 private video
" </media:group>\r\n"
"</entry>\r\n";
......@@ -136,6 +136,7 @@ YouTubeUploader::uploadFinished()
QNetworkReply *reply = static_cast<QNetworkReply *>( sender() );
const QByteArray data = reply->readAll();
qDebug() << "In YouTubeUploader::uploadFinished: data received = " << data;
m_service->m_state = UploadFinish;
/* Feed parser called to parse the XML data received */
......@@ -205,7 +206,7 @@ YouTubeUploader::getMimeHead()
data.append( "Content-Type: application/atom+xml; charset=UTF-8\r\n\r\n" );
data.append( API_XML_REQUEST );
data.append( "--" + m_boundary + "\r\n" );
data.append( "Content-Type: video/*\r\nContent-Transfer-Encoding: binary\r\n\r\n" );
data.append( "Content-Type: application/octet-stream\r\nContent-Transfer-Encoding: binary\r\n\r\n" );
return data;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment