Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserWarning: Cannot access .channel_to_playlist-oauth2-credentials.json #5

Open
omega8fattyacid opened this issue Aug 5, 2019 · 2 comments

Comments

@omega8fattyacid
Copy link

Ran in the user folder with the client_secrets.json file present:
channel_to_playlist --secrets client_secrets.json UCFJn-TnLSUNuEoQZu4hltkg PLsm4QqvQ2I-1TdRyCIpy9w10Cp7VG_qMD

Gave me this huge error about some missing file:

C:\Program Files\Python37\lib\site-packages\oauth2client_helpers.py:255: UserWarning: Cannot access .channel_to_playlist-oauth2-credentials.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
File "C:\Program Files\Python37\Scripts\channel_to_playlist-script.py", line 11, in
load_entry_point('YouTubeChannelToPlaylist==3.0.0', 'console_scripts', 'channel_to_playlist')()
File "C:\Program Files\Python37\lib\site-packages\channel_to_playlist.py", line 149, in main
youtube = get_authenticated_service(args)
File "C:\Program Files\Python37\lib\site-packages\channel_to_playlist.py", line 46, in get_authenticated_service
credentials = run_flow(flow, storage, args)
File "C:\Program Files\Python37\lib\site-packages\oauth2client_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Program Files\Python37\lib\site-packages\oauth2client\tools.py", line 195, in run_flow
logging.getLogger().setLevel(getattr(logging, flags.logging_level))
AttributeError: 'Namespace' object has no attribute 'logging_level'

@TomasPP
Copy link

TomasPP commented Aug 25, 2019

Yep, I got the same error about AttributeError: 'Namespace' object has no attribute 'logging_level'. I solved the problem with workaround:

Open Python37\lib\site-packages\channel_to_playlist.py.
At 140 line after '--before' param add two additional args
https://gist.github.com/TomasPP/cf299ec12074e7b8db18f913c6997324

Run with commandline
channel_to_playlist --noauth_local_webserver --logging_level INFO --secrets client_secrets.json UCgxzjK6GuOHVKR_08TT4hJQ PLlgnub_DBR_CszAWpJypwst0OFDxW6jOJ

On first run program will stop with message:
Go to the following link in your browser: https://accounts.google.com/o/oauth2/auth?client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Enter verification code:

Go to the page in Chrome browser. Select youtube account. You will get Chrome warning that the page is not secure. Ignore this and select to proceed to unsafe link. Confirm that you grant access to youtube account. Copy verification code to the program and proceed. Program starts working.

Do not know why this workaround is needed. Either my client_secrets.json file is wrong (have choosen "Other" appplication type in Google Cloud Console).
Or oauth2client lib has changed.

TomasPP added a commit to TomasPP/youtube-channel-to-playlist that referenced this issue Sep 1, 2019
TomasPP added a commit to TomasPP/youtube-channel-to-playlist that referenced this issue Sep 1, 2019
@MistressPlague
Copy link

No longer works?
chrome_eWEvn32abw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants