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

Error opening client_secrets.json #7

Open
allthepreaching opened this issue Oct 16, 2021 · 2 comments
Open

Error opening client_secrets.json #7

allthepreaching opened this issue Oct 16, 2021 · 2 comments

Comments

@allthepreaching
Copy link

Please see example below. Is there a specific location the json file needs to be in? Currently it is in my downloads folder. Please let me know what I can do to get this to work. Thank you so much for creating this!

C:\Users\HP>channel_to_playlist --secrets client_secrets.json https://www.youtube.com/c/BlessedHopeBaptistChurchSydney/videos https://www.youtube.com/playlist?list=PLaEnjcaR3I7fOtDggi2NiqrgW1S2vT-Ap

The client secrets were invalid:

('Error opening file', 'client_secrets.json', 'No such file or directory', 2)

Missing client_secrets.json file.

Download from https://console.developers.google.com/project/YOUR_PROJECT_ID/apiui/credential.

@allthepreaching
Copy link
Author

OK I got everything figured out and working. But now I get KeyError: 'items'.
See info below:

C:\Users\HP\Documents>channel_to_playlist --noauth_local_webserver --logging_level INFO --secrets client_secrets.json https://www.youtube.com/c/BlessedHopeBaptistChurchSydney https://www.youtube.com/playlist?list=PLaEnjcaR3I7fOtDggi2NiqrgW1S2vT-Ap
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python310\Scripts\channel_to_playlist-script.py", line 33, in
sys.exit(load_entry_point('YouTubeChannelToPlaylist==3.0.0', 'console_scripts', 'channel_to_playlist')())
File "C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\site-packages\channel_to_playlist.py", line 166, in main
channel_playlist_id = get_channel_upload_playlist_id(
File "C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\site-packages\channel_to_playlist.py", line 53, in get_channel_upload_playlist_id
return channel_response["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
KeyError: 'items'

Any help is greatly appreciated!

@RobbieClarken
Copy link
Owner

RobbieClarken commented May 19, 2024

Hi @allthepreaching , when invoking you need to supply the channel id and and playlist id, not the urls:

channel_to_playlist --secrets client_secrets.json UCq_kzFkt5tAqtP94MgT3SUw PLaEnjcaR3I7fOtDggi2NiqrgW1S2vT-Ap

It would be a nice feature to support the user supplying the channel/playlist urls instead of ids. If I ever get time I might add this.

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

2 participants