File tree Expand file tree Collapse file tree
PyPortal/PyPortal_Youtube Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010Requires a youtube API key!
1111"""
12+ import os
1213import time
1314import board
1415from adafruit_pyportal import PyPortal
1516
16- # Get wifi details and more from a secrets.py file
17- try :
18- from secrets import secrets
19- except ImportError :
20- print ("WiFi secrets are kept in secrets.py, please add them there!" )
21- raise
22-
2317# Set up where we'll be fetching data from
2418CHANNEL_ID = "UCpOlOeQjj7EsVnDh3zuCgsA" # this isn't a secret but you have to look it up
2519#CHANNEL_ID = "UC6p-tjZN8s9GBSbiN4K-bwg"
2620CAPTION = "www.youtube.com/adafruit"
2721#CAPTION = "www.youtube.com/c/JohnParkMakes"
2822
2923# pylint: disable=line-too-long
30- DATA_SOURCE = "https://www.googleapis.com/youtube/v3/channels/?part=statistics&id=" + CHANNEL_ID + "&key=" + secrets [ 'youtube_token' ]
24+ DATA_SOURCE = "https://www.googleapis.com/youtube/v3/channels/?part=statistics&id=" + CHANNEL_ID + "&key=" + os . getenv ( "YOUTUBE_TOKEN" )
3125DATA_LOCATION1 = ["items" , 0 , "statistics" , "viewCount" ]
3226DATA_LOCATION2 = ["items" , 0 , "statistics" , "subscriberCount" ]
3327# pylint: enable=line-too-long
You can’t perform that action at this time.
0 commit comments