StreamingCommunity 3.3.0__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 (119) hide show
  1. {streamingcommunity-3.3.0/StreamingCommunity.egg-info → streamingcommunity-3.3.1}/PKG-INFO +2 -11
  2. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/README.md +1 -11
  3. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/__init__.py +37 -17
  4. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/__init__.py +36 -16
  5. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/__init__.py +50 -6
  6. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/__init__.py +42 -16
  7. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/site.py +1 -1
  8. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/guardaserie/__init__.py +50 -6
  9. {streamingcommunity-3.3.0/StreamingCommunity/Api/Site/streamingwatch → streamingcommunity-3.3.1/StreamingCommunity/Api/Site/mediasetinfinity}/__init__.py +158 -127
  10. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/film.py +1 -1
  11. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/site.py +6 -3
  12. {streamingcommunity-3.3.0 → 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.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/__init__.py +45 -14
  15. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/series.py +9 -5
  16. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +7 -2
  17. streamingcommunity-3.3.1/StreamingCommunity/Api/Site/streamingwatch/__init__.py +158 -0
  18. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/downloader.py +87 -55
  19. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/HLS/downloader.py +18 -6
  20. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/HLS/segments.py +1 -1
  21. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/command.py +66 -7
  22. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/util.py +16 -13
  23. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Upload/version.py +1 -1
  24. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1/StreamingCommunity.egg-info}/PKG-INFO +2 -11
  25. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/requires.txt +1 -0
  26. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/requirements.txt +2 -1
  27. streamingcommunity-3.3.0/StreamingCommunity/Api/Site/mediasetinfinity/__init__.py +0 -121
  28. streamingcommunity-3.3.0/StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py +0 -185
  29. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/LICENSE +0 -0
  30. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/MANIFEST.in +0 -0
  31. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -0
  32. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +0 -0
  33. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/ddl.py +0 -0
  34. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/hdplayer.py +0 -0
  35. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/maxstream.py +0 -0
  36. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/mediapolisvod.py +0 -0
  37. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/mixdrop.py +0 -0
  38. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/supervideo.py +0 -0
  39. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/sweetpixel.py +0 -0
  40. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Player/vixcloud.py +0 -0
  41. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/film.py +0 -0
  42. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/series.py +0 -0
  43. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/site.py +0 -0
  44. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/altadefinizione/util/ScrapeSerie.py +0 -0
  45. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/film.py +0 -0
  46. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/serie.py +0 -0
  47. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/site.py +0 -0
  48. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +0 -0
  49. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/film.py +0 -0
  50. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/serie.py +0 -0
  51. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/site.py +0 -0
  52. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py +0 -0
  53. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/film.py +0 -0
  54. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/series.py +0 -0
  55. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/util/ScrapeSerie.py +0 -0
  56. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/crunchyroll/util/get_license.py +0 -0
  57. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/guardaserie/series.py +0 -0
  58. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/guardaserie/site.py +0 -0
  59. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -0
  60. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/series.py +0 -0
  61. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/mediasetinfinity/util/fix_mpd.py +0 -0
  62. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/film.py +0 -0
  63. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/site.py +0 -0
  64. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py +0 -0
  65. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/raiplay/util/get_license.py +0 -0
  66. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/film.py +0 -0
  67. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/series.py +0 -0
  68. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/site.py +0 -0
  69. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +0 -0
  70. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/film.py +0 -0
  71. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/series.py +0 -0
  72. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/site.py +0 -0
  73. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Site/streamingwatch/util/ScrapeSerie.py +0 -0
  74. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/Class/SearchType.py +0 -0
  75. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/Util/__init__.py +0 -0
  76. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/Util/manage_ep.py +0 -0
  77. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/__init__.py +0 -0
  78. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/config_loader.py +0 -0
  79. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Api/Template/site.py +0 -0
  80. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/cdm_helpher.py +0 -0
  81. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/decrypt.py +0 -0
  82. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/parser.py +0 -0
  83. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/DASH/segments.py +0 -0
  84. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/MP4/downloader.py +0 -0
  85. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -0
  86. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/Downloader/__init__.py +0 -0
  87. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/__init__.py +0 -0
  88. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/FFmpeg/capture.py +0 -0
  89. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/__init__.py +0 -0
  90. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/decryptor.py +0 -0
  91. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/estimator.py +0 -0
  92. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/parser.py +0 -0
  93. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/M3U8/url_fixer.py +0 -0
  94. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/TMBD/__init__.py +0 -0
  95. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -0
  96. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Lib/TMBD/tmdb.py +0 -0
  97. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/TelegramHelp/__init__.py +0 -0
  98. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/TelegramHelp/config.json +0 -0
  99. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/TelegramHelp/telegram_bot.py +0 -0
  100. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Upload/update.py +0 -0
  101. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/bento4_installer.py +0 -0
  102. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/color.py +0 -0
  103. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/config_json.py +0 -0
  104. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/ffmpeg_installer.py +0 -0
  105. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/headers.py +0 -0
  106. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/http_client.py +0 -0
  107. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/logger.py +0 -0
  108. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/message.py +0 -0
  109. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/os.py +0 -0
  110. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/Util/table.py +0 -0
  111. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/__init__.py +0 -0
  112. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/global_search.py +0 -0
  113. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity/run.py +0 -0
  114. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/SOURCES.txt +0 -0
  115. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/dependency_links.txt +0 -0
  116. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/entry_points.txt +0 -0
  117. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/StreamingCommunity.egg-info/top_level.txt +0 -0
  118. {streamingcommunity-3.3.0 → streamingcommunity-3.3.1}/setup.cfg +0 -0
  119. {streamingcommunity-3.3.0 → 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.3.0
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
@@ -906,10 +907,6 @@ python3 telegram_bot.py
906
907
  ```
907
908
  </details>
908
909
 
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
-
913
910
  # Tutorials
914
911
 
915
912
  - [Windows](https://www.youtube.com/watch?v=mZGqK4wdN-k)
@@ -917,17 +914,11 @@ See [guide.md](.github/.site/guide.md) for instructions on how to obtain it.
917
914
  - [Pypy](https://www.youtube.com/watch?v=C6m9ZKOK0p4)
918
915
  - [Compiled](https://www.youtube.com/watch?v=pm4lqsxkTVo)
919
916
 
920
- # To Do
921
-
922
- - To Finish [website API](https://github.com/Arrowar/StreamingCommunity/tree/test_gui_1)
923
- - To finish [website API 2](https://github.com/hydrosh/StreamingCommunity/tree/test_gui_1)
924
-
925
917
  ## Useful Project
926
918
 
927
919
  ### 🎯 [Unit3Dup](https://github.com/31December99/Unit3Dup)
928
920
  Bot in Python per la generazione e l'upload automatico di torrent su tracker basati su Unit3D.
929
921
 
930
-
931
922
  ### 🇮🇹 [MammaMia](https://github.com/UrloMythus/MammaMia)
932
923
  Addon per Stremio che consente lo streaming HTTPS di film, serie, anime e TV in diretta in lingua italiana.
933
924
 
@@ -869,10 +869,6 @@ 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
-
876
872
  # Tutorials
877
873
 
878
874
  - [Windows](https://www.youtube.com/watch?v=mZGqK4wdN-k)
@@ -880,17 +876,11 @@ See [guide.md](.github/.site/guide.md) for instructions on how to obtain it.
880
876
  - [Pypy](https://www.youtube.com/watch?v=C6m9ZKOK0p4)
881
877
  - [Compiled](https://www.youtube.com/watch?v=pm4lqsxkTVo)
882
878
 
883
- # To Do
884
-
885
- - To Finish [website API](https://github.com/Arrowar/StreamingCommunity/tree/test_gui_1)
886
- - To finish [website API 2](https://github.com/hydrosh/StreamingCommunity/tree/test_gui_1)
887
-
888
879
  ## Useful Project
889
880
 
890
881
  ### 🎯 [Unit3Dup](https://github.com/31December99/Unit3Dup)
891
882
  Bot in Python per la generazione e l'upload automatico di torrent su tracker basati su Unit3D.
892
883
 
893
-
894
884
  ### 🇮🇹 [MammaMia](https://github.com/UrloMythus/MammaMia)
895
885
  Addon per Stremio che consente lo streaming HTTPS di film, serie, anime e TV in diretta in lingua italiana.
896
886
 
@@ -901,4 +891,4 @@ API non ufficiale per accedere ai contenuti del sito italiano StreamingCommunity
901
891
 
902
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.
903
893
 
904
- > **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.
@@ -38,25 +38,39 @@ def get_user_input(string_to_search: str = None):
38
38
  """
39
39
  Asks the user to input a search term.
40
40
  Handles both Telegram bot input and direct input.
41
+ If string_to_search is provided, it's returned directly (after stripping).
41
42
  """
42
- if string_to_search is None:
43
- if site_constant.TELEGRAM_BOT:
44
- bot = get_bot_instance()
45
- string_to_search = bot.ask(
46
- "key_search",
47
- "Enter the search term\nor type 'back' to return to the menu: ",
48
- None
49
- )
50
-
51
- if string_to_search == 'back':
43
+ if string_to_search is not None:
44
+ return string_to_search.strip()
52
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:
53
62
  # Restart the script
54
63
  subprocess.Popen([sys.executable] + sys.argv)
55
64
  sys.exit()
56
- else:
57
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
58
-
59
- 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()
60
74
 
61
75
  def process_search_result(select_title, selections=None):
62
76
  """
@@ -66,6 +80,9 @@ def process_search_result(select_title, selections=None):
66
80
  select_title (MediaItem): The selected media item
67
81
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
68
82
  {'season': season_selection, 'episode': episode_selection}
83
+
84
+ Returns:
85
+ bool: True if processing was successful, False otherwise
69
86
  """
70
87
  if not select_title:
71
88
  if site_constant.TELEGRAM_BOT:
@@ -73,7 +90,7 @@ def process_search_result(select_title, selections=None):
73
90
  bot.send_message("No title selected or selection cancelled.", None)
74
91
  else:
75
92
  console.print("[yellow]No title selected or selection cancelled.")
76
- return
93
+ return False
77
94
 
78
95
  if select_title.type == 'tv':
79
96
  season_selection = None
@@ -84,9 +101,11 @@ def process_search_result(select_title, selections=None):
84
101
  episode_selection = selections.get('episode')
85
102
 
86
103
  download_series(select_title, season_selection, episode_selection)
104
+ return True
87
105
 
88
106
  else:
89
107
  download_film(select_title)
108
+ return True
90
109
 
91
110
  # search("Game of Thrones", selections={"season": "1", "episode": "1-3"})
92
111
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
@@ -107,8 +126,8 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
107
126
  if direct_item:
108
127
  select_title = MediaItem(**direct_item)
109
128
  process_search_result(select_title, selections)
110
- return
111
-
129
+ return True
130
+
112
131
  # Get the user input for the search term
113
132
  actual_search_query = get_user_input(string_to_search)
114
133
 
@@ -129,6 +148,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
129
148
  if len_database > 0:
130
149
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
131
150
  process_search_result(select_title, selections)
151
+ return True
132
152
 
133
153
  else:
134
154
  if bot:
@@ -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,6 +79,9 @@ 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
  """
69
86
  if not select_title:
70
87
  if site_constant.TELEGRAM_BOT:
@@ -72,10 +89,11 @@ def process_search_result(select_title, selections=None):
72
89
  bot.send_message("No title selected or selection cancelled.", None)
73
90
  else:
74
91
  console.print("[yellow]No title selected or selection cancelled.")
75
- return
92
+ return False
76
93
 
77
94
  if select_title.type == 'Movie':
78
95
  download_film(select_title)
96
+ return True
79
97
 
80
98
  else:
81
99
  season_selection = None
@@ -86,6 +104,7 @@ def process_search_result(select_title, selections=None):
86
104
  episode_selection = selections.get('episode')
87
105
 
88
106
  download_series(select_title, season_selection, episode_selection)
107
+ return True
89
108
 
90
109
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
91
110
  """
@@ -105,7 +124,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
105
124
  if direct_item:
106
125
  select_title = MediaItem(**direct_item)
107
126
  process_search_result(select_title, selections)
108
- return
127
+ return True
109
128
 
110
129
  # Get the user input for the search term
111
130
  actual_search_query = get_user_input(string_to_search)
@@ -127,6 +146,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
127
146
  if len_database > 0:
128
147
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
129
148
  process_search_result(select_title, selections)
149
+ return True
130
150
 
131
151
  else:
132
152
  if bot:
@@ -1,5 +1,9 @@
1
1
  # 21.03.25
2
2
 
3
+ import sys
4
+ import subprocess
5
+
6
+
3
7
  # External library
4
8
  from rich.console import Console
5
9
  from rich.prompt import Prompt
@@ -29,7 +33,44 @@ msg = Prompt()
29
33
  console = Console()
30
34
 
31
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()
32
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
+
33
74
  def process_search_result(select_title, selections=None):
34
75
  """
35
76
  Handles the search result and initiates the download for either a film or series.
@@ -38,6 +79,9 @@ def process_search_result(select_title, selections=None):
38
79
  select_title (MediaItem): The selected media item
39
80
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
40
81
  {'season': season_selection, 'episode': episode_selection}
82
+
83
+ Returns:
84
+ bool: True if processing was successful, False otherwise
41
85
  """
42
86
  if not select_title:
43
87
  if site_constant.TELEGRAM_BOT:
@@ -45,16 +89,18 @@ def process_search_result(select_title, selections=None):
45
89
  bot.send_message("No title selected or selection cancelled.", None)
46
90
  else:
47
91
  console.print("[yellow]No title selected or selection cancelled.")
48
- return
92
+ return False
49
93
 
50
94
  if select_title.type == "TV":
51
95
  episode_selection = None
52
96
  if selections:
53
97
  episode_selection = selections.get('episode')
54
98
  download_series(select_title, episode_selection)
99
+ return True
55
100
 
56
101
  else:
57
102
  download_film(select_title)
103
+ return True
58
104
 
59
105
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
60
106
  """
@@ -74,13 +120,10 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
74
120
  if direct_item:
75
121
  select_title = MediaItem(**direct_item)
76
122
  process_search_result(select_title, selections)
77
- return
123
+ return True
78
124
 
79
125
  # Get the user input for the search term
80
- if string_to_search is None:
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
126
+ actual_search_query = get_user_input(string_to_search)
84
127
 
85
128
  # Perform the database search
86
129
  if not actual_search_query:
@@ -98,6 +141,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
98
141
  if len_database > 0:
99
142
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
100
143
  process_search_result(select_title, selections)
144
+ return True
101
145
 
102
146
  else:
103
147
  if bot:
@@ -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
 
@@ -36,11 +38,39 @@ def get_user_input(string_to_search: str = None):
36
38
  """
37
39
  Asks the user to input a search term.
38
40
  Handles both Telegram bot input and direct input.
41
+ If string_to_search is provided, it's returned directly (after stripping).
39
42
  """
40
- if string_to_search is None:
41
- string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
43
+ if string_to_search is not None:
44
+ return string_to_search.strip()
42
45
 
43
- return string_to_search
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()
44
74
 
45
75
  def process_search_result(select_title, selections=None):
46
76
  """
@@ -50,6 +80,9 @@ def process_search_result(select_title, selections=None):
50
80
  select_title (MediaItem): The selected media item
51
81
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
52
82
  {'season': season_selection, 'episode': episode_selection}
83
+
84
+ Returns:
85
+ bool: True if processing was successful, False otherwise
53
86
  """
54
87
  if not select_title:
55
88
  if site_constant.TELEGRAM_BOT:
@@ -57,7 +90,7 @@ def process_search_result(select_title, selections=None):
57
90
  bot.send_message("No title selected or selection cancelled.", None)
58
91
  else:
59
92
  console.print("[yellow]No title selected or selection cancelled.")
60
- return
93
+ return False
61
94
 
62
95
  if select_title.type == 'tv':
63
96
  season_selection = None
@@ -68,25 +101,17 @@ def process_search_result(select_title, selections=None):
68
101
  episode_selection = selections.get('episode')
69
102
 
70
103
  download_series(select_title, season_selection, episode_selection)
104
+ return True
71
105
 
72
106
  else:
73
107
  download_film(select_title)
74
-
108
+ return True
109
+
75
110
  # search("Game of Thrones", selections={"season": "1", "episode": "1-3"})
76
111
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
77
112
  """
78
113
  Main function of the application for search.
79
114
 
80
- Parameters:
81
- string_to_search (str, optional): String to search for
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
115
  Parameters:
91
116
  string_to_search (str, optional): String to search for
92
117
  get_onlyDatabase (bool, optional): If True, return only the database object
@@ -101,7 +126,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
101
126
  if direct_item:
102
127
  select_title = MediaItem(**direct_item)
103
128
  process_search_result(select_title, selections)
104
- return
129
+ return True
105
130
 
106
131
  # Get the user input for the search term
107
132
  actual_search_query = get_user_input(string_to_search)
@@ -123,6 +148,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
123
148
  if len_database > 0:
124
149
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
125
150
  process_search_result(select_title, selections)
151
+ return True
126
152
 
127
153
  else:
128
154
  if bot:
@@ -50,7 +50,7 @@ def title_search(query: str) -> int:
50
50
 
51
51
  # Check if x_cr_tab_id or etp_rt is present
52
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]")
53
+ console.print("[bold red] x_cr_tab_id or etp_rt is missing or empty.[/bold red]")
54
54
  sys.exit(0)
55
55
 
56
56
  # Build new Crunchyroll API search URL
@@ -1,5 +1,7 @@
1
1
  # 09.06.24
2
2
 
3
+ import sys
4
+ import subprocess
3
5
  from urllib.parse import quote_plus
4
6
 
5
7
 
@@ -31,6 +33,44 @@ msg = Prompt()
31
33
  console = Console()
32
34
 
33
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
+
34
74
  def process_search_result(select_title, selections=None):
35
75
  """
36
76
  Handles the search result and initiates the download for either a film or series.
@@ -39,6 +79,9 @@ def process_search_result(select_title, selections=None):
39
79
  select_title (MediaItem): The selected media item
40
80
  selections (dict, optional): Dictionary containing selection inputs that bypass manual input
41
81
  {'season': season_selection, 'episode': episode_selection}
82
+
83
+ Returns:
84
+ bool: True if processing was successful, False otherwise
42
85
  """
43
86
  if not select_title:
44
87
  if site_constant.TELEGRAM_BOT:
@@ -46,7 +89,7 @@ def process_search_result(select_title, selections=None):
46
89
  bot.send_message("No title selected or selection cancelled.", None)
47
90
  else:
48
91
  console.print("[yellow]No title selected or selection cancelled.")
49
- return
92
+ return False
50
93
 
51
94
  season_selection = None
52
95
  episode_selection = None
@@ -56,6 +99,7 @@ def process_search_result(select_title, selections=None):
56
99
  episode_selection = selections.get('episode')
57
100
 
58
101
  download_series(select_title, season_selection, episode_selection)
102
+ return True
59
103
 
60
104
  def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None, selections: dict = None):
61
105
  """
@@ -79,12 +123,10 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
79
123
  if direct_item:
80
124
  select_title = MediaItem(**direct_item)
81
125
  process_search_result(select_title, selections)
82
- return
126
+ return True
83
127
 
84
- if string_to_search is None:
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
128
+ # Get the user input for the search term
129
+ actual_search_query = get_user_input(string_to_search)
88
130
 
89
131
  # Handle empty input
90
132
  if not actual_search_query:
@@ -103,6 +145,8 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
103
145
  if len_database > 0:
104
146
  select_title = get_select_title(table_show_manager, media_search_manager, len_database)
105
147
  process_search_result(select_title, selections)
148
+ return True
149
+
106
150
  else:
107
151
  if bot:
108
152
  bot.send_message(f"No results found for: '{actual_search_query}'", None)