diff --git a/StreamingCommunity/Api/Site/1337xx/__init__.py b/StreamingCommunity/Api/Site/1337xx/__init__.py index f0d5725..5025335 100644 --- a/StreamingCommunity/Api/Site/1337xx/__init__.py +++ b/StreamingCommunity/Api/Site/1337xx/__init__.py @@ -1,16 +1,15 @@ # 02.07.24 -import sys -import subprocess from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title # Logic class -from .site import title_search, run_get_select_title, media_search_manager +from .site import title_search, media_search_manager, table_show_manager from .title import download_title @@ -40,7 +39,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) # Download title download_title(select_title) diff --git a/StreamingCommunity/Api/Site/1337xx/site.py b/StreamingCommunity/Api/Site/1337xx/site.py index 6d683cb..a30db3a 100644 --- a/StreamingCommunity/Api/Site/1337xx/site.py +++ b/StreamingCommunity/Api/Site/1337xx/site.py @@ -13,7 +13,6 @@ from StreamingCommunity.Util.table import TVShowManager # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager @@ -77,11 +76,4 @@ def title_search(word_to_search: str) -> int: print(f"Error parsing a film entry: {e}") # Return the number of titles found - return media_search_manager.get_length() - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) + return media_search_manager.get_length() \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/altadefinizionegratis/__init__.py b/StreamingCommunity/Api/Site/altadefinizionegratis/__init__.py index df2737f..30ca58a 100644 --- a/StreamingCommunity/Api/Site/altadefinizionegratis/__init__.py +++ b/StreamingCommunity/Api/Site/altadefinizionegratis/__init__.py @@ -7,11 +7,12 @@ from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance # Logic class -from .site import title_search, run_get_select_title, media_search_manager +from .site import title_search, media_search_manager, table_show_manager from .film import download_film @@ -60,7 +61,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) # Download only film download_film(select_title) diff --git a/StreamingCommunity/Api/Site/altadefinizionegratis/site.py b/StreamingCommunity/Api/Site/altadefinizionegratis/site.py index 3b1a1a3..4e4e6ff 100644 --- a/StreamingCommunity/Api/Site/altadefinizionegratis/site.py +++ b/StreamingCommunity/Api/Site/altadefinizionegratis/site.py @@ -13,7 +13,6 @@ from StreamingCommunity.Util.table import TVShowManager # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager @@ -107,11 +106,4 @@ def title_search(title_search: str) -> int: bot.send_message(f"Lista dei risultati:", choices) # Return the number of titles found - return media_search_manager.get_length() - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) \ No newline at end of file + return media_search_manager.get_length() \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/animeunity/__init__.py b/StreamingCommunity/Api/Site/animeunity/__init__.py index 5a12833..87f5741 100644 --- a/StreamingCommunity/Api/Site/animeunity/__init__.py +++ b/StreamingCommunity/Api/Site/animeunity/__init__.py @@ -2,16 +2,16 @@ import sys import subprocess -from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance # Logic class -from .site import title_search, run_get_select_title, media_search_manager +from .site import title_search, media_search_manager, table_show_manager from .film_serie import download_film, download_series @@ -58,7 +58,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list (type: TV \ Movie \ OVA) - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) if select_title.type == 'Movie' or select_title.type == 'OVA': download_film(select_title) diff --git a/StreamingCommunity/Api/Site/animeunity/site.py b/StreamingCommunity/Api/Site/animeunity/site.py index d36411f..48aa105 100644 --- a/StreamingCommunity/Api/Site/animeunity/site.py +++ b/StreamingCommunity/Api/Site/animeunity/site.py @@ -16,7 +16,6 @@ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager @@ -182,11 +181,4 @@ def title_search(title: str) -> int: bot.send_message(f"Lista dei risultati:", choices) # Return the length of media search manager - return media_search_manager.get_length() - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) \ No newline at end of file + return media_search_manager.get_length() \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/cb01new/__init__.py b/StreamingCommunity/Api/Site/cb01new/__init__.py index f29e299..641a4be 100644 --- a/StreamingCommunity/Api/Site/cb01new/__init__.py +++ b/StreamingCommunity/Api/Site/cb01new/__init__.py @@ -5,10 +5,11 @@ from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title # Logic class -from .site import title_search, run_get_select_title, media_search_manager +from .site import title_search, media_search_manager, table_show_manager from .film import download_film @@ -39,7 +40,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) # !!! ADD TYPE DONT WORK FOR SERIE download_film(select_title) diff --git a/StreamingCommunity/Api/Site/cb01new/site.py b/StreamingCommunity/Api/Site/cb01new/site.py index 0b3f910..8ca838a 100644 --- a/StreamingCommunity/Api/Site/cb01new/site.py +++ b/StreamingCommunity/Api/Site/cb01new/site.py @@ -12,7 +12,6 @@ from StreamingCommunity.Util.table import TVShowManager # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager @@ -73,11 +72,4 @@ def title_search(word_to_search: str) -> int: print(f"Error parsing a film entry: {e}") # Return the number of titles found - return media_search_manager.get_length() - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) \ No newline at end of file + return media_search_manager.get_length() \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py b/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py index 0e1ae46..f9864a4 100644 --- a/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +++ b/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py @@ -6,10 +6,11 @@ from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title # Logic class -from .site import title_search, run_get_select_title, media_search_manager +from .site import title_search, media_search_manager, table_show_manager from .series import download_thread @@ -40,7 +41,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) # Download only film if "Serie TV" in str(select_title.type): diff --git a/StreamingCommunity/Api/Site/ddlstreamitaly/site.py b/StreamingCommunity/Api/Site/ddlstreamitaly/site.py index 3fceee0..70817be 100644 --- a/StreamingCommunity/Api/Site/ddlstreamitaly/site.py +++ b/StreamingCommunity/Api/Site/ddlstreamitaly/site.py @@ -16,7 +16,6 @@ from StreamingCommunity.Util.table import TVShowManager # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager @@ -89,11 +88,4 @@ def title_search(word_to_search: str) -> int: logging.error("No table content found.") return -999 - return -9999 - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) \ No newline at end of file + return -9999 \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/guardaserie/__init__.py b/StreamingCommunity/Api/Site/guardaserie/__init__.py index e11597a..89a24b9 100644 --- a/StreamingCommunity/Api/Site/guardaserie/__init__.py +++ b/StreamingCommunity/Api/Site/guardaserie/__init__.py @@ -5,10 +5,11 @@ from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title # Logic class -from .site import title_search, run_get_select_title, media_search_manager +from .site import title_search, media_search_manager, table_show_manager from .series import download_series @@ -39,7 +40,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) # Download only film download_series(select_title) diff --git a/StreamingCommunity/Api/Site/guardaserie/site.py b/StreamingCommunity/Api/Site/guardaserie/site.py index 8611b19..80c4c98 100644 --- a/StreamingCommunity/Api/Site/guardaserie/site.py +++ b/StreamingCommunity/Api/Site/guardaserie/site.py @@ -13,7 +13,6 @@ from StreamingCommunity.Util.table import TVShowManager # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager @@ -80,11 +79,4 @@ def title_search(word_to_search: str) -> int: print(f"Error parsing a film entry: {e}") # Return the number of titles found - return media_search_manager.get_length() - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) \ No newline at end of file + return media_search_manager.get_length() \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/ilcorsaronero/__init__.py b/StreamingCommunity/Api/Site/ilcorsaronero/__init__.py index d82b916..1dc3214 100644 --- a/StreamingCommunity/Api/Site/ilcorsaronero/__init__.py +++ b/StreamingCommunity/Api/Site/ilcorsaronero/__init__.py @@ -6,10 +6,11 @@ from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title # Logic class -from .site import title_search, run_get_select_title, media_search_manager +from .site import title_search, media_search_manager, table_show_manager from .title import download_title @@ -40,7 +41,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) # Download title download_title(select_title) diff --git a/StreamingCommunity/Api/Site/ilcorsaronero/site.py b/StreamingCommunity/Api/Site/ilcorsaronero/site.py index 90aa769..827e5cd 100644 --- a/StreamingCommunity/Api/Site/ilcorsaronero/site.py +++ b/StreamingCommunity/Api/Site/ilcorsaronero/site.py @@ -7,7 +7,6 @@ from StreamingCommunity.Util.table import TVShowManager # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager from .util.ilCorsarScraper import IlCorsaroNeroScraper @@ -62,11 +61,4 @@ async def title_search(word_to_search: str) -> int: print(f"Error parsing a film entry: {e}") # Return the number of titles found - return media_search_manager.get_length() - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) \ No newline at end of file + return media_search_manager.get_length() \ No newline at end of file diff --git a/StreamingCommunity/Api/Site/streamingcommunity/__init__.py b/StreamingCommunity/Api/Site/streamingcommunity/__init__.py index 83aeb15..afab8cb 100644 --- a/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +++ b/StreamingCommunity/Api/Site/streamingcommunity/__init__.py @@ -7,11 +7,12 @@ from urllib.parse import quote_plus # Internal utilities from StreamingCommunity.Util.console import console, msg +from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance # Logic class -from .site import get_version_and_domain, title_search, run_get_select_title, media_search_manager +from .site import get_version_and_domain, title_search, table_show_manager, media_search_manager from .film import download_film from .series import download_series @@ -62,7 +63,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False): if len_database > 0: # Select title from list - select_title = run_get_select_title() + select_title = get_select_title(table_show_manager, media_search_manager) if select_title.type == 'tv': download_series(select_title, site_version) diff --git a/StreamingCommunity/Api/Site/streamingcommunity/site.py b/StreamingCommunity/Api/Site/streamingcommunity/site.py index 0064865..ba5b3b3 100644 --- a/StreamingCommunity/Api/Site/streamingcommunity/site.py +++ b/StreamingCommunity/Api/Site/streamingcommunity/site.py @@ -19,7 +19,6 @@ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance # Logic class -from StreamingCommunity.Api.Template import get_select_title from StreamingCommunity.Api.Template.Util import search_domain from StreamingCommunity.Api.Template.Class.SearchType import MediaManager @@ -147,11 +146,4 @@ def title_search(title_search: str, domain: str) -> int: bot.send_message(f"Lista dei risultati:", choices) # Return the number of titles found - return media_search_manager.get_length() - - -def run_get_select_title(): - """ - Display a selection of titles and prompt the user to choose one. - """ - return get_select_title(table_show_manager, media_search_manager) \ No newline at end of file + return media_search_manager.get_length() \ No newline at end of file diff --git a/StreamingCommunity/run.py b/StreamingCommunity/run.py index 8ecdfa2..0f43f35 100644 --- a/StreamingCommunity/run.py +++ b/StreamingCommunity/run.py @@ -145,6 +145,7 @@ def initialize(): except: console.log("[red]Error with loading github.") + def restart_script(): """Riavvia lo script con gli stessi argomenti della riga di comando.""" print("\nšŸ”„ Riavvio dello script...\n")