StreamingCommunity 3.2.9__tar.gz → 3.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of StreamingCommunity might be problematic. Click here for more details.

Files changed (120) hide show
  1. {streamingcommunity-3.2.9/StreamingCommunity.egg-info → streamingcommunity-3.3.0}/PKG-INFO +5 -1
  2. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/README.md +4 -0
  3. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/altadefinizione/__init__.py +31 -14
  4. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeunity/__init__.py +30 -14
  5. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeworld/__init__.py +33 -7
  6. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/crunchyroll/__init__.py +43 -9
  7. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/crunchyroll/site.py +7 -1
  8. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/guardaserie/__init__.py +36 -10
  9. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/mediasetinfinity/__init__.py +36 -11
  10. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/mediasetinfinity/site.py +8 -1
  11. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/raiplay/__init__.py +46 -11
  12. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/raiplay/film.py +2 -1
  13. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/raiplay/series.py +12 -2
  14. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +5 -7
  15. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingcommunity/site.py +4 -1
  16. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +5 -2
  17. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingwatch/__init__.py +43 -9
  18. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/DASH/cdm_helpher.py +8 -0
  19. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/DASH/downloader.py +23 -21
  20. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/MP4/downloader.py +21 -3
  21. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Upload/update.py +2 -2
  22. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Upload/version.py +2 -2
  23. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/os.py +4 -1
  24. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/run.py +4 -4
  25. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0/StreamingCommunity.egg-info}/PKG-INFO +5 -1
  26. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity.egg-info/SOURCES.txt +0 -3
  27. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/requirements.txt +1 -1
  28. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/cb01new/__init__.py +0 -72
  29. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/cb01new/film.py +0 -64
  30. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/cb01new/site.py +0 -78
  31. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/LICENSE +0 -0
  32. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/MANIFEST.in +0 -0
  33. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -0
  34. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +0 -0
  35. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/ddl.py +0 -0
  36. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/hdplayer.py +0 -0
  37. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/maxstream.py +0 -0
  38. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/mediapolisvod.py +0 -0
  39. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/mixdrop.py +0 -0
  40. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/supervideo.py +0 -0
  41. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/sweetpixel.py +0 -0
  42. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Player/vixcloud.py +0 -0
  43. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/altadefinizione/film.py +0 -0
  44. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/altadefinizione/series.py +0 -0
  45. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/altadefinizione/site.py +0 -0
  46. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/altadefinizione/util/ScrapeSerie.py +0 -0
  47. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeunity/film.py +0 -0
  48. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeunity/serie.py +0 -0
  49. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeunity/site.py +0 -0
  50. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +0 -0
  51. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeworld/film.py +0 -0
  52. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeworld/serie.py +0 -0
  53. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeworld/site.py +0 -0
  54. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py +0 -0
  55. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/crunchyroll/film.py +0 -0
  56. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/crunchyroll/series.py +0 -0
  57. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/crunchyroll/util/ScrapeSerie.py +0 -0
  58. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/crunchyroll/util/get_license.py +0 -0
  59. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/guardaserie/series.py +0 -0
  60. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/guardaserie/site.py +0 -0
  61. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -0
  62. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/mediasetinfinity/film.py +0 -0
  63. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/mediasetinfinity/series.py +0 -0
  64. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/mediasetinfinity/util/ScrapeSerie.py +0 -0
  65. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/mediasetinfinity/util/fix_mpd.py +0 -0
  66. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py +0 -0
  67. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/raiplay/site.py +0 -0
  68. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py +0 -0
  69. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/raiplay/util/get_license.py +0 -0
  70. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingcommunity/film.py +0 -0
  71. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingcommunity/series.py +0 -0
  72. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingwatch/film.py +0 -0
  73. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingwatch/series.py +0 -0
  74. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingwatch/site.py +0 -0
  75. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Site/streamingwatch/util/ScrapeSerie.py +0 -0
  76. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Template/Class/SearchType.py +0 -0
  77. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Template/Util/__init__.py +0 -0
  78. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Template/Util/manage_ep.py +0 -0
  79. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Template/__init__.py +0 -0
  80. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Template/config_loader.py +0 -0
  81. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Api/Template/site.py +0 -0
  82. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/DASH/decrypt.py +0 -0
  83. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/DASH/parser.py +0 -0
  84. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/DASH/segments.py +0 -0
  85. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/HLS/downloader.py +0 -0
  86. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/HLS/segments.py +0 -0
  87. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -0
  88. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/Downloader/__init__.py +0 -0
  89. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/FFmpeg/__init__.py +0 -0
  90. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/FFmpeg/capture.py +0 -0
  91. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/FFmpeg/command.py +0 -0
  92. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/FFmpeg/util.py +0 -0
  93. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/M3U8/__init__.py +0 -0
  94. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/M3U8/decryptor.py +0 -0
  95. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/M3U8/estimator.py +0 -0
  96. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/M3U8/parser.py +0 -0
  97. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/M3U8/url_fixer.py +0 -0
  98. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/TMBD/__init__.py +0 -0
  99. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -0
  100. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Lib/TMBD/tmdb.py +0 -0
  101. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/TelegramHelp/__init__.py +0 -0
  102. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/TelegramHelp/config.json +0 -0
  103. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/TelegramHelp/telegram_bot.py +0 -0
  104. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/bento4_installer.py +0 -0
  105. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/color.py +0 -0
  106. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/config_json.py +0 -0
  107. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/ffmpeg_installer.py +0 -0
  108. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/headers.py +0 -0
  109. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/http_client.py +0 -0
  110. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/logger.py +0 -0
  111. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/message.py +0 -0
  112. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/Util/table.py +0 -0
  113. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/__init__.py +0 -0
  114. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity/global_search.py +0 -0
  115. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity.egg-info/dependency_links.txt +0 -0
  116. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity.egg-info/entry_points.txt +0 -0
  117. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity.egg-info/requires.txt +0 -0
  118. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/StreamingCommunity.egg-info/top_level.txt +0 -0
  119. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/setup.cfg +0 -0
  120. {streamingcommunity-3.2.9 → streamingcommunity-3.3.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: StreamingCommunity
3
- Version: 3.2.9
3
+ Version: 3.3.0
4
4
  Home-page: https://github.com/Lovi-0/StreamingCommunity
5
5
  Author: Lovi-0
6
6
  Project-URL: Bug Reports, https://github.com/Lovi-0/StreamingCommunity/issues
@@ -906,6 +906,10 @@ python3 telegram_bot.py
906
906
  ```
907
907
  </details>
908
908
 
909
+ # SITE_LOGIN key
910
+ To use some site, you may need a SITE_LOGIN key.
911
+ See [guide.md](.github/.site/guide.md) for instructions on how to obtain it.
912
+
909
913
  # Tutorials
910
914
 
911
915
  - [Windows](https://www.youtube.com/watch?v=mZGqK4wdN-k)
@@ -869,6 +869,10 @@ python3 telegram_bot.py
869
869
  ```
870
870
  </details>
871
871
 
872
+ # SITE_LOGIN key
873
+ To use some site, you may need a SITE_LOGIN key.
874
+ See [guide.md](.github/.site/guide.md) for instructions on how to obtain it.
875
+
872
876
  # Tutorials
873
877
 
874
878
  - [Windows](https://www.youtube.com/watch?v=mZGqK4wdN-k)
@@ -22,6 +22,7 @@ from .site import title_search, table_show_manager, media_search_manager
22
22
  from .film import download_film
23
23
  from .series import download_series
24
24
 
25
+
25
26
  # Variable
26
27
  indice = 2
27
28
  _useFor = "Film_&_Serie"
@@ -66,6 +67,14 @@ def process_search_result(select_title, selections=None):
66
67
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
67
68
  {'season': season_selection, 'episode': episode_selection}
68
69
  """
70
+ if not select_title:
71
+ if site_constant.TELEGRAM_BOT:
72
+ bot = get_bot_instance()
73
+ bot.send_message("No title selected or selection cancelled.", None)
74
+ else:
75
+ console.print("[yellow]No title selected or selection cancelled.")
76
+ return
77
+
69
78
  if select_title.type == 'tv':
70
79
  season_selection = None
71
80
  episode_selection = None
@@ -86,39 +95,47 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
86
95
 
87
96
  Parameters:
88
97
  string_to_search (str, optional): String to search for
89
- get_onylDatabase (bool, optional): If True, return only the database object
98
+ get_onlyDatabase (bool, optional): If True, return only the database object
90
99
  direct_item (dict, optional): Direct item to process (bypass search)
91
100
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
92
101
  {'season': season_selection, 'episode': episode_selection}
93
102
  """
103
+ bot = None
104
+ if site_constant.TELEGRAM_BOT:
105
+ bot = get_bot_instance()
106
+
94
107
  if direct_item:
95
108
  select_title = MediaItem(**direct_item)
96
109
  process_search_result(select_title, selections)
97
110
  return
98
111
 
99
112
  # Get the user input for the search term
100
- string_to_search = get_user_input(string_to_search)
113
+ actual_search_query = get_user_input(string_to_search)
114
+
115
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
116
+ if not actual_search_query:
117
+ if bot:
118
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
119
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
120
+ return
101
121
 
102
122
  # Perform the database search
103
- len_database = title_search(quote_plus(string_to_search))
123
+ len_database = title_search(quote_plus(actual_search_query))
104
124
 
105
125
  # If only the database is needed, return the manager
106
126
  if get_onlyDatabase:
107
127
  return media_search_manager
108
-
109
- if site_constant.TELEGRAM_BOT:
110
- bot = get_bot_instance()
111
-
128
+
112
129
  if len_database > 0:
113
130
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
114
131
  process_search_result(select_title, selections)
115
132
 
116
133
  else:
117
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
118
-
119
- if site_constant.TELEGRAM_BOT:
120
- bot.send_message("No results found, please try again", None)
134
+ if bot:
135
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
136
+ else:
137
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
121
138
 
122
- # If no results are found, ask again
123
- string_to_search = get_user_input()
124
- search(string_to_search, get_onlyDatabase, None, selections)
139
+ # Do not call search() recursively here to avoid infinite loops on no results.
140
+ # The flow should return to the caller (e.g., main menu in run.py).
141
+ return
@@ -66,6 +66,14 @@ def process_search_result(select_title, selections=None):
66
66
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
67
67
  {'season': season_selection, 'episode': episode_selection}
68
68
  """
69
+ if not select_title:
70
+ if site_constant.TELEGRAM_BOT:
71
+ bot = get_bot_instance()
72
+ bot.send_message("No title selected or selection cancelled.", None)
73
+ else:
74
+ console.print("[yellow]No title selected or selection cancelled.")
75
+ return
76
+
69
77
  if select_title.type == 'Movie':
70
78
  download_film(select_title)
71
79
 
@@ -90,34 +98,42 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
90
98
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
91
99
  {'season': season_selection, 'episode': episode_selection}
92
100
  """
101
+ bot = None
102
+ if site_constant.TELEGRAM_BOT:
103
+ bot = get_bot_instance()
104
+
93
105
  if direct_item:
94
106
  select_title = MediaItem(**direct_item)
95
107
  process_search_result(select_title, selections)
96
108
  return
97
-
109
+
98
110
  # Get the user input for the search term
99
- string_to_search = get_user_input(string_to_search)
111
+ actual_search_query = get_user_input(string_to_search)
100
112
 
113
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
114
+ if not actual_search_query:
115
+ if bot:
116
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
117
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
118
+ return
119
+
101
120
  # Perform the database search
102
- len_database = title_search(string_to_search)
121
+ len_database = title_search(actual_search_query)
103
122
 
104
123
  # If only the database is needed, return the manager
105
124
  if get_onlyDatabase:
106
125
  return media_search_manager
107
-
108
- if site_constant.TELEGRAM_BOT:
109
- bot = get_bot_instance()
110
126
 
111
127
  if len_database > 0:
112
- select_title = get_select_title(table_show_manager, media_search_manager,len_database)
128
+ select_title = get_select_title(table_show_manager, media_search_manager, len_database)
113
129
  process_search_result(select_title, selections)
114
130
 
115
131
  else:
116
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
117
-
118
- if site_constant.TELEGRAM_BOT:
119
- bot.send_message("No results found, please try again", None)
132
+ if bot:
133
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
134
+ else:
135
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
120
136
 
121
- # If no results are found, ask again
122
- string_to_search = get_user_input()
123
- search(string_to_search, get_onlyDatabase, None, selections)
137
+ # Do not call search() recursively here to avoid infinite loops on no results.
138
+ # The flow should return to the caller (e.g., main menu in run.py).
139
+ return
@@ -9,6 +9,7 @@ from rich.prompt import Prompt
9
9
  from StreamingCommunity.Api.Template import get_select_title
10
10
  from StreamingCommunity.Api.Template.config_loader import site_constant
11
11
  from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
12
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
12
13
 
13
14
 
14
15
  # Logic class
@@ -38,6 +39,14 @@ def process_search_result(select_title, selections=None):
38
39
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
39
40
  {'season': season_selection, 'episode': episode_selection}
40
41
  """
42
+ if not select_title:
43
+ if site_constant.TELEGRAM_BOT:
44
+ bot = get_bot_instance()
45
+ bot.send_message("No title selected or selection cancelled.", None)
46
+ else:
47
+ console.print("[yellow]No title selected or selection cancelled.")
48
+ return
49
+
41
50
  if select_title.type == "TV":
42
51
  episode_selection = None
43
52
  if selections:
@@ -58,6 +67,10 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
58
67
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
59
68
  {'season': season_selection, 'episode': episode_selection}
60
69
  """
70
+ bot = None
71
+ if site_constant.TELEGRAM_BOT:
72
+ bot = get_bot_instance()
73
+
61
74
  if direct_item:
62
75
  select_title = MediaItem(**direct_item)
63
76
  process_search_result(select_title, selections)
@@ -65,20 +78,33 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
65
78
 
66
79
  # Get the user input for the search term
67
80
  if string_to_search is None:
68
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
81
+ actual_search_query = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
82
+ else:
83
+ actual_search_query = string_to_search
69
84
 
70
85
  # Perform the database search
71
- len_database = title_search(string_to_search)
86
+ if not actual_search_query:
87
+ if bot:
88
+ if actual_search_query is None:
89
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
90
+ return
91
+
92
+ len_database = title_search(actual_search_query)
72
93
 
73
94
  # If only the database is needed, return the manager
74
95
  if get_onlyDatabase:
75
96
  return media_search_manager
76
97
 
77
98
  if len_database > 0:
78
- select_title = get_select_title(table_show_manager, media_search_manager,len_database)
99
+ select_title = get_select_title(table_show_manager, media_search_manager, len_database)
79
100
  process_search_result(select_title, selections)
80
-
101
+
81
102
  else:
82
- # If no results are found, ask again
83
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
84
- search()
103
+ if bot:
104
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
105
+ else:
106
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
107
+
108
+ # Do not call search() recursively here to avoid infinite loops on no results.
109
+ # The flow should return to the caller (e.g., main menu in run.py).
110
+ return
@@ -12,6 +12,7 @@ from rich.prompt import Prompt
12
12
  from StreamingCommunity.Api.Template import get_select_title
13
13
  from StreamingCommunity.Api.Template.config_loader import site_constant
14
14
  from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
15
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
15
16
 
16
17
 
17
18
  # Logic class
@@ -19,6 +20,7 @@ from .site import title_search, table_show_manager, media_search_manager
19
20
  from .film import download_film
20
21
  from .series import download_series
21
22
 
23
+
22
24
  # Variable
23
25
  indice = 8
24
26
  _useFor = "Anime"
@@ -49,6 +51,14 @@ def process_search_result(select_title, selections=None):
49
51
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
50
52
  {'season': season_selection, 'episode': episode_selection}
51
53
  """
54
+ if not select_title:
55
+ if site_constant.TELEGRAM_BOT:
56
+ bot = get_bot_instance()
57
+ bot.send_message("No title selected or selection cancelled.", None)
58
+ else:
59
+ console.print("[yellow]No title selected or selection cancelled.")
60
+ return
61
+
52
62
  if select_title.type == 'tv':
53
63
  season_selection = None
54
64
  episode_selection = None
@@ -69,33 +79,57 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
69
79
 
70
80
  Parameters:
71
81
  string_to_search (str, optional): String to search for
72
- get_onylDatabase (bool, optional): If True, return only the database object
82
+ get_onlyDatabase (bool, optional): If True, return only the database object
83
+ direct_item (dict, optional): Direct item to process (bypass search)
84
+ selections (dict, optional): Dictionary containing selection inputs that bypass manual input
85
+ {'season': season_selection, 'episode': episode_selection}
86
+ """
87
+ """
88
+ Main function of the application for search.
89
+
90
+ Parameters:
91
+ string_to_search (str, optional): String to search for
92
+ get_onlyDatabase (bool, optional): If True, return only the database object
73
93
  direct_item (dict, optional): Direct item to process (bypass search)
74
94
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
75
95
  {'season': season_selection, 'episode': episode_selection}
76
96
  """
97
+ bot = None
98
+ if site_constant.TELEGRAM_BOT:
99
+ bot = get_bot_instance()
100
+
77
101
  if direct_item:
78
102
  select_title = MediaItem(**direct_item)
79
103
  process_search_result(select_title, selections)
80
104
  return
81
105
 
82
106
  # Get the user input for the search term
83
- string_to_search = get_user_input(string_to_search)
107
+ actual_search_query = get_user_input(string_to_search)
108
+
109
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
110
+ if not actual_search_query:
111
+ if bot:
112
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
113
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
114
+ return
84
115
 
85
116
  # Perform the database search
86
- len_database = title_search(quote_plus(string_to_search))
117
+ len_database = title_search(quote_plus(actual_search_query))
87
118
 
88
119
  # If only the database is needed, return the manager
89
120
  if get_onlyDatabase:
90
121
  return media_search_manager
91
-
122
+
92
123
  if len_database > 0:
93
124
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
94
125
  process_search_result(select_title, selections)
95
126
 
96
127
  else:
97
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
98
-
99
- # If no results are found, ask again
100
- string_to_search = get_user_input()
101
- search(string_to_search, get_onlyDatabase, None, selections)
128
+ if bot:
129
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
130
+ else:
131
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
132
+
133
+ # Do not call search() recursively here to avoid infinite loops on no results.
134
+ # The flow should return to the caller (e.g., main menu in run.py).
135
+ return
@@ -1,6 +1,7 @@
1
1
  # 16.03.25
2
2
 
3
3
  import os
4
+ import sys
4
5
 
5
6
 
6
7
  # External libraries
@@ -45,7 +46,12 @@ def title_search(query: str) -> int:
45
46
  cdm_device_path = get_wvd_path()
46
47
  if not cdm_device_path or not isinstance(cdm_device_path, (str, bytes, os.PathLike)) or not os.path.isfile(cdm_device_path):
47
48
  console.print(f"[bold red] CDM file not found or invalid path: {cdm_device_path}[/bold red]")
48
- return None
49
+ sys.exit(0)
50
+
51
+ # Check if x_cr_tab_id or etp_rt is present
52
+ if config_manager.get_dict("SITE_LOGIN", "crunchyroll")['x_cr_tab_id'] is None or config_manager.get_dict("SITE_LOGIN", "crunchyroll")['x_cr_tab_id'] == "" or config_manager.get_dict("SITE_LOGIN", "crunchyroll")['etp_rt'] is None or config_manager.get_dict("SITE_LOGIN", "crunchyroll")['etp_rt'] == "":
53
+ console.print(f"[bold red] x_cr_tab_id or etp_rt is missing or empty.[/bold red]")
54
+ sys.exit(0)
49
55
 
50
56
  # Build new Crunchyroll API search URL
51
57
  api_url = "https://www.crunchyroll.com/content/v2/discover/search"
@@ -12,6 +12,7 @@ from rich.prompt import Prompt
12
12
  from StreamingCommunity.Api.Template import get_select_title
13
13
  from StreamingCommunity.Api.Template.config_loader import site_constant
14
14
  from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
15
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
15
16
 
16
17
 
17
18
  # Logic class
@@ -39,6 +40,14 @@ def process_search_result(select_title, selections=None):
39
40
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
40
41
  {'season': season_selection, 'episode': episode_selection}
41
42
  """
43
+ if not select_title:
44
+ if site_constant.TELEGRAM_BOT:
45
+ bot = get_bot_instance()
46
+ bot.send_message("No title selected or selection cancelled.", None)
47
+ else:
48
+ console.print("[yellow]No title selected or selection cancelled.")
49
+ return
50
+
42
51
  season_selection = None
43
52
  episode_selection = None
44
53
 
@@ -59,27 +68,44 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
59
68
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
60
69
  {'season': season_selection, 'episode': episode_selection}
61
70
  """
71
+ bot = None
72
+ if site_constant.TELEGRAM_BOT:
73
+ try:
74
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
75
+ bot = get_bot_instance()
76
+ except Exception:
77
+ bot = None
78
+
62
79
  if direct_item:
63
80
  select_title = MediaItem(**direct_item)
64
81
  process_search_result(select_title, selections)
65
82
  return
66
83
 
67
84
  if string_to_search is None:
68
- string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{site_constant.SITE_NAME}").strip()
69
-
70
- # Search on database
71
- len_database = title_search(quote_plus(string_to_search))
85
+ actual_search_query = msg.ask(f"\n[purple]Insert word to search in [green]{site_constant.SITE_NAME}").strip()
86
+ else:
87
+ actual_search_query = string_to_search
88
+
89
+ # Handle empty input
90
+ if not actual_search_query:
91
+ if bot:
92
+ if actual_search_query is None:
93
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
94
+ return
95
+
96
+ # Search on database (preserve quote_plus usage)
97
+ len_database = title_search(quote_plus(actual_search_query))
72
98
 
73
99
  # If only the database is needed, return the manager
74
100
  if get_onlyDatabase:
75
101
  return media_search_manager
76
102
 
77
103
  if len_database > 0:
78
- select_title = get_select_title(table_show_manager, media_search_manager,len_database)
104
+ select_title = get_select_title(table_show_manager, media_search_manager, len_database)
79
105
  process_search_result(select_title, selections)
80
-
81
106
  else:
82
-
83
- # If no results are found, ask again
84
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
85
- search()
107
+ if bot:
108
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
109
+ else:
110
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
111
+ return
@@ -10,6 +10,7 @@ from rich.prompt import Prompt
10
10
  from StreamingCommunity.Api.Template import get_select_title
11
11
  from StreamingCommunity.Api.Template.config_loader import site_constant
12
12
  from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
13
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
13
14
 
14
15
 
15
16
  # Logic class
@@ -47,6 +48,14 @@ def process_search_result(select_title, selections=None):
47
48
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
48
49
  {'season': season_selection, 'episode': episode_selection}
49
50
  """
51
+ if not select_title:
52
+ if site_constant.TELEGRAM_BOT:
53
+ bot = get_bot_instance()
54
+ bot.send_message("No title selected or selection cancelled.", None)
55
+ else:
56
+ console.print("[yellow]No title selected or selection cancelled.")
57
+ return
58
+
50
59
  if select_title.type == 'tv':
51
60
  season_selection = None
52
61
  episode_selection = None
@@ -71,26 +80,42 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
71
80
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
72
81
  {'season': season_selection, 'episode': episode_selection}
73
82
  """
83
+ bot = None
84
+ if site_constant.TELEGRAM_BOT:
85
+ bot = get_bot_instance()
86
+
74
87
  if direct_item:
75
88
  select_title = MediaItem(**direct_item)
76
89
  process_search_result(select_title, selections)
77
90
  return
78
-
79
- if string_to_search is None:
80
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
81
-
82
- # Search on database
83
- len_database = title_search(string_to_search)
91
+
92
+ # Get the user input for the search term
93
+ actual_search_query = get_user_input(string_to_search)
94
+
95
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
96
+ if not actual_search_query:
97
+ if bot:
98
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
99
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
100
+ return
101
+
102
+ # Perform the database search
103
+ len_database = title_search(actual_search_query)
84
104
 
85
105
  # If only the database is needed, return the manager
86
106
  if get_onlyDatabase:
87
107
  return media_search_manager
88
-
108
+
89
109
  if len_database > 0:
90
- select_title = get_select_title(table_show_manager, media_search_manager,len_database)
110
+ select_title = get_select_title(table_show_manager, media_search_manager, len_database)
91
111
  process_search_result(select_title, selections)
92
112
 
93
113
  else:
94
- # If no results are found, ask again
95
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
96
- search()
114
+ if bot:
115
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
116
+ else:
117
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
118
+
119
+ # Do not call search() recursively here to avoid infinite loops on no results.
120
+ # The flow should return to the caller (e.g., main menu in run.py).
121
+ return
@@ -1,6 +1,8 @@
1
1
  # 25.07.25
2
2
 
3
3
  import os
4
+ import sys
5
+
4
6
 
5
7
  # External libraries
6
8
  import httpx
@@ -44,7 +46,12 @@ def title_search(query: str) -> int:
44
46
  cdm_device_path = get_wvd_path()
45
47
  if not cdm_device_path or not isinstance(cdm_device_path, (str, bytes, os.PathLike)) or not os.path.isfile(cdm_device_path):
46
48
  console.print(f"[bold red] CDM file not found or invalid path: {cdm_device_path}[/bold red]")
47
- return None
49
+ sys.exit(0)
50
+
51
+ # Check if beToken is present
52
+ if config_manager.get_dict("SITE_LOGIN", "mediasetinfinity")["beToken"] is None or config_manager.get_dict("SITE_LOGIN", "mediasetinfinity")["beToken"] == "":
53
+ console.print(f"[bold red] beToken is missing or empty.[/bold red]")
54
+ sys.exit(0)
48
55
 
49
56
  search_url = 'https://api-ott-prod-fe.mediaset.net/PROD/play/reco/account/v2.0'
50
57
  console.print(f"[cyan]Search url: [yellow]{search_url}")
@@ -10,6 +10,7 @@ from rich.prompt import Prompt
10
10
  from StreamingCommunity.Api.Template import get_select_title
11
11
  from StreamingCommunity.Api.Template.config_loader import site_constant
12
12
  from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
13
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
13
14
 
14
15
 
15
16
  # Logic class
@@ -44,6 +45,14 @@ def process_search_result(select_title, selections=None):
44
45
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
45
46
  {'season': season_selection, 'episode': episode_selection}
46
47
  """
48
+ if not select_title:
49
+ if site_constant.TELEGRAM_BOT:
50
+ bot = get_bot_instance()
51
+ bot.send_message("No title selected or selection cancelled.", None)
52
+ else:
53
+ console.print("[yellow]No title selected or selection cancelled.")
54
+ return
55
+
47
56
  if select_title.type == 'tv':
48
57
  season_selection = None
49
58
  episode_selection = None
@@ -68,26 +77,52 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
68
77
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
69
78
  {'season': season_selection, 'episode': episode_selection}
70
79
  """
80
+ """
81
+ Main function of the application for search.
82
+
83
+ Parameters:
84
+ string_to_search (str, optional): String to search for
85
+ get_onlyDatabase (bool, optional): If True, return only the database object
86
+ direct_item (dict, optional): Direct item to process (bypass search)
87
+ selections (dict, optional): Dictionary containing selection inputs that bypass manual input
88
+ {'season': season_selection, 'episode': episode_selection}
89
+ """
90
+ bot = None
91
+ if site_constant.TELEGRAM_BOT:
92
+ bot = get_bot_instance()
93
+
71
94
  if direct_item:
72
95
  select_title = MediaItem(**direct_item)
73
96
  process_search_result(select_title, selections)
74
97
  return
75
-
76
- if string_to_search is None:
77
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
78
-
79
- # Search on database
80
- len_database = title_search(string_to_search)
98
+
99
+ # Get the user input for the search term
100
+ actual_search_query = get_user_input(string_to_search)
101
+
102
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
103
+ if not actual_search_query:
104
+ if bot:
105
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
106
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
107
+ return
108
+
109
+ # Perform the database search
110
+ len_database = title_search(actual_search_query)
81
111
 
82
112
  # If only the database is needed, return the manager
83
113
  if get_onlyDatabase:
84
114
  return media_search_manager
85
-
115
+
86
116
  if len_database > 0:
87
- select_title = get_select_title(table_show_manager, media_search_manager,len_database)
117
+ select_title = get_select_title(table_show_manager, media_search_manager, len_database)
88
118
  process_search_result(select_title, selections)
89
119
 
90
120
  else:
91
- # If no results are found, ask again
92
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
93
- search()
121
+ if bot:
122
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
123
+ else:
124
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
125
+
126
+ # Do not call search() recursively here to avoid infinite loops on no results.
127
+ # The flow should return to the caller (e.g., main menu in run.py).
128
+ return