1.1.0 Updated! Added Live TV!

This commit is contained in:
UrloMythus
2024-09-02 16:25:57 +02:00 Unverified
parent e5e54d0d93
commit 1d392b0cb8
24 changed files with 2028 additions and 405 deletions
+14
View File
@@ -0,0 +1,14 @@
from Src.Utilities.loadenv import load_env
env_vars = load_env()
TMDB_KEY = env_vars.get('TMDB_KEY')
async def get_TMDb_id_from_IMDb_id(imdb_id,client):
response = await client.get(f'https://api.themoviedb.org/3/find/{imdb_id}',
params={'external_source': 'imdb_id', 'api_key': f'{TMDB_KEY}'})
tmbda = response.json()
if tmbda['movie_results']:
return tmbda['movie_results'][0]['id']
elif tmbda['tv_results']:
return tmbda['tv_results'][0]['id']
else:
return None