badershs / youtube-upload

Automatically exported from code.google.com/p/youtube-upload
0 stars 0 forks source link

Bad Authentication (error 403) #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
= Versions

youtube-upload: 0.7.3
python-gdata: latest

= Describe the steps (including the command you run) that will reproduce
the problem?

Like many users I am facing same kind of login error and authentication problems

youtube-upload -m admin@abc.net -p xyz123
Login to Youtube API: email='admin@ps4iso.net', password='*********'
[BadAuthentication] Authentication failed

youtube-upload --email=admin@ab.net --password=xyz123
File "/usr/bin/youtube-upload", line 519, in <module>
    sys.exit(catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
  File "/usr/bin/youtube-upload", line 111, in catch_exceptions
    fun(*args, **kwargs)
  File "/usr/bin/youtube-upload", line 516, in main
    run_main(parser, options, args)
  File "/usr/bin/youtube-upload", line 412, in run_main
    captcha_response=options.captcha_response)
  File "/usr/bin/youtube-upload", line 192, in login
    self.service.ProgrammaticLogin(captcha_token, captcha_response)
  File "/usr/lib/python2.6/site-packages/gdata/service.py", line 797, in ProgrammaticLogin
    raise Error, 'Server responded with a 403 code'
gdata.service.Error: Server responded with a 403 code

I have removed other parameters just to make it more readable above but my 
actual command had complete parameters ofc

This is a youtube account I made today itself (as I am using a new site mail 
hosted by google apps), I donot use 2 step authentication, and donot see any 
unlink/disconnect google plus links in my youtube settings

Please help me, youtube-upload is one of my favorite tools I like to use in my 
API for all my youtube needs.

Original issue reported on code.google.com by ad...@ps4iso.net on 29 Sep 2013 at 5:35

GoogleCodeExporter commented 9 years ago
> This is a youtube account I made today itself

Try to upload a video manually first (if already logged in)

Original comment by tokland on 29 Sep 2013 at 5:39

GoogleCodeExporter commented 9 years ago
Manual works, I tried using the php zend uploader and that works aswell
(http://framework.zend.com/manual/1.12/en/zend.gdata.youtube.html)

Original comment by ad...@ps4iso.net on 29 Sep 2013 at 6:50

GoogleCodeExporter commented 9 years ago
I just checked and I can upload videos, so it must be related with that 
particular account (probably being a new account. Have you checked all related 
tickets?

http://code.google.com/p/youtube-upload/issues/list?can=1&q=403&colspec=ID+Type+
Status+Priority+Milestone+Owner+Summary+Reporter+Stars&cells=tiles

Original comment by tokland on 29 Sep 2013 at 7:00

GoogleCodeExporter commented 9 years ago
Yeah I checked all tickets and all posted solutions, that why I even mentioned 
about google plus thing in main post
Also, I even made a new gmail.com account and tried using it, didnt worked.
Can you give me the full command line you are using (ofc w/o real userid and 
pass) and maybe try with making a new gmail/youtube acc ? I think there have 
been some new changes since we cant seem to remove google plus profile anymore

Original comment by ad...@ps4iso.net on 29 Sep 2013 at 7:45

GoogleCodeExporter commented 9 years ago
I run:

$ youtube-upload --email=toklandisland@gmail.com --password=PASS 
--category=Film --title "Title" --description="Description" 4.mp4

Anyway, I created a new account to reproduce your problem. First, it didn't 
work:

$ youtube-upload --email=toklandisland@gmail.com --password=PASS 
--category=Film --title "Title" --description="Description" 4.mp4
gdata.youtube.service.YouTubeError: {'status': 401, 'body': 
'<HTML>\n<HEAD>\n<TITLE>NoLinkedYouTubeAccount</TITLE>\n</HEAD>\n<BODY 
BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>NoLinkedYouTubeAccount</H1>\n<H2>Error 
401</H2>\n</BODY>\n</HTML>\n', 'reason': 'NoLinkedYouTubeAccount'}

So I went to youtube.com, clicked top-left on the email. Now it asks me if I 
want a channel, I say yes. Once I have the channel created:

$ youtube-upload --email=toklandisland@gmail.com --password=PASSWORD 
--category=Film --title "Title" --description="Description" 4.mp4 
Login to Youtube API: email='toklandisland@gmail.com', password='********'
Start upload using a HTTP post: 4.mp4
100% 
|###############################################################################
#############| Time: 0:00:11 108.97 kB/s
http://www.youtube.com/watch?v=Mspz3yjaERA

If this does not help please create some new account (and send the password to 
tokland AT gmail DOT Com) so I can check.

Original comment by tokland on 30 Sep 2013 at 10:38

GoogleCodeExporter commented 9 years ago
Okay here is a update, using my google apps hosted mail I still cannot upload 
(it has 3 channels, how do it even selects the default channel ?)

gdata.service.Error: Server responded with a 403 code

Then I tried using my new gmail.com mail acc that I created yesterday and it 
worked now (dunno why)
Install python-progressbar to see a nice progress bar
http://www.youtube.com/watch?v=q4lP7XBtnVk

If its due to channel, I tried deleting the channels but I cant seem to delete 
the page linked to it :/
So it wont work on my hosted mail ?

Original comment by ad...@ps4iso.net on 30 Sep 2013 at 11:49

GoogleCodeExporter commented 9 years ago
Nvm I have fixed it, cant believe it was right under my nose by I missed it.
What happened was, when you create a channel, it was ask for a personal name, 
but also gives you a option to use a brand name/product name, which is what I 
used all 2 times for my hosted mail since I wanted a username same as my 
website.
It created a new channel and permalinked a google page to my account while 
keeping my hosted mail channel-less

It must be what caused all these problems
What I did just now was created a new channel for my hosted mail and used the 
Personal Name option instead of buisness name, it created the channel just fine 
on personal name and now the script works.

Install python-progressbar to see a nice progress bar
http://www.youtube.com/watch?v=s--IdxKx4yE

And in advanced tab now I can even disable google page for this channel and 
revert username from personal name to my channel name

Damn this was a clusterfuck mess, I am not sure if anyone will end up in same 
situation as me ever, but if someone does, I have mentioned the whole scenario 
above to help you fix it within minutes

~Thanks tokland, I can continue to use your script in my API again

Original comment by ad...@ps4iso.net on 30 Sep 2013 at 11:58

GoogleCodeExporter commented 9 years ago
Ok, thanks for the detailed explanation, it'll help others with the same 
problem. 

Original comment by tokland on 30 Sep 2013 at 11:59

GoogleCodeExporter commented 9 years ago
Sadly it seems given the new comment system it will be required to change 
something here. Like many other people I want to keep my Google+ and my YouTube 
account seperated. Sadly YouTube introduced a new "improved comment system" 
which links Google+ and YouTube and as long as you want to comment on videos 
you necessarily require a Google+ page.

After I unlinked my Google+ page and my YouTube account I was able to upload 
videos using YouTube-upload again but once I create a Google+ page for my 
Channel I cannot upload - which seems to get a virtual e-mail adress like 
[youtube username]-[number]@pages.plusgoogle.com it's not possible to upload 
videos anymore. If I use my actual Google account, I get a 403 error as above - 
if I use that virtual e-mail address I can't log in as it seems there is no 
password assigned to this e-mail address.

Original comment by Lin...@gmail.com on 11 Nov 2013 at 5:39

GoogleCodeExporter commented 9 years ago
To test this I created a new gmail account. Then I made that a manager of my 
original channel and...I've no idea how as it also created a new channel for 
the gmail account...it seems to upload to the channel I want. I'll keep playing 
with it to see if I can figure out how it might work

Google! Such a mess.

Original comment by i...@makeshiftsounds.com on 28 Mar 2014 at 9:54

GoogleCodeExporter commented 9 years ago
Important: ClientLogin has been officially deprecated as of April 20, 2012. It 
will continue to work as per our deprecation policy, but we encourage you to 
migrate to OAuth 2.0 as soon as possible.

youtube-upload --email=lookupmygo@gmail.com --password=PASSWORD 
--description="H0r0r" --category=Entertainment --keywords="h0r0r" 
--title="Title Horor" make_Horor.mp4

and this is the error that i found nowadays, seems google have close the API atm

Login to Youtube API: email='lookupmygo@gmail.com', password='**********'
[BadAuthentication] Authentication failed

Original comment by Becak...@gmail.com on 13 May 2014 at 5:16

GoogleCodeExporter commented 9 years ago

Original comment by tokland on 13 May 2014 at 8:32

GoogleCodeExporter commented 9 years ago
It still works for me:

Login to Youtube API: email='tokland@gmail.com', password='************'
Start upload using a HTTP post: 4.mp4 -> 
https://uploads.gdata.youtube.com/action/FormDataUpload/AIwbFAQALB1zZISn-tOkuoJo
qMJQ21IX6S5kMx6_OWAmYrvkfHQqehaOYeTgyAyJssf6hrg5uEohf6zvu53SEd7pw9fMXQ3QIg
100% |#####################################################################| 
Time: 0:00:12 105.36 kB/s
http://www.youtube.com/watch?v=NNETp7XmUyI

Original comment by tokland on 13 May 2014 at 8:33

GoogleCodeExporter commented 9 years ago
Hi,
I had the same problem and I resolved.

You may move to 
https://www.google.com/settings/security

You should change: 
Access for less secure apps of Account permissions to "Enabled".

Then you can access.

I think you don't need this process if you use Google App Account instead of 
Google Account.

Hope this helps.

Original comment by xmaswond...@gmail.com on 12 Nov 2014 at 1:39

GoogleCodeExporter commented 9 years ago
God damit xmas I really thank you!
I created a few new Accounts and I got really desperate!

Thank You!

Original comment by den...@web.de on 17 Nov 2014 at 6:39

GoogleCodeExporter commented 9 years ago
Thank you!
It works fine!
Access for less secure apps of Account permissions to "Enabled".

Original comment by olahpis...@gmail.com on 24 Nov 2014 at 4:53

GoogleCodeExporter commented 9 years ago
why it still not work for me ?? i had change my account security. 

Original comment by dinarwah...@gmail.com on 23 Jan 2015 at 1:36

GoogleCodeExporter commented 9 years ago
#14 solved it for me.

Original comment by a...@meetai.com on 25 Feb 2015 at 3:04

GoogleCodeExporter commented 9 years ago
Hi!, I have many youtube channels (4 channels). Problem: i can do 
authentication under first channel, and uploading is doing, but I can`t do 
authentication under others 3 chanels. Please answers on my mail: luostary@bk.ru

Original comment by leoma...@gmail.com on 17 Jul 2015 at 9:46

GoogleCodeExporter commented 9 years ago
This project is abandoned, check https://github.com/tokland/youtube-upload

Original comment by tokland on 17 Jul 2015 at 9:49

GoogleCodeExporter commented 9 years ago
I do it. In Google account settings -> Sign-in & security -> Connected apps & 
sites -> Allow less secure apps. Need check it is ON.

Original comment by leoma...@gmail.com on 17 Jul 2015 at 10:26