python - Youtube V3 API new subscription videos script -


so new programming , need use youtube v3 new subscription videos of user. after research found out it's not possible directly - there no 1 api call gives it. found third party solution online having trouble implementing it. here solution : https://github.com/ali1234/ytsubs . have put in youtube_server_api_key , developer notes

 # youtube_server_api_key="<your_secret_key>" ./ytsubs.py <username> <output rss file>  baseurl = 'https://www.googleapis.com/youtube/v3'  my_key = os.environ.get('youtube_server_api_key')  # check missing inputs  if not my_key:     print "youtube_server_api_key variable missing."     sys.exit(-1) 

i tried adding key in different formats keep getting variable missing error. think it's because not familiar python , it's environment variable. format should put in? tried:

my_key = os.environ.get('secret_key' + ' ./views.py username output.rss') my_key = os.environ.get('secret_key' , ' ./views.py username output.rss') my_key = os.environ.get('secret_key ./views.py' + ' username output.rss') 

and many other formats give missing key error. using v3 api on google app engine.

i tried well:

os.environ['youtube_server_api_key'] = "secret_key", "username", "hi.rss"; my_key = os.environ.get('youtube_server_api_key'); 

and : sys.argv len not >2 error

if using linux

in terminal

export 'youtube_server_api_key'=yourkey 

and run python script.

if windows check link , add new variable name='youtube_server_api_key' , value=yourkey.

if want on fly in python script then

os.environ['youtube_server_api_key'] = "yourkey" 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -