It would be greatly appreciated if you could point me in the right direction here.

I'm getting the 'YouTube uploads currently unavailable' on admin pages.

The specific error in the logs is 'Authentication error for YouTube Account'

I've attached screenshots showing my setup on Youtube and in the Drupal.

Anyone who has experience or sees my obvious error .. let me know.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhedstrom’s picture

Hey Drutube,

I would suggest browsing to admin/reports/status.

The module has quite few tests built for hook_requirements, and this may narrow down where the issue is. Also, I don't see anything obviously wrong with your youtube account setup.

-Jonathan

armand0’s picture

If you login in Youtube through of google. Anything works. You have to register directly.
I had a registration in YouTube for google and I could never make work the apis. I had to eliminate that account and to create a directly in YouTube and already everything worked.

Care. When delete your account you lose your user name because YouTube doesn't liberate your user when you eliminate your account created by Google.

Google and YouTube are not synchronized. It is a dirt.

drutube’s picture

I don't think I understand that last post. Are you saying that you must get rid of your Gmail / Google account in order to make this work? What does that do ? One must still recreate a deverloper account with Google - not Youtube -- am I right? I need some help with this if it is in fact the case.

drutube’s picture

Also John the status report url is 'admin/logs/status' in D5 . Nothing related to Video Upload is showing up so I assume this is good.

jhedstrom’s picture

Hey Drutube, I didn't understand #3 either...but you're right, you will need a developer accont, which is managed through Google at this point. Also, in theory, if nothing shows in the status report, everything should be good. In another post you mentioned some watchdog errors (#272235):

*YouTube Connection failed with Expected response code 200, got 403
*Authentication to YouTube succeeded, but failed to generate a token

Are you still getting those?

jhedstrom’s picture

FileSize
30.79 KB
34.04 KB

Also, your images of the youtube account settings page are quite different from what I see (see attached) when I go to http://code.google.com/apis/youtube/dashboard/

drutube’s picture

Okay here is what I've found regarding the accounts. armand0 is right. It has to do with how you setup the account. Its also somewhat arbitrary in how Google will authenticate these Youtube client logins as opposed to auth-sub.

This is the relevant passage in their docs.

To make an authenticated API request using ClientLogin, you must identify the YouTube user account associated with the request. You must also use YouTube's ClientLogin system for single-user authentication. You will provide the username and password for the user's YouTube user account, verifying that the user is authorized to perform operations associated with that account. The authenticated actions will then be associated with that account. Please note that the following instructions vary slightly from the standard ClientLogin instructions.

So I created a youtube account for one sites and it worked find. Other sites did not. Its a long story but all other variables were the same. I considered that it was the way the username and password were being passed to Youtube because the logs kept saying this

Authentication to YouTube succeeded, but failed to generate a token

So I created a username on youtube by clicking the (slightly hidden) link that says 'sign in with your google account'. If you are already signed in to google you are then taken to a screen to create a youtube id IF THERE IS NOT ALREADY a youtube id associated with the google account.

I did that.

Then I tried to use one of the developer keys associated with the site. That didn't work. I created a new product and got a new developer key.. That worked.

So the conclusion is this. If you create a separate youtube account - not associated with your google developer account -- then it should work. BUT IT DOESNT. I think they will fix this but until then you can do the above and get your app working..

This is purley a Google issue and nothing to do with the Drupal module or code.

jhedstrom’s picture

Thanks Drutube,

I'm going to add that to the documentation page when I get a chance. Glad you got it to work.

armand0’s picture

Then, Does The Video Upload module work or is it necessary to hope google fixes its synchronized API between google and youtube?

jhedstrom’s picture

The module can definitely be made to work with the current state of the API. The key points are:

1) The process for obtaining a developer key must be done through Google (http://code.google.com/apis/youtube/dashboard/)

2) The YouTube account (on all the installs I've tested) has been a completely separate account from the developer key. I don't think this matters either way, but the point is that I didn't do anything special within the YouTube account settings in order to get the API to work.

drutube’s picture

You're not going to believe this. I got this email from Google about 2 minutes ago. I'm more confused by this attempt by Google to clarify than I was before. Either way it seems this was their bad...

It was titled

YouTube API: "Invalid developer key" error

Hi YouTube API Developer,

You are receiving this email because you registered a Product and obtained a YouTube API developer key in the last five days (June 18 to June 20, 2008.)

It has come to our attention that some of the developer keys generated during this period are not functioning properly. We have since resolved the issue, but you may notice that your key still results in a "Invalid developer key" response when used.

If you have generated a developer key in the last three days and are seeing this message, please generate a new developer key by deleting all of your Products and re-registering:

1. Log in to your YouTube API developer dashboard. (http://code.google.com/apis/youtube/dashboard/)
2. Click on the name of your Product link in the Product Name column.
3. Click the "Remove Product" button on the following screen.
4. If necessary, repeat for all products you've registered.
5. Register your product again, and a new key will be generated.

We apologize for any inconvenience this may have caused. If you're still having trouble, or if you have any other questions, visit us over at the developer forum. (http://groups.google.com/group/youtube-api)

The YouTube API Team

wilgrace’s picture

I'm coming up against the same issues - when creating new content:
"Video uploads currently unavailable. If this problem persists, contact the system administrator."

In Logs:
"YouTube Connection failed with Expected response code 200, got 400"
and
"Authentication to YouTube succeeded, but failed to generate a token"

- I have a Developer code from my main Google account, with the product website set to the right URL.
- The YouTube account is separate (different username/password) but linked to the Google account via the Google code settings (and youtube account setting) as per instructions above.
- The Zend library is working fine, as I can see the existing videos on my YouTube account.

Is this another issue on the Google side? It sounds like the same problem as DruTube was getting, but despite however many times I create new youtube accounts, link and unlink them to Google, create and delete Products - I just can't get it work.

Any help would be massively appreciated

btw - have you seen http://drupal.org/project/youtube_api

jhedstrom’s picture

That does sound like a Google/Youtube issue, although I have yet to experience it, so it's difficult for me to say for sure.

The long-term plans for this module are to ditch the Zend library and use the YouTube API module you mentioned above. This should simplify the code quite a bit, making the debugging of this sort of issue more straightforward.

I should also reitterate that I never touched any of the settings on the YouTube account...it is just a vanilla enter-email-and-password account...it could be that the YouTube API still has bugs interacting with the account once they try to factor in some of the more specialized settings...

wilgrace’s picture

I set up a new youtube account for this, same as yourself. The one thing I did do was link it to my google account - I figured this would be needed in order to associate the Developer Key with it. Did you not do that?

May be worth setting up another, non-linked youtube account and see if that works.

jhedstrom’s picture

re: #14

Yeah I never bothered to link the accounts...that's where I'm thinking there may be unresolved yt api issues. In theory, no linking is necessary, because the API can also be used to act as a gateway--meaning 1 developer key and many different yt accounts.

drutube’s picture

FileSize
12.18 KB

Hey Will,

I got your message and I'll try to provide more detail tomorrow when it isn't so late and I can think. The upshot is this:

If you follow these steps it should work and I'll explain my theories (I have no actual idea but pretty decent guesses) tomorrow.

1. Sign out of all your google account stuff.
2. setup an entirely new Gmail account.
3. Sign up for a Youtube API developer key ect using that account.
4. THIS ONE IS KEY. Now go to youtube and get an entirely new account by using the hidden button that says something (I detailed above) like 'sign in using your Google ID. In other words do not create a new youtube username untill you are asked to AFTER using the sign up method illustrated in the attached image.
5. Now go back to your developer account and create a product and answer the questions ect. about the application url.
6 fill in the key , Youtube username and password in the settings of John's module.
7 ALSO IMPORTANT -- wait about 12 to 24 hours. Now try the module.

Hope this works for you. I recognize this is NOT what should be occuring or required but it is what works.
John B.

wilgrace’s picture

Great stuff, thanks Jon - I've been through the steps and still no go, but will give it 24 hours to see if anything happens and get back to you.

One thing though - if you use your (new) google account to set up a youtube account, then every time you log in to youtube you continue to use your google details. That's not a problem, but in this case what details go into the Video Upload Settings?

- Developer Key = Google account developer key, no problem

- Youtube Username = The youtube username (not used to login with) OR the google username (used to log in to youtube)???

- YouTube Password = This must be the google password, since using the steps above you never set up a seperate youtube password, only using google.

Apart from that the light at the end of the tunnel seems to be getting brighter.

thanks mate

wilgrace’s picture

Update:
The only way I could get authentication working is by using my new google email address and google password in YT Username & YT Password - this brings up the videos on that youtube account.

Still getting the same error messages though - am hoping the 24 hours will bring me joy

wilgrace’s picture

Argh, I still can't get this to work.

I've tried different Google accounts with different Developer Keys, different projects, URLs (does it matter what URL you put into Developer details or project details?) and it's all coming out with the same error messags in watchdog (authentication succeeds, no token and youtube connection failed with Expected response code 200, got 400).

Possible reasons:
- I'm in the UK, youtube only supports US
- PHP register globals are enabled - I can't seem to turn it off, but I don't think this is it
- It's a problem on the google side
- URLs are wrong

If anyone who has got a working Key and Youtube account could possibly test their details on my blank install, just to see whether it's a problem with the setup or my accounts, I'd be really grateful. I can email url and login details.

Looking back over threads this seems to be the biggest stumbling block for people, but others are succeeding so I'm clinging on to that hope for now.

Firetracker’s picture

Hi,

I having the same problems as above.

Having registered a youtube account through google, should my details be:

* Dev Key
* Google E-mail Address?
* Google Password?

Entering these make authentication fail. Are these correct????

Having registered a standard account with:

* Dev Key
* Youtube username
* Youtube password

Authentication passes but I get the "YouTube Connection failed with Expected response code 200, got 400" / "Authentication to YouTube succeeded, but failed to generate a token" errors.

I'm completely stumped.

Any help would greatly appreciated.

Cheers
Zap

ldway’s picture

Hope someone comes up with the answer to the proper way to make all this work with youtube. This is a great module and I would love to use it but not until someone can provide a step-by-step for getting this to work with youtube. :)

giorgio79’s picture

I am getting "Authentication error for YouTube Account" as well.

I noticed the module does not ask for the Client ID from the product setup page, only the YouTube API key. dont we need the Client ID as well?

I also logged in with my Google account...

Also, I notice there is an "Authorized Sites" page on my YouTube account page, but it seems there is no add site button, could this be it as well?

jhedstrom’s picture

To test if there have been api changes, I just did the following this morning, and the module still works fine:

1) Create an account on youtube.com, consisting of username and password. I didn't do any additional configuration of the youtube account. Just confirmed my email address.

2) Went to http://code.google.com/apis/youtube/dashboard/ and registered for a developer key.

3) Entered the youtube username/password into the video upload settings page, and the developer key from step 2.

After finishing these 3 steps, I was able to upload videos, so I don't think there have been any fundamental API changes.

For people that are still getting authentication errors, any additional details you can provide about your setup may help track the issue down.

giorgio79’s picture

Hi,

I will go ahead and try now your steps.

The only difference from your steps was in step 1, where I did not create a YouTube account but used a google account to sign in to YouTube.

I was under the impression I would not be able to login to Google with a YouTube account only.

Will be interesting to see the result.

Cheers,
G

giorgio79’s picture

Thanks Jonathan, it works!

I created a new account on YouTube, and used a google email address to signup.

It works now!

giorgio79’s picture

Ok, meanwhile I also got it working with my google - youtube account.

You need to put your google account (full email address) as username on the settings page!!!!!

ldway’s picture

I also got it to work but have seen the following problems.

USING THE RELEASED VERSION FOR D5x:

Using the standard released version I found MANY error messages from the module. So I switched to the dev version and the most recent version of the API and MOST (But not all) the errors went away.

USING THE DEV version and most recent version of the API:

I got the module to actually work BUT the following errors are displayed:

1... Even when just adding the field to a new content type and after clicking the update button I get: "warning: Invalid argument supplied for foreach() in /var/mysite/modules/video_upload/video_upload.module on line 936." - This appears to have something to do with having a search form on the page? However, I removed the search form from displaying on any admin pages and that did not make a difference. still get the error displayed at the top of the page and it shows in the logs.

2... If I try and put multiple tokens in the Developer Tags field such as "[user],[uid]" I get the error displayed after clicking the update button for the changes to the field of: "Video uploads currently unavailable. If this problem persists, contact the system administrator." This also displays in the upload form and ALSO in the logs are written the following:

"Authentication to YouTube succeeded, but failed to generate a token"
"YouTube Connection failed with Expected response code 200, got 400"

If I put only one token in the Developer Tags field then no more error messages as described above. Seems to be a problem with the way tokens are being parsed.

4... Once a video is uploaded and all processing has completed, if you delete the node there is all sorts of error messages displayed on screen from the module. However the node is still deleted and actually deleted from YouTube. So while it does delete everything as expected, there is a lot of error messages being displayed from module problems. Here are the error messages displayed on screen...

* warning: Missing argument 3 for _video_upload_delete_video_remote(), called in /var/mysite/modules/video_upload/video_upload.module on line 1723 and defined in /var/mysite/modules/video_upload/video_upload.module on line 1649.
* warning: Missing argument 4 for _video_upload_delete_video_remote(), called in /var/mysite/modules/video_upload/video_upload.module on line 1723 and defined in /var/mysite/modules/video_upload/video_upload.module on line 1649.

Those are my results so far.

-- Dave

DevRock’s picture

I'm having the same issue as many others here. I'm getting the "Authentication to YouTube succeeded, but failed to generate a token" What's weird is that it doesn't seem to be a constant issue. I was able to upload a video just fine but all of the sudden I'm getting this error. It went away for a few mins but now seems to be back and not going away. No idea what's causing it.

bitshift’s picture

Im trying to get this module to work, but having problems also. Ive created a youtube account and a google account, and I entered
my developer key
youtube username
youtube password

but everytime i check admin/logs/status I get errors about
Video Upload: YouTube Authentication Failed
The Video Upload module has the required information, but was unable to authenticate to YouTube. There may be an error in one or more of the following:

* username
* password
* developer key

bitshift’s picture

Scratch that, I looked a little closer at the log messages, and I just had to enable ssl with my php settings. Doh!

curtisdf’s picture

Version: 5.x-1.x-dev » 5.x-1.0-beta1

Hi jhedstrom,

I'm a little confused by "2) Went to http://code.google.com/apis/youtube/dashboard/ and registered for a developer key." A login is required in order to do that. What login did you use? Your instructions imply that after doing step 1, you were already logged in when you visited http://code.google.com/apis/youtube/dashboard/ . But where did this login come from? Did you create a totally new Google account after step 1?

I've tried all of the sets of instructions people have offered on this page, as of the date and time of posting this message, but nothing is working for me. :-(

Thanks,
Curtis

jhedstrom’s picture

re: curtisdf

You're right, those steps are confusing. I've been using the same credentials to log in on the dashboard page as I have for the youtube account, and things just seem to work. For some of the tests I've done, the credentials have been a gmail account, so I haven't needed to create an account. However, when using a non-gmail account, I've created a separate account for the dashboard page.

curtisdf’s picture

Hi giorgio79,

When you say you used a "google email address" to sign up, do you mean you first created a YouTube account, and then made a new Google account using a Gmail address? Or... you signed up for a new YouTube account and entered the same email address as one of your existing Google accounts? Methinks you meant the latter.

Still not having success... the best I've been able to do is to get the video_upload module to authenticate with YouTube, but I'm still stuck with that notorious token error. :-(

Thanks,
Curtis

curtisdf’s picture

Hi jhedstrom,

Thanks for the lightning-fast reply, and for the clarification. I created a new YouTube account with a (non-Gmail) email address that I've never used with YouTube or Google before. I then created a new Google account based on that same email address, and used this account to create a developer key. I then entered the developer key and the YouTube login info into the video_uploads settings page. Just as before, it authenticated okay, but could not create a token (whatever that means....)

After this, just for kicks, I entered the Google account login info into the video_uploads settings page instead. This time, it would not even authenticate.

Still stumped... I'm using the 5.x-1.0-beta1 version of video_uploads with Drupal 5.7, if that helps.

-Curtis

bitshift’s picture

Just curious, but is there any way to use a single youtube account, yet allow per-user uploads ? What I need is the ability for each user to possibly upload a file with the same name and extension. Currently, I have photo albums (Gallerix) for users of a specific role. They also need the ability to upload videos as part of a node. So, I think I need to find an alternative to this module.

jhedstrom’s picture

Just curious, but is there any way to use a single youtube account, yet allow per-user uploads ?
...
They also need the ability to upload videos as part of a node

That's exactly what this module does.

bitshift’s picture

Yes, but what if two (or two dozen) users each try to upload "my dog.avi", wont they get filename conflicts ? Is there a way to create an "album" within the account for each user which would possibly solve this issue ? Also, what happens if at some point the user wants to delete all of their content - what will trigger the deletion of the video content from youtube ?

watbe’s picture

I have this problem as well... this module seems most promising, but after looking around and following the advice, I still cannot get the video uploads working...

just wondering, could it have something to do with the server configuration?

I get exactly the same errors, YouTube authenticates correctly, but there is a token error....

watbe’s picture

Can someone upload/write some complete instructions that detail everything from installing and enabling this module to entering details?

We could have missed something along the way maybe?

I really want to get this module working, it seems like a godsend for me :P

Cheers!

pabloparnisari’s picture

Hi:

Up to now I found same errors ("YouTube Connection failed with Expected response code 200, got 400" and "Authentication to YouTube succeeded, but failed to generate a token") that were described in this issue and I can't fix them yet.

I try all suggestions about google and youtube accounts, even one option provided by Youtube to link (and after unlink) both accounts.

From Youtube interface all looks ok and recognize both accounts like the same because no matter which use to log-in (in youtube interface), once the user´s menu appear my YouTube userid instead my Google´s account.

So, I´ve a couple of new questions about these problems with aim to fix them:

- When I create the product in Googles Api interface the URL entered must be "exact" the same of the site where I´m working? I mean: must use "www." or just the domain name ?
- Rigth now I´m working in my dev PC which is firewalled behind a linksys router. It could be cause of some problems?

Thanks!

redindian’s picture

just use "yourname@gmail.com" when logging in - it will solve the Authentication error problem

drupmike’s picture

hello,
does this module requires ssl to be enabled ?

jhedstrom’s picture

Status: Active » Closed (fixed)

@drupmike
You need the PHP ssl libraries installed #275272: line 171? unknown error

@all
I'm closing this thread, as the original poster's issue is resolved. Please open new threads for any on-going issues.

neubreed’s picture

Version: 5.x-1.0-beta1 » 5.x-1.x-dev

No, I already have SSL enabled and still get the 403 error in my logs I'm afraid

EloRo’s picture

Version: 5.x-1.x-dev » 6.x-1.2
Status: Closed (fixed) » Active

First my appreciations, I think this module brings a really useful sollution for videosites, however:

Can anyone please tell me what the exact order of steps is that should be taken for a valid developerkey and login for YouTube?

I tried both ways:
- First create Google account, generate developerkey and then sign up for YouTube trough the Google account
- First register on YouTube then with the same info login to Google and then generate the developerkey

I still get the error "YouTube uploads currently unavailable" (and in statusreport "Video Upload: YouTube Authentication") and I'm a little confused by all posts done above.

NicoDruif’s picture

For me #41 solved the authentication problem: just use your e-mailaddress (on the video upload settings page) to login to your youtube account