diff --git a/config.json b/config.json index caa4f12..03c6179 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "StreamingCommunity": { "enabled": "1", "domain": "boston", - "fast_search": "1" + "fast_search": "0" }, "Filmpertutti": { "enabled": "0", @@ -15,7 +15,7 @@ "fast_search": "0" }, "Mysterius":{ - "enabled": "0" + "enabled": "1" } }, "General":{ diff --git a/convert.py b/convert.py index 7b7f3fd..b58f064 100644 --- a/convert.py +++ b/convert.py @@ -14,7 +14,6 @@ def get_TMDb_id_from_IMDb_id(imdb_id): if tmbda['movie_results']: return tmbda['movie_results'][0]['id'] elif tmbda['tv_results']: - print(tmbda['tv_results'][0]['id']) return tmbda['tv_results'][0]['id'] else: return None \ No newline at end of file diff --git a/info.py b/info.py index 8046748..3da1b42 100644 --- a/info.py +++ b/info.py @@ -26,7 +26,10 @@ def get_info_tmdb(tmbda,ismovie,type): elif type == "StreamingCommunity": if SC_FAST_SEARCH == "0": n_season = show.number_of_seasons - return showname,n_season + full_date = show.first_air_date + date = full_date.split("-")[0] + print(date) + return showname,date else: return showname elif type == "Tuttifilm": @@ -39,7 +42,7 @@ def get_info_tmdb(tmbda,ismovie,type): return showname elif type == "Cool": return showname - + elif ismovie == 1: movie = Movie() show= movie.details(tmbda) diff --git a/streamingcommunity.py b/streamingcommunity.py index 8b7ecb7..e33f625 100644 --- a/streamingcommunity.py +++ b/streamingcommunity.py @@ -8,6 +8,7 @@ from convert import get_TMDb_id_from_IMDb_id from info import get_info_tmdb, is_movie, get_info_imdb import config import json +import re #Get domain SC_DOMAIN= config.SC_DOMAIN SC_FAST_SEARCH = config.SC_FAST_SEARCH @@ -36,22 +37,44 @@ def get_version(): version = "65e52dcf34d64173542cd2dc6b8bb75b" return version -def search(query,n_season,ismovie): +def search(query,date,ismovie): #Do a request to get the ID of serie/move and it's slug in the URL response = requests.get(query).json() for item in response['data']: tid = item['id'] slug = item['slug'] - idk = item['seasons_count'] - if SC_FAST_SEARCH == "0": - if ismovie == 0: - seasons_count = item['seasons_count'] - if seasons_count == n_season: + type = item['type'] + if type == "tv": + type = 0 + elif type == "movie": + type = 1 + if type == ismovie: + #Added a Check to see if the result is what it is supposed to be + if SC_FAST_SEARCH == "0": + if ismovie == 0: + seasons_count = item['seasons_count'] + #Do not ask me why but somewhy streaming community call the first air date the last air date + first_air_date = item['last_air_date'] + if first_air_date: + first_air_year = first_air_date.split("-")[0] + if first_air_year == date: + return tid,slug + else: + response = requests.get ( f'https://streamingcommunity.boston/titles/{tid}-{slug}') + pattern = r'