RobbieClarken / youtube-channel-to-playlist

Add all videos from a YouTube channel to a playlist
MIT License
30 stars 3 forks source link

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

Open omega8fattyacid opened 5 years ago

omega8fattyacid commented 5 years ago

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 commented 5 years ago

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.

MistressPlague commented 2 years ago

No longer works? chrome_eWEvn32abw