sonecabr / youtube-members-script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Youtube members list script

This is a simple example script to extract members from a youtube channel

Dependencies:

  • 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.

Preparing

Install pip deps

pip install -r requirements.txt

Prepare your account

  • 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

Running

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

About


Languages

Language:Python 100.0%