This is a simple example script to extract members from a youtube channel
- A valid gmail account
- An youtube channel owned by the gmail account above
- Your gmail account need to be allowed to consume members api (details: https://developers.google.com/youtube/v3/docs/members/list?authuser=0)
Note: The members.list method replaced the sponsors.list method as of March 31, 2020. This method can only be used with prior approval from YouTube. Please complete this form if your application needs to use this method.
pip install -r requirements.txt
This steps are following this doc: https://developers.google.com/youtube/v3/guides/auth/installed-apps
- Go to google developers console https://console.developers.google.com/
- Click on Credentials
- Click on Create credetials
- Choose Oauth client ID
- Choose application type as 'Desktop App'
- Fill the name as you prefer on 'Name input'
- Click on 'Create'
- In Oauth2 Cliend IDS you must see your client and a button to download a json file that contains your authentication details
- Save your credetials file in the same folder as list-members.py script
1 - Jsut run informing your secrets file name
python list-members.py -f yoursecrets.json -o mymembersfile
2 - The terminal will ask you to open an url in your browser, just copy it and call using your prefered browser 3 - You must login with your valid google account 4 - After login, a concent screen will tell you what this token is trying to access ( your youtube channel details and members) 5 - After accept the terms, you will receive a code, just copy it, paste into terminal and press Enter 6 - If everything works you will see the token printed in the terminal 7 - If everything works two files will appear with name you defined on the startup of this script ( csv and json)
questions? mailme: devel.andrerocha@gmail.com