jonnekaunisto / simple-youtube-api

Object-oriented Wrapper for Youtube API in Python
https://simple-youtube-api.rtfd.io
Other
74 stars 16 forks source link

Video id not set (AttributeError: 'LocalVideo' object has no attribute 'id') #24

Open sumeshshetty opened 4 years ago

sumeshshetty commented 4 years ago

I an using AWS lambda to upload video to youtube,by saving the video in /tmp directory and the uploading via simple-youtube-api. The video is published by code throws an error: AttributeError: 'LocalVideo' object has no attribute 'id' please help me here Screenshot 2020-09-16 at 1 57 24 PM

jonnekaunisto commented 3 years ago

Seems that there's a bug if you upload a video and set it to be in a playlist. I will fix that. For now though you might want to call the channel.add_video_to_playlist instead of doing it through LocalVideo

sumeshshetty commented 3 years ago

Hi I added the channel.add_video_to_playlist to script and it worked.But now during authentication process,after I click allow it lands me on Safari cannot connect to server.Below are screen shots of issue.Also in Google developer console there is a message displayed as "We are currently experiencing service disruptions and are unable to provide quota information at this time." in the consent screen.Is this something to do with the connection part.Please help.

Screenshot 2020-09-21 at 3 55 14 PM

Screenshot 2020-09-21 at 11 45 50 AM Screenshot 2020-09-21 at 11 46 18 AM

jonnekaunisto commented 3 years ago

I am assuming you're still running on Lambda. The first time you login to the channel, you will go through the login workflow, which you were going through. The login requires a it to be ran locally, hence why you see the address is localhost:8080. The workflow when completed will save the credentials to the credentials storage_path.

If you're still using lambda, I would recommend you to get the credentials on your computer and then uploading them to lambda.

If that is not an option you can also try doing the login without the local option. This is done by setting sys.arg[0] = "--noauth_local_webserver".

sumeshshetty commented 3 years ago

HI @jonnekaunisto I tried to run the code locally to generate the credentials file,but it again got the same error of "safari cannot connect to server".I dont know what is happening wrong as initially it worked fine but now the authentication part is not working.Please help.

jonnekaunisto commented 3 years ago

Did you try doing this: sys.arg[0] = "--noauth_local_webserver"?

jonnekaunisto commented 3 years ago

I've added an option to set the auth to not use local auth server here: https://github.com/jonnekaunisto/simple-youtube-api/blob/master/simple_youtube_api/channel.py#L70

It's not in the new version yet, but I will create a new release soon