StreamingCommunity 3.2.9__tar.gz → 3.3.1__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 (126) hide show
  1. {streamingcommunity-3.2.9/StreamingCommunity.egg-info → streamingcommunity-3.3.1}/PKG-INFO +2 -7
  2. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/README.md +1 -7
  3. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/__init__.py +67 -30
  4. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/__init__.py +65 -29
  5. streamingcommunity-3.3.1/StreamingCommunity/Api/Site/animeworld/__init__.py +154 -0
  6. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/__init__.py +75 -15
  7. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/site.py +7 -1
  8. streamingcommunity-3.3.1/StreamingCommunity/Api/Site/guardaserie/__init__.py +155 -0
  9. streamingcommunity-3.3.1/StreamingCommunity/Api/Site/mediasetinfinity/__init__.py +159 -0
  10. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/film.py +1 -1
  11. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/site.py +12 -2
  12. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/util/ScrapeSerie.py +6 -7
  13. streamingcommunity-3.3.1/StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py +347 -0
  14. streamingcommunity-3.3.1/StreamingCommunity/Api/Site/raiplay/__init__.py +159 -0
  15. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/film.py +2 -1
  16. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/series.py +21 -7
  17. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +12 -9
  18. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/site.py +4 -1
  19. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +5 -2
  20. streamingcommunity-3.3.1/StreamingCommunity/Api/Site/streamingwatch/__init__.py +158 -0
  21. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/cdm_helpher.py +8 -0
  22. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/downloader.py +109 -75
  23. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/HLS/downloader.py +18 -6
  24. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/HLS/segments.py +1 -1
  25. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/MP4/downloader.py +21 -3
  26. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/command.py +66 -7
  27. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/util.py +16 -13
  28. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Upload/update.py +2 -2
  29. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Upload/version.py +2 -2
  30. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/os.py +4 -1
  31. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/run.py +4 -4
  32. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1/StreamingCommunity.egg-info}/PKG-INFO +2 -7
  33. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/SOURCES.txt +0 -3
  34. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/requires.txt +1 -0
  35. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/requirements.txt +3 -2
  36. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/animeworld/__init__.py +0 -84
  37. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/cb01new/__init__.py +0 -72
  38. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/cb01new/film.py +0 -64
  39. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/cb01new/site.py +0 -78
  40. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/guardaserie/__init__.py +0 -85
  41. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/mediasetinfinity/__init__.py +0 -96
  42. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py +0 -185
  43. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/raiplay/__init__.py +0 -93
  44. streamingcommunity-3.2.9/StreamingCommunity/Api/Site/streamingwatch/__init__.py +0 -94
  45. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/LICENSE +0 -0
  46. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/MANIFEST.in +0 -0
  47. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -0
  48. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +0 -0
  49. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/ddl.py +0 -0
  50. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/hdplayer.py +0 -0
  51. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/maxstream.py +0 -0
  52. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/mediapolisvod.py +0 -0
  53. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/mixdrop.py +0 -0
  54. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/supervideo.py +0 -0
  55. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/sweetpixel.py +0 -0
  56. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/vixcloud.py +0 -0
  57. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/film.py +0 -0
  58. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/series.py +0 -0
  59. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/site.py +0 -0
  60. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/util/ScrapeSerie.py +0 -0
  61. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/film.py +0 -0
  62. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/serie.py +0 -0
  63. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/site.py +0 -0
  64. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +0 -0
  65. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/film.py +0 -0
  66. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/serie.py +0 -0
  67. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/site.py +0 -0
  68. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py +0 -0
  69. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/film.py +0 -0
  70. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/series.py +0 -0
  71. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/util/ScrapeSerie.py +0 -0
  72. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/util/get_license.py +0 -0
  73. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/guardaserie/series.py +0 -0
  74. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/guardaserie/site.py +0 -0
  75. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -0
  76. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/series.py +0 -0
  77. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/util/fix_mpd.py +0 -0
  78. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/site.py +0 -0
  79. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py +0 -0
  80. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/util/get_license.py +0 -0
  81. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/film.py +0 -0
  82. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/series.py +0 -0
  83. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/film.py +0 -0
  84. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/series.py +0 -0
  85. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/site.py +0 -0
  86. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/util/ScrapeSerie.py +0 -0
  87. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/Class/SearchType.py +0 -0
  88. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/Util/__init__.py +0 -0
  89. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/Util/manage_ep.py +0 -0
  90. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/__init__.py +0 -0
  91. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/config_loader.py +0 -0
  92. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/site.py +0 -0
  93. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/decrypt.py +0 -0
  94. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/parser.py +0 -0
  95. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/segments.py +0 -0
  96. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -0
  97. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/__init__.py +0 -0
  98. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/__init__.py +0 -0
  99. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/capture.py +0 -0
  100. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/__init__.py +0 -0
  101. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/decryptor.py +0 -0
  102. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/estimator.py +0 -0
  103. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/parser.py +0 -0
  104. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/url_fixer.py +0 -0
  105. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/TMBD/__init__.py +0 -0
  106. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -0
  107. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/TMBD/tmdb.py +0 -0
  108. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/TelegramHelp/__init__.py +0 -0
  109. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/TelegramHelp/config.json +0 -0
  110. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/TelegramHelp/telegram_bot.py +0 -0
  111. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/bento4_installer.py +0 -0
  112. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/color.py +0 -0
  113. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/config_json.py +0 -0
  114. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/ffmpeg_installer.py +0 -0
  115. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/headers.py +0 -0
  116. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/http_client.py +0 -0
  117. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/logger.py +0 -0
  118. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/message.py +0 -0
  119. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/Util/table.py +0 -0
  120. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/__init__.py +0 -0
  121. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity/global_search.py +0 -0
  122. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/dependency_links.txt +0 -0
  123. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/entry_points.txt +0 -0
  124. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/top_level.txt +0 -0
  125. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/setup.cfg +0 -0
  126. {streamingcommunity-3.2.9 → streamingcommunity-3.3.1}/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.1
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
@@ -25,6 +25,7 @@ Requires-Dist: ua-generator
25
25
  Requires-Dist: qbittorrent-api
26
26
  Requires-Dist: pyTelegramBotAPI
27
27
  Requires-Dist: pywidevine
28
+ Requires-Dist: seleniumbase
28
29
  Dynamic: author
29
30
  Dynamic: description
30
31
  Dynamic: description-content-type
@@ -913,17 +914,11 @@ python3 telegram_bot.py
913
914
  - [Pypy](https://www.youtube.com/watch?v=C6m9ZKOK0p4)
914
915
  - [Compiled](https://www.youtube.com/watch?v=pm4lqsxkTVo)
915
916
 
916
- # To Do
917
-
918
- - To Finish [website API](https://github.com/Arrowar/StreamingCommunity/tree/test_gui_1)
919
- - To finish [website API 2](https://github.com/hydrosh/StreamingCommunity/tree/test_gui_1)
920
-
921
917
  ## Useful Project
922
918
 
923
919
  ### 🎯 [Unit3Dup](https://github.com/31December99/Unit3Dup)
924
920
  Bot in Python per la generazione e l'upload automatico di torrent su tracker basati su Unit3D.
925
921
 
926
-
927
922
  ### 🇮🇹 [MammaMia](https://github.com/UrloMythus/MammaMia)
928
923
  Addon per Stremio che consente lo streaming HTTPS di film, serie, anime e TV in diretta in lingua italiana.
929
924
 
@@ -876,17 +876,11 @@ python3 telegram_bot.py
876
876
  - [Pypy](https://www.youtube.com/watch?v=C6m9ZKOK0p4)
877
877
  - [Compiled](https://www.youtube.com/watch?v=pm4lqsxkTVo)
878
878
 
879
- # To Do
880
-
881
- - To Finish [website API](https://github.com/Arrowar/StreamingCommunity/tree/test_gui_1)
882
- - To finish [website API 2](https://github.com/hydrosh/StreamingCommunity/tree/test_gui_1)
883
-
884
879
  ## Useful Project
885
880
 
886
881
  ### 🎯 [Unit3Dup](https://github.com/31December99/Unit3Dup)
887
882
  Bot in Python per la generazione e l'upload automatico di torrent su tracker basati su Unit3D.
888
883
 
889
-
890
884
  ### 🇮🇹 [MammaMia](https://github.com/UrloMythus/MammaMia)
891
885
  Addon per Stremio che consente lo streaming HTTPS di film, serie, anime e TV in diretta in lingua italiana.
892
886
 
@@ -897,4 +891,4 @@ API non ufficiale per accedere ai contenuti del sito italiano StreamingCommunity
897
891
 
898
892
  This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
899
893
 
900
- > **Note:** DASH downloads require a valid L3 CDM (Content Decryption Module) to proceed. This project does not provide, include, or facilitate obtaining any CDM. Users are responsible for ensuring compliance with all applicable laws and requirements regarding DRM and decryption modules.
894
+ > **Note:** DASH downloads require a valid L3 CDM (Content Decryption Module) to proceed. This project does not provide, include, or facilitate obtaining any CDM. Users are responsible for ensuring compliance with all applicable laws and requirements regarding DRM and decryption modules.
@@ -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"
@@ -37,25 +38,39 @@ def get_user_input(string_to_search: str = None):
37
38
  """
38
39
  Asks the user to input a search term.
39
40
  Handles both Telegram bot input and direct input.
41
+ If string_to_search is provided, it's returned directly (after stripping).
40
42
  """
41
- if string_to_search is None:
42
- if site_constant.TELEGRAM_BOT:
43
- bot = get_bot_instance()
44
- string_to_search = bot.ask(
45
- "key_search",
46
- "Enter the search term\nor type 'back' to return to the menu: ",
47
- None
48
- )
49
-
50
- if string_to_search == 'back':
43
+ if string_to_search is not None:
44
+ return string_to_search.strip()
51
45
 
46
+ if site_constant.TELEGRAM_BOT:
47
+ bot = get_bot_instance()
48
+ user_response = bot.ask(
49
+ "key_search", # Request type
50
+ "Enter the search term\nor type 'back' to return to the menu: ",
51
+ None
52
+ )
53
+
54
+ if user_response is None:
55
+ bot.send_message("Timeout: No search term entered.", None)
56
+ return None
57
+
58
+ if user_response.lower() == 'back':
59
+ bot.send_message("Returning to the main menu...", None)
60
+
61
+ try:
52
62
  # Restart the script
53
63
  subprocess.Popen([sys.executable] + sys.argv)
54
64
  sys.exit()
55
- else:
56
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
57
-
58
- return string_to_search
65
+
66
+ except Exception as e:
67
+ bot.send_message(f"Error during restart attempt: {e}", None)
68
+ return None # Return None if restart fails
69
+
70
+ return user_response.strip()
71
+
72
+ else:
73
+ return msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
59
74
 
60
75
  def process_search_result(select_title, selections=None):
61
76
  """
@@ -65,7 +80,18 @@ def process_search_result(select_title, selections=None):
65
80
  select_title (MediaItem): The selected media item
66
81
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
67
82
  {'season': season_selection, 'episode': episode_selection}
83
+
84
+ Returns:
85
+ bool: True if processing was successful, False otherwise
68
86
  """
87
+ if not select_title:
88
+ if site_constant.TELEGRAM_BOT:
89
+ bot = get_bot_instance()
90
+ bot.send_message("No title selected or selection cancelled.", None)
91
+ else:
92
+ console.print("[yellow]No title selected or selection cancelled.")
93
+ return False
94
+
69
95
  if select_title.type == 'tv':
70
96
  season_selection = None
71
97
  episode_selection = None
@@ -75,9 +101,11 @@ def process_search_result(select_title, selections=None):
75
101
  episode_selection = selections.get('episode')
76
102
 
77
103
  download_series(select_title, season_selection, episode_selection)
104
+ return True
78
105
 
79
106
  else:
80
107
  download_film(select_title)
108
+ return True
81
109
 
82
110
  # search("Game of Thrones", selections={"season": "1", "episode": "1-3"})
83
111
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
@@ -86,39 +114,48 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
86
114
 
87
115
  Parameters:
88
116
  string_to_search (str, optional): String to search for
89
- get_onylDatabase (bool, optional): If True, return only the database object
117
+ get_onlyDatabase (bool, optional): If True, return only the database object
90
118
  direct_item (dict, optional): Direct item to process (bypass search)
91
119
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
92
120
  {'season': season_selection, 'episode': episode_selection}
93
121
  """
122
+ bot = None
123
+ if site_constant.TELEGRAM_BOT:
124
+ bot = get_bot_instance()
125
+
94
126
  if direct_item:
95
127
  select_title = MediaItem(**direct_item)
96
128
  process_search_result(select_title, selections)
97
- return
98
-
129
+ return True
130
+
99
131
  # Get the user input for the search term
100
- string_to_search = get_user_input(string_to_search)
132
+ actual_search_query = get_user_input(string_to_search)
133
+
134
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
135
+ if not actual_search_query:
136
+ if bot:
137
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
138
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
139
+ return
101
140
 
102
141
  # Perform the database search
103
- len_database = title_search(quote_plus(string_to_search))
142
+ len_database = title_search(quote_plus(actual_search_query))
104
143
 
105
144
  # If only the database is needed, return the manager
106
145
  if get_onlyDatabase:
107
146
  return media_search_manager
108
-
109
- if site_constant.TELEGRAM_BOT:
110
- bot = get_bot_instance()
111
-
147
+
112
148
  if len_database > 0:
113
149
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
114
150
  process_search_result(select_title, selections)
151
+ return True
115
152
 
116
153
  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)
154
+ if bot:
155
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
156
+ else:
157
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
121
158
 
122
- # If no results are found, ask again
123
- string_to_search = get_user_input()
124
- search(string_to_search, get_onlyDatabase, None, selections)
159
+ # Do not call search() recursively here to avoid infinite loops on no results.
160
+ # The flow should return to the caller (e.g., main menu in run.py).
161
+ return
@@ -37,25 +37,39 @@ def get_user_input(string_to_search: str = None):
37
37
  """
38
38
  Asks the user to input a search term.
39
39
  Handles both Telegram bot input and direct input.
40
+ If string_to_search is provided, it's returned directly (after stripping).
40
41
  """
41
- if string_to_search is None:
42
- if site_constant.TELEGRAM_BOT:
43
- bot = get_bot_instance()
44
- string_to_search = bot.ask(
45
- "key_search",
46
- "Enter the search term\nor type 'back' to return to the menu: ",
47
- None
48
- )
49
-
50
- if string_to_search == 'back':
42
+ if string_to_search is not None:
43
+ return string_to_search.strip()
51
44
 
45
+ if site_constant.TELEGRAM_BOT:
46
+ bot = get_bot_instance()
47
+ user_response = bot.ask(
48
+ "key_search", # Request type
49
+ "Enter the search term\nor type 'back' to return to the menu: ",
50
+ None
51
+ )
52
+
53
+ if user_response is None:
54
+ bot.send_message("Timeout: No search term entered.", None)
55
+ return None
56
+
57
+ if user_response.lower() == 'back':
58
+ bot.send_message("Returning to the main menu...", None)
59
+
60
+ try:
52
61
  # Restart the script
53
62
  subprocess.Popen([sys.executable] + sys.argv)
54
63
  sys.exit()
55
- else:
56
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
57
-
58
- return string_to_search
64
+
65
+ except Exception as e:
66
+ bot.send_message(f"Error during restart attempt: {e}", None)
67
+ return None # Return None if restart fails
68
+
69
+ return user_response.strip()
70
+
71
+ else:
72
+ return msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
59
73
 
60
74
  def process_search_result(select_title, selections=None):
61
75
  """
@@ -65,9 +79,21 @@ def process_search_result(select_title, selections=None):
65
79
  select_title (MediaItem): The selected media item
66
80
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
67
81
  {'season': season_selection, 'episode': episode_selection}
82
+
83
+ Returns:
84
+ bool: True if processing was successful, False otherwise
68
85
  """
86
+ if not select_title:
87
+ if site_constant.TELEGRAM_BOT:
88
+ bot = get_bot_instance()
89
+ bot.send_message("No title selected or selection cancelled.", None)
90
+ else:
91
+ console.print("[yellow]No title selected or selection cancelled.")
92
+ return False
93
+
69
94
  if select_title.type == 'Movie':
70
95
  download_film(select_title)
96
+ return True
71
97
 
72
98
  else:
73
99
  season_selection = None
@@ -78,6 +104,7 @@ def process_search_result(select_title, selections=None):
78
104
  episode_selection = selections.get('episode')
79
105
 
80
106
  download_series(select_title, season_selection, episode_selection)
107
+ return True
81
108
 
82
109
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
83
110
  """
@@ -90,34 +117,43 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
90
117
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
91
118
  {'season': season_selection, 'episode': episode_selection}
92
119
  """
120
+ bot = None
121
+ if site_constant.TELEGRAM_BOT:
122
+ bot = get_bot_instance()
123
+
93
124
  if direct_item:
94
125
  select_title = MediaItem(**direct_item)
95
126
  process_search_result(select_title, selections)
96
- return
97
-
127
+ return True
128
+
98
129
  # Get the user input for the search term
99
- string_to_search = get_user_input(string_to_search)
130
+ actual_search_query = get_user_input(string_to_search)
100
131
 
132
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
133
+ if not actual_search_query:
134
+ if bot:
135
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
136
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
137
+ return
138
+
101
139
  # Perform the database search
102
- len_database = title_search(string_to_search)
140
+ len_database = title_search(actual_search_query)
103
141
 
104
142
  # If only the database is needed, return the manager
105
143
  if get_onlyDatabase:
106
144
  return media_search_manager
107
-
108
- if site_constant.TELEGRAM_BOT:
109
- bot = get_bot_instance()
110
145
 
111
146
  if len_database > 0:
112
- select_title = get_select_title(table_show_manager, media_search_manager,len_database)
147
+ select_title = get_select_title(table_show_manager, media_search_manager, len_database)
113
148
  process_search_result(select_title, selections)
149
+ return True
114
150
 
115
151
  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)
152
+ if bot:
153
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
154
+ else:
155
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
120
156
 
121
- # If no results are found, ask again
122
- string_to_search = get_user_input()
123
- search(string_to_search, get_onlyDatabase, None, selections)
157
+ # Do not call search() recursively here to avoid infinite loops on no results.
158
+ # The flow should return to the caller (e.g., main menu in run.py).
159
+ return
@@ -0,0 +1,154 @@
1
+ # 21.03.25
2
+
3
+ import sys
4
+ import subprocess
5
+
6
+
7
+ # External library
8
+ from rich.console import Console
9
+ from rich.prompt import Prompt
10
+
11
+
12
+ # Internal utilities
13
+ from StreamingCommunity.Api.Template import get_select_title
14
+ from StreamingCommunity.Api.Template.config_loader import site_constant
15
+ from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
16
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
17
+
18
+
19
+ # Logic class
20
+ from .site import title_search, media_search_manager, table_show_manager
21
+ from .serie import download_series
22
+ from .film import download_film
23
+
24
+
25
+ # Variable
26
+ indice = 6
27
+ _useFor = "Anime"
28
+ _priority = 0
29
+ _engineDownload = "mp4"
30
+ _deprecate = False
31
+
32
+ msg = Prompt()
33
+ console = Console()
34
+
35
+
36
+ def get_user_input(string_to_search: str = None):
37
+ """
38
+ Asks the user to input a search term.
39
+ Handles both Telegram bot input and direct input.
40
+ If string_to_search is provided, it's returned directly (after stripping).
41
+ """
42
+ if string_to_search is not None:
43
+ return string_to_search.strip()
44
+
45
+ if site_constant.TELEGRAM_BOT:
46
+ bot = get_bot_instance()
47
+ user_response = bot.ask(
48
+ "key_search", # Request type
49
+ "Enter the search term\nor type 'back' to return to the menu: ",
50
+ None
51
+ )
52
+
53
+ if user_response is None:
54
+ bot.send_message("Timeout: No search term entered.", None)
55
+ return None
56
+
57
+ if user_response.lower() == 'back':
58
+ bot.send_message("Returning to the main menu...", None)
59
+
60
+ try:
61
+ # Restart the script
62
+ subprocess.Popen([sys.executable] + sys.argv)
63
+ sys.exit()
64
+
65
+ except Exception as e:
66
+ bot.send_message(f"Error during restart attempt: {e}", None)
67
+ return None # Return None if restart fails
68
+
69
+ return user_response.strip()
70
+
71
+ else:
72
+ return msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
73
+
74
+ def process_search_result(select_title, selections=None):
75
+ """
76
+ Handles the search result and initiates the download for either a film or series.
77
+
78
+ Parameters:
79
+ select_title (MediaItem): The selected media item
80
+ selections (dict, optional): Dictionary containing selection inputs that bypass manual input
81
+ {'season': season_selection, 'episode': episode_selection}
82
+
83
+ Returns:
84
+ bool: True if processing was successful, False otherwise
85
+ """
86
+ if not select_title:
87
+ if site_constant.TELEGRAM_BOT:
88
+ bot = get_bot_instance()
89
+ bot.send_message("No title selected or selection cancelled.", None)
90
+ else:
91
+ console.print("[yellow]No title selected or selection cancelled.")
92
+ return False
93
+
94
+ if select_title.type == "TV":
95
+ episode_selection = None
96
+ if selections:
97
+ episode_selection = selections.get('episode')
98
+ download_series(select_title, episode_selection)
99
+ return True
100
+
101
+ else:
102
+ download_film(select_title)
103
+ return True
104
+
105
+ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
106
+ """
107
+ Main function of the application for search.
108
+
109
+ Parameters:
110
+ string_to_search (str, optional): String to search for
111
+ get_onlyDatabase (bool, optional): If True, return only the database object
112
+ direct_item (dict, optional): Direct item to process (bypass search)
113
+ selections (dict, optional): Dictionary containing selection inputs that bypass manual input
114
+ {'season': season_selection, 'episode': episode_selection}
115
+ """
116
+ bot = None
117
+ if site_constant.TELEGRAM_BOT:
118
+ bot = get_bot_instance()
119
+
120
+ if direct_item:
121
+ select_title = MediaItem(**direct_item)
122
+ process_search_result(select_title, selections)
123
+ return True
124
+
125
+ # Get the user input for the search term
126
+ actual_search_query = get_user_input(string_to_search)
127
+
128
+ # Perform the database search
129
+ if not actual_search_query:
130
+ if bot:
131
+ if actual_search_query is None:
132
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
133
+ return
134
+
135
+ len_database = title_search(actual_search_query)
136
+
137
+ # If only the database is needed, return the manager
138
+ if get_onlyDatabase:
139
+ return media_search_manager
140
+
141
+ if len_database > 0:
142
+ select_title = get_select_title(table_show_manager, media_search_manager, len_database)
143
+ process_search_result(select_title, selections)
144
+ return True
145
+
146
+ else:
147
+ if bot:
148
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
149
+ else:
150
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
151
+
152
+ # Do not call search() recursively here to avoid infinite loops on no results.
153
+ # The flow should return to the caller (e.g., main menu in run.py).
154
+ return
@@ -1,5 +1,7 @@
1
1
  # 16.03.25
2
2
 
3
+ import sys
4
+ import subprocess
3
5
  from urllib.parse import quote_plus
4
6
 
5
7
 
@@ -12,6 +14,7 @@ from rich.prompt import Prompt
12
14
  from StreamingCommunity.Api.Template import get_select_title
13
15
  from StreamingCommunity.Api.Template.config_loader import site_constant
14
16
  from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
17
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
15
18
 
16
19
 
17
20
  # Logic class
@@ -19,6 +22,7 @@ from .site import title_search, table_show_manager, media_search_manager
19
22
  from .film import download_film
20
23
  from .series import download_series
21
24
 
25
+
22
26
  # Variable
23
27
  indice = 8
24
28
  _useFor = "Anime"
@@ -34,11 +38,39 @@ def get_user_input(string_to_search: str = None):
34
38
  """
35
39
  Asks the user to input a search term.
36
40
  Handles both Telegram bot input and direct input.
41
+ If string_to_search is provided, it's returned directly (after stripping).
37
42
  """
38
- if string_to_search is None:
39
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
40
-
41
- return string_to_search
43
+ if string_to_search is not None:
44
+ return string_to_search.strip()
45
+
46
+ if site_constant.TELEGRAM_BOT:
47
+ bot = get_bot_instance()
48
+ user_response = bot.ask(
49
+ "key_search", # Request type
50
+ "Enter the search term\nor type 'back' to return to the menu: ",
51
+ None
52
+ )
53
+
54
+ if user_response is None:
55
+ bot.send_message("Timeout: No search term entered.", None)
56
+ return None
57
+
58
+ if user_response.lower() == 'back':
59
+ bot.send_message("Returning to the main menu...", None)
60
+
61
+ try:
62
+ # Restart the script
63
+ subprocess.Popen([sys.executable] + sys.argv)
64
+ sys.exit()
65
+
66
+ except Exception as e:
67
+ bot.send_message(f"Error during restart attempt: {e}", None)
68
+ return None # Return None if restart fails
69
+
70
+ return user_response.strip()
71
+
72
+ else:
73
+ return msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
42
74
 
43
75
  def process_search_result(select_title, selections=None):
44
76
  """
@@ -48,7 +80,18 @@ def process_search_result(select_title, selections=None):
48
80
  select_title (MediaItem): The selected media item
49
81
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
50
82
  {'season': season_selection, 'episode': episode_selection}
83
+
84
+ Returns:
85
+ bool: True if processing was successful, False otherwise
51
86
  """
87
+ if not select_title:
88
+ if site_constant.TELEGRAM_BOT:
89
+ bot = get_bot_instance()
90
+ bot.send_message("No title selected or selection cancelled.", None)
91
+ else:
92
+ console.print("[yellow]No title selected or selection cancelled.")
93
+ return False
94
+
52
95
  if select_title.type == 'tv':
53
96
  season_selection = None
54
97
  episode_selection = None
@@ -58,10 +101,12 @@ def process_search_result(select_title, selections=None):
58
101
  episode_selection = selections.get('episode')
59
102
 
60
103
  download_series(select_title, season_selection, episode_selection)
104
+ return True
61
105
 
62
106
  else:
63
107
  download_film(select_title)
64
-
108
+ return True
109
+
65
110
  # search("Game of Thrones", selections={"season": "1", "episode": "1-3"})
66
111
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
67
112
  """
@@ -69,33 +114,48 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
69
114
 
70
115
  Parameters:
71
116
  string_to_search (str, optional): String to search for
72
- get_onylDatabase (bool, optional): If True, return only the database object
117
+ get_onlyDatabase (bool, optional): If True, return only the database object
73
118
  direct_item (dict, optional): Direct item to process (bypass search)
74
119
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
75
120
  {'season': season_selection, 'episode': episode_selection}
76
121
  """
122
+ bot = None
123
+ if site_constant.TELEGRAM_BOT:
124
+ bot = get_bot_instance()
125
+
77
126
  if direct_item:
78
127
  select_title = MediaItem(**direct_item)
79
128
  process_search_result(select_title, selections)
80
- return
129
+ return True
81
130
 
82
131
  # Get the user input for the search term
83
- string_to_search = get_user_input(string_to_search)
132
+ actual_search_query = get_user_input(string_to_search)
133
+
134
+ # Handle cases where user input is empty, or 'back' was handled (sys.exit or None return)
135
+ if not actual_search_query:
136
+ if bot:
137
+ if actual_search_query is None: # Specifically for timeout from bot.ask or failed restart
138
+ bot.send_message("Search term not provided or operation cancelled. Returning.", None)
139
+ return
84
140
 
85
141
  # Perform the database search
86
- len_database = title_search(quote_plus(string_to_search))
142
+ len_database = title_search(quote_plus(actual_search_query))
87
143
 
88
144
  # If only the database is needed, return the manager
89
145
  if get_onlyDatabase:
90
146
  return media_search_manager
91
-
147
+
92
148
  if len_database > 0:
93
149
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
94
150
  process_search_result(select_title, selections)
151
+ return True
95
152
 
96
153
  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)
154
+ if bot:
155
+ bot.send_message(f"No results found for: '{actual_search_query}'", None)
156
+ else:
157
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{actual_search_query}")
158
+
159
+ # Do not call search() recursively here to avoid infinite loops on no results.
160
+ # The flow should return to the caller (e.g., main menu in run.py).
161
+ return