| 132 | |
| 133 | |
| 134 | def get_libraries_table(): |
| 135 | # Get the data on the Tautulli libraries table. |
| 136 | payload = {'apikey': TAUTULLI_APIKEY, |
| 137 | 'cmd': 'get_libraries_table'} |
| 138 | |
| 139 | try: |
| 140 | r = requests.get(TAUTULLI_URL.rstrip('/') + '/api/v2', params=payload) |
| 141 | response = r.json() |
| 142 | |
| 143 | res_data = response['response']['data']['data'] |
| 144 | return [d['section_id'] for d in res_data if d['section_name'] in LIBRARY_NAMES] |
| 145 | |
| 146 | except Exception as e: |
| 147 | sys.stderr.write("Tautulli API 'get_libraries_table' request failed: {0}.".format(e)) |
| 148 | |
| 149 | |
| 150 | show_lst = [] |