MCPcopy
hub / github.com/hellerve/programming-talks / load_youtube_api_key

Function load_youtube_api_key

scripts/add_youtube_durations.py:12–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10from urllib.parse import parse_qs
11
12def load_youtube_api_key():
13 try:
14 return open('youtube_api_key.txt', 'r').read().strip()
15 except:
16 print('Add a file called youtube_api.txt and insert a youtube API key.')
17 print('A youtube API key can be obtained at: https://console.developers.google.com.')
18 exit(1)
19
20def get_number_of_lines(file_name):
21 with open(file_name, 'r') as f:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected