MCPcopy
hub / github.com/blacktwin/JBOPS / get_metadata

Function get_metadata

reporting/added_to_plex.py:98–114  ·  view source on GitHub ↗
(rating_key)

Source from the content-addressed store, hash-verified

96
97
98def get_metadata(rating_key):
99 # Get the metadata for a media item.
100 payload = {'apikey': TAUTULLI_APIKEY,
101 'rating_key': rating_key,
102 'cmd': 'get_metadata',
103 'media_info': True}
104
105 try:
106 r = requests.get(TAUTULLI_URL.rstrip('/') + '/api/v2', params=payload)
107 response = r.json()
108
109 res_data = response['response']['data']
110 if STARTFRAME <= int(res_data['added_at']) <= ENDFRAME:
111 return METAINFO(data=res_data)
112
113 except Exception as e:
114 sys.stderr.write("Tautulli API 'get_metadata' request failed: {0}.".format(e))
115
116
117def update_library_media_info(section_id):

Callers 1

added_to_plex.pyFile · 0.70

Calls 1

METAINFOClass · 0.70

Tested by

no test coverage detected