StreamingCommunity 2.9.4__tar.gz → 2.9.5__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 (91) hide show
  1. {streamingcommunity-2.9.4/StreamingCommunity.egg-info → streamingcommunity-2.9.5}/PKG-INFO +39 -10
  2. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/README.md +38 -9
  3. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/1337xx/__init__.py +26 -12
  4. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/1337xx/site.py +2 -1
  5. streamingcommunity-2.9.5/StreamingCommunity/Api/Site/altadefinizione/__init__.py +108 -0
  6. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/altadefinizione/film.py +31 -1
  7. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/altadefinizione/series.py +53 -8
  8. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/altadefinizione/site.py +22 -4
  9. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/altadefinizione/util/ScrapeSerie.py +2 -2
  10. streamingcommunity-2.9.5/StreamingCommunity/Api/Site/animeunity/__init__.py +104 -0
  11. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/animeunity/film_serie.py +5 -1
  12. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/animeunity/site.py +0 -2
  13. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/cb01new/__init__.py +26 -14
  14. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/cb01new/site.py +7 -5
  15. streamingcommunity-2.9.5/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +75 -0
  16. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/guardaserie/__init__.py +23 -11
  17. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/guardaserie/site.py +2 -1
  18. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/mostraguarda/__init__.py +27 -7
  19. streamingcommunity-2.9.5/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +109 -0
  20. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/streamingcommunity/series.py +5 -1
  21. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/streamingcommunity/site.py +4 -0
  22. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/Downloader/HLS/segments.py +1 -1
  23. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/Downloader/MP4/downloader.py +7 -6
  24. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Upload/version.py +1 -1
  25. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/config_json.py +2 -8
  26. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/table.py +12 -2
  27. streamingcommunity-2.9.5/StreamingCommunity/global_search.py +315 -0
  28. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/run.py +27 -3
  29. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5/StreamingCommunity.egg-info}/PKG-INFO +39 -10
  30. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity.egg-info/SOURCES.txt +1 -0
  31. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/setup.py +1 -1
  32. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/altadefinizione/__init__.py +0 -61
  33. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/animeunity/__init__.py +0 -83
  34. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +0 -64
  35. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +0 -86
  36. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/LICENSE +0 -0
  37. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/MANIFEST.in +0 -0
  38. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -0
  39. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +0 -0
  40. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Player/ddl.py +0 -0
  41. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Player/maxstream.py +0 -0
  42. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Player/supervideo.py +0 -0
  43. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Player/vixcloud.py +0 -0
  44. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/1337xx/title.py +0 -0
  45. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +0 -0
  46. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/cb01new/film.py +0 -0
  47. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/ddlstreamitaly/series.py +0 -0
  48. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/ddlstreamitaly/site.py +0 -0
  49. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +0 -0
  50. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/guardaserie/series.py +0 -0
  51. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -0
  52. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/mostraguarda/film.py +0 -0
  53. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/streamingcommunity/film.py +0 -0
  54. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +0 -0
  55. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Template/Class/SearchType.py +0 -0
  56. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Template/Util/__init__.py +0 -0
  57. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Template/Util/manage_ep.py +0 -0
  58. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Template/__init__.py +0 -0
  59. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Template/config_loader.py +0 -0
  60. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Api/Template/site.py +0 -0
  61. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/Downloader/HLS/downloader.py +0 -0
  62. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -0
  63. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/Downloader/__init__.py +0 -0
  64. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/FFmpeg/__init__.py +0 -0
  65. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/FFmpeg/capture.py +0 -0
  66. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/FFmpeg/command.py +0 -0
  67. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/FFmpeg/util.py +0 -0
  68. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/M3U8/__init__.py +0 -0
  69. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/M3U8/decryptor.py +0 -0
  70. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/M3U8/estimator.py +0 -0
  71. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/M3U8/parser.py +0 -0
  72. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/M3U8/url_fixer.py +0 -0
  73. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/TMBD/__init__.py +0 -0
  74. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -0
  75. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Lib/TMBD/tmdb.py +0 -0
  76. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/TelegramHelp/__init__.py +0 -0
  77. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/TelegramHelp/telegram_bot.py +0 -0
  78. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Upload/update.py +0 -0
  79. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/color.py +0 -0
  80. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/ffmpeg_installer.py +0 -0
  81. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/headers.py +0 -0
  82. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/logger.py +0 -0
  83. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/message.py +0 -0
  84. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/Util/os.py +0 -0
  85. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity/__init__.py +0 -0
  86. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity.egg-info/dependency_links.txt +0 -0
  87. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity.egg-info/entry_points.txt +0 -0
  88. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity.egg-info/requires.txt +0 -0
  89. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/StreamingCommunity.egg-info/top_level.txt +0 -0
  90. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/requirements.txt +0 -0
  91. {streamingcommunity-2.9.4 → streamingcommunity-2.9.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: StreamingCommunity
3
- Version: 2.9.4
3
+ Version: 2.9.5
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
@@ -79,6 +79,7 @@ Dynamic: requires-python
79
79
  - 📥 [Download](#m3u8_download-settings)
80
80
  - 🔍 [Parser](#m3u8_parser-settings)
81
81
  - 📝 [Command](#command)
82
+ - 🔍 [Global search](#global-search)
82
83
  - 💻 [Examples of terminal](#examples-of-terminal-usage)
83
84
  - 🔧 [Manual domain configuration](#update-domains)
84
85
  - 🐳 [Docker](#docker)
@@ -668,19 +669,44 @@ The API-based domain updates are currently deprecated. To use it anyway, set `us
668
669
 
669
670
  Note: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.
670
671
 
671
- # COMMAND
672
+ #### 💡 Adding a New Site to the Legacy API
673
+ If you want to add a new site to the legacy API, just message me on the Discord server, and I'll add it!
672
674
 
673
- - Download a specific season by entering its number.
674
- * **Example:** `1` will download *Season 1* only.
675
+ # Global Search
675
676
 
676
- - Use the wildcard `*` to download every available season.
677
- * **Example:** `*` will download all seasons in the series.
677
+ You can now search across multiple streaming sites at once using the Global Search feature. This allows you to find content more efficiently without having to search each site individually.
678
678
 
679
- - Specify a range of seasons using a hyphen `-`.
680
- * **Example:** `1-2` will download *Seasons 1 and 2*.
679
+ ## Using Global Search
681
680
 
682
- - Enter a season number followed by `-*` to download from that season to the end.
683
- * **Example:** `3-*` will download from *Season 3* to the final season.
681
+ The Global Search feature provides a unified interface to search across all supported sites:
682
+
683
+ ## Search Options
684
+
685
+ When using Global Search, you have three ways to select which sites to search:
686
+
687
+ 1. **Search all sites** - Searches across all available streaming sites
688
+ 2. **Search by category** - Group sites by their categories (movies, series, anime, etc.)
689
+ 3. **Select specific sites** - Choose individual sites to include in your search
690
+
691
+ ## Navigation and Selection
692
+
693
+ After performing a search:
694
+
695
+ 1. Results are displayed in a consolidated table showing:
696
+ - Title
697
+ - Media type (movie, TV series, etc.)
698
+ - Source site
699
+
700
+ 2. Select an item by number to view details or download
701
+
702
+ 3. The system will automatically use the appropriate site's API to handle the download
703
+
704
+ ## Command Line Arguments
705
+
706
+ The Global Search can be configured from the command line:
707
+
708
+ - `--global` - Perform a global search across multiple sites.
709
+ - `-s`, `--search` - Specify the search terms.
684
710
 
685
711
  # Examples of terminal usage
686
712
 
@@ -693,6 +719,9 @@ python test_run.py --specific_list_audio ita,eng --specific_list_subtitles eng,s
693
719
 
694
720
  # Keep console open after download
695
721
  python test_run.py --not_close true
722
+
723
+ # Use global search
724
+ python test_run.py --global -s "cars"
696
725
  ```
697
726
 
698
727
  # Docker
@@ -45,6 +45,7 @@
45
45
  - 📥 [Download](#m3u8_download-settings)
46
46
  - 🔍 [Parser](#m3u8_parser-settings)
47
47
  - 📝 [Command](#command)
48
+ - 🔍 [Global search](#global-search)
48
49
  - 💻 [Examples of terminal](#examples-of-terminal-usage)
49
50
  - 🔧 [Manual domain configuration](#update-domains)
50
51
  - 🐳 [Docker](#docker)
@@ -634,19 +635,44 @@ The API-based domain updates are currently deprecated. To use it anyway, set `us
634
635
 
635
636
  Note: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.
636
637
 
637
- # COMMAND
638
+ #### 💡 Adding a New Site to the Legacy API
639
+ If you want to add a new site to the legacy API, just message me on the Discord server, and I'll add it!
638
640
 
639
- - Download a specific season by entering its number.
640
- * **Example:** `1` will download *Season 1* only.
641
+ # Global Search
641
642
 
642
- - Use the wildcard `*` to download every available season.
643
- * **Example:** `*` will download all seasons in the series.
643
+ You can now search across multiple streaming sites at once using the Global Search feature. This allows you to find content more efficiently without having to search each site individually.
644
644
 
645
- - Specify a range of seasons using a hyphen `-`.
646
- * **Example:** `1-2` will download *Seasons 1 and 2*.
645
+ ## Using Global Search
647
646
 
648
- - Enter a season number followed by `-*` to download from that season to the end.
649
- * **Example:** `3-*` will download from *Season 3* to the final season.
647
+ The Global Search feature provides a unified interface to search across all supported sites:
648
+
649
+ ## Search Options
650
+
651
+ When using Global Search, you have three ways to select which sites to search:
652
+
653
+ 1. **Search all sites** - Searches across all available streaming sites
654
+ 2. **Search by category** - Group sites by their categories (movies, series, anime, etc.)
655
+ 3. **Select specific sites** - Choose individual sites to include in your search
656
+
657
+ ## Navigation and Selection
658
+
659
+ After performing a search:
660
+
661
+ 1. Results are displayed in a consolidated table showing:
662
+ - Title
663
+ - Media type (movie, TV series, etc.)
664
+ - Source site
665
+
666
+ 2. Select an item by number to view details or download
667
+
668
+ 3. The system will automatically use the appropriate site's API to handle the download
669
+
670
+ ## Command Line Arguments
671
+
672
+ The Global Search can be configured from the command line:
673
+
674
+ - `--global` - Perform a global search across multiple sites.
675
+ - `-s`, `--search` - Specify the search terms.
650
676
 
651
677
  # Examples of terminal usage
652
678
 
@@ -659,6 +685,9 @@ python test_run.py --specific_list_audio ita,eng --specific_list_subtitles eng,s
659
685
 
660
686
  # Keep console open after download
661
687
  python test_run.py --not_close true
688
+
689
+ # Use global search
690
+ python test_run.py --global -s "cars"
662
691
  ```
663
692
 
664
693
  # Docker
@@ -10,10 +10,11 @@ from rich.prompt import Prompt
10
10
 
11
11
  # Internal utilities
12
12
  from StreamingCommunity.Api.Template import get_select_title
13
+ from StreamingCommunity.Api.Template.config_loader import site_constant
14
+ from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
13
15
 
14
16
 
15
17
  # Logic class
16
- from StreamingCommunity.Api.Template.config_loader import site_constant
17
18
  from .site import title_search, media_search_manager, table_show_manager
18
19
  from .title import download_title
19
20
 
@@ -29,30 +30,43 @@ console = Console()
29
30
  msg = Prompt()
30
31
 
31
32
 
32
- def search(string_to_search: str = None, get_onylDatabase: bool = False):
33
+
34
+ def process_search_result(select_title):
35
+ """
36
+ Handles the search result and initiates the download for either a film or series.
37
+ """
38
+ download_title(select_title)
39
+
40
+ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None):
33
41
  """
34
- Main function of the application for film and series.
42
+ Main function of the application for search film, series and anime.
43
+
44
+ Parameters:
45
+ string_to_search (str, optional): String to search for
46
+ get_onylDatabase (bool, optional): If True, return only the database object
47
+ direct_item (dict, optional): Direct item to process (bypass search)
35
48
  """
49
+ if direct_item:
50
+ select_title = MediaItem(**direct_item)
51
+ process_search_result(select_title)
52
+ return
53
+
36
54
  if string_to_search is None:
37
55
  string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{site_constant.SITE_NAME}").strip()
38
56
 
39
- # Search on database
57
+ # Perform the database search
40
58
  len_database = title_search(quote_plus(string_to_search))
41
59
 
42
- # Return list of elements
43
- if get_onylDatabase:
60
+ # If only the database is needed, return the manager
61
+ if get_onlyDatabase:
44
62
  return media_search_manager
45
63
 
46
64
  if len_database > 0:
47
-
48
- # Select title from list
49
65
  select_title = get_select_title(table_show_manager, media_search_manager)
50
-
51
- # Download title
52
66
  download_title(select_title)
53
67
 
54
68
  else:
55
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
56
69
 
57
- # Retry
70
+ # If no results are found, ask again
71
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
58
72
  search()
@@ -62,7 +62,8 @@ def title_search(word_to_search: str) -> int:
62
62
  'seader': tr.find_all("td")[-5].get_text(strip=True),
63
63
  'leacher': tr.find_all("td")[-4].get_text(strip=True),
64
64
  'date': tr.find_all("td")[-3].get_text(strip=True).replace("'", ""),
65
- 'size': tr.find_all("td")[-2].get_text(strip=True)
65
+ 'size': tr.find_all("td")[-2].get_text(strip=True),
66
+ 'type': 'torrent'
66
67
  }
67
68
  media_search_manager.add_media(title_info)
68
69
 
@@ -0,0 +1,108 @@
1
+ # 16.03.25
2
+
3
+ import sys
4
+ import subprocess
5
+ from urllib.parse import quote_plus
6
+
7
+
8
+ # External library
9
+ from rich.console import Console
10
+ from rich.prompt import Prompt
11
+
12
+
13
+ # Internal utilities
14
+ from StreamingCommunity.Api.Template import get_select_title
15
+ from StreamingCommunity.Api.Template.config_loader import site_constant
16
+ from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
17
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
18
+
19
+
20
+ # Logic class
21
+ from .site import title_search, table_show_manager, media_search_manager
22
+ from .film import download_film
23
+ from .series import download_series
24
+
25
+ # Variable
26
+ indice = 2
27
+ _useFor = "film_serie"
28
+ _deprecate = False
29
+ _priority = 1
30
+ _engineDownload = "hls"
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
+ """
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
+ f"Enter the search term\nor type 'back' to return to the menu: ",
47
+ None
48
+ )
49
+
50
+ if string_to_search == 'back':
51
+
52
+ # Restart the script
53
+ subprocess.Popen([sys.executable] + sys.argv)
54
+ 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
59
+
60
+ def process_search_result(select_title):
61
+ """
62
+ Handles the search result and initiates the download for either a film or series.
63
+ """
64
+ if select_title.type == 'tv':
65
+ download_series(select_title)
66
+ else:
67
+ download_film(select_title)
68
+
69
+ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None):
70
+ """
71
+ Main function of the application for search film, series and anime.
72
+
73
+ Parameters:
74
+ string_to_search (str, optional): String to search for
75
+ get_onylDatabase (bool, optional): If True, return only the database object
76
+ direct_item (dict, optional): Direct item to process (bypass search)
77
+ """
78
+ if direct_item:
79
+ select_title = MediaItem(**direct_item)
80
+ process_search_result(select_title)
81
+ return
82
+
83
+ # Get the user input for the search term
84
+ string_to_search = get_user_input(string_to_search)
85
+
86
+ # Perform the database search
87
+ len_database = title_search(quote_plus(string_to_search))
88
+
89
+ # If only the database is needed, return the manager
90
+ if get_onlyDatabase:
91
+ return media_search_manager
92
+
93
+ if site_constant.TELEGRAM_BOT:
94
+ bot = get_bot_instance()
95
+
96
+ if len_database > 0:
97
+ select_title = get_select_title(table_show_manager, media_search_manager)
98
+ process_search_result(select_title)
99
+
100
+ else:
101
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
102
+
103
+ if site_constant.TELEGRAM_BOT:
104
+ bot.send_message(f"No results found, please try again", None)
105
+
106
+ # If no results are found, ask again
107
+ string_to_search = get_user_input()
108
+ search()
@@ -1,4 +1,4 @@
1
- # 3.12.23
1
+ # 16.03.25
2
2
 
3
3
  import os
4
4
 
@@ -15,6 +15,7 @@ from StreamingCommunity.Util.message import start_message
15
15
  from StreamingCommunity.Util.headers import get_headers
16
16
  from StreamingCommunity.Util.config_json import config_manager
17
17
  from StreamingCommunity.Lib.Downloader import HLS_Downloader
18
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance, TelegramSession
18
19
 
19
20
 
20
21
  # Logic class
@@ -41,6 +42,19 @@ def download_film(select_title: MediaItem) -> str:
41
42
  Return:
42
43
  - str: output path if successful, otherwise None
43
44
  """
45
+
46
+ if site_constant.TELEGRAM_BOT:
47
+ bot = get_bot_instance()
48
+ bot.send_message(f"Download in corso:\n{select_title.name}", None)
49
+
50
+ # Viene usato per lo screen
51
+ console.print(f"## Download: [red]{select_title.name} ##")
52
+
53
+ # Get script_id
54
+ script_id = TelegramSession.get_session()
55
+ if script_id != "unknown":
56
+ TelegramSession.updateScriptId(script_id, select_title.name)
57
+
44
58
  start_message()
45
59
  console.print(f"[yellow]Download: [red]{select_title.name} \n")
46
60
 
@@ -51,6 +65,9 @@ def download_film(select_title: MediaItem) -> str:
51
65
 
52
66
  except Exception as e:
53
67
  console.print(f"[red]Error fetching the page: {e}")
68
+
69
+ if site_constant.TELEGRAM_BOT:
70
+ bot.send_message(f"ERRORE\n\nErrore durante il recupero della pagina.\n\n{e}", None)
54
71
  return None
55
72
 
56
73
  # Create mostraguarda url
@@ -59,6 +76,8 @@ def download_film(select_title: MediaItem) -> str:
59
76
  url_mostraGuarda = iframe_tag[0].get('data-src')
60
77
  if not url_mostraGuarda:
61
78
  console.print("Error: data-src attribute not found in iframe.")
79
+ if site_constant.TELEGRAM_BOT:
80
+ bot.send_message(f"ERRORE\n\nErrore: attributo data-src non trovato nell'iframe", None)
62
81
 
63
82
  # Extract supervideo URL
64
83
  try:
@@ -67,6 +86,10 @@ def download_film(select_title: MediaItem) -> str:
67
86
 
68
87
  except Exception as e:
69
88
  console.print(f"[red]Error fetching mostraguarda link: {e}")
89
+ console.print("[yellow]Missing access credentials. This part of the code is still under development.")
90
+ if site_constant.TELEGRAM_BOT:
91
+ bot.send_message(f"ERRORE\n\nErrore durante il recupero del link mostra/guarda.\n\n{e}", None)
92
+ bot.send_message(f"ERRORE\n\nCredenziali di accesso mancanti.\nQuesta parte del codice è ancora in fase di sviluppo.", None)
70
93
  return None
71
94
 
72
95
  # Create supervio URL
@@ -91,6 +114,13 @@ def download_film(select_title: MediaItem) -> str:
91
114
  output_path=os.path.join(mp4_path, title_name)
92
115
  ).start()
93
116
 
117
+ if site_constant.TELEGRAM_BOT:
118
+
119
+ # Delete script_id
120
+ script_id = TelegramSession.get_session()
121
+ if script_id != "unknown":
122
+ TelegramSession.deleteScriptId(script_id)
123
+
94
124
  if r_proc['error'] is not None:
95
125
  try: os.remove(r_proc['path'])
96
126
  except: pass
@@ -1,4 +1,4 @@
1
- # 3.12.23
1
+ # 16.03.25
2
2
 
3
3
  import os
4
4
  from typing import Tuple
@@ -12,6 +12,8 @@ from rich.prompt import Prompt
12
12
  # Internal utilities
13
13
  from StreamingCommunity.Util.message import start_message
14
14
  from StreamingCommunity.Lib.Downloader import HLS_Downloader
15
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance, TelegramSession
16
+
15
17
 
16
18
  # Logic class
17
19
  from .util.ScrapeSerie import GetSerieInfo
@@ -56,9 +58,23 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
56
58
  console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.name}")
57
59
  print()
58
60
 
61
+ if site_constant.TELEGRAM_BOT:
62
+ bot = get_bot_instance()
63
+
64
+ # Invio a telegram
65
+ bot.send_message(
66
+ f"Download in corso\nSerie: {scrape_serie.series_name}\nStagione: {index_season_selected}\nEpisodio: {index_episode_selected}\nTitolo: {obj_episode.name}",
67
+ None
68
+ )
69
+
70
+ # Get script_id and update it
71
+ script_id = TelegramSession.get_session()
72
+ if script_id != "unknown":
73
+ TelegramSession.updateScriptId(script_id, f"{scrape_serie.series_name} - S{index_season_selected} - E{index_episode_selected} - {obj_episode.name}")
74
+
59
75
  # Define filename and path for the downloaded video
60
- mp4_name = f"{map_episode_title(scrape_serie.serie_name, index_season_selected, index_episode_selected, obj_episode.name)}.mp4"
61
- mp4_path = os.path.join(site_constant.SERIES_FOLDER, scrape_serie.serie_name, f"S{index_season_selected}")
76
+ mp4_name = f"{map_episode_title(scrape_serie.series_name, index_season_selected, index_episode_selected, obj_episode.name)}.mp4"
77
+ mp4_path = os.path.join(site_constant.SERIES_FOLDER, scrape_serie.series_name, f"S{index_season_selected}")
62
78
 
63
79
  # Retrieve scws and if available master playlist
64
80
  video_source = VideoSource(obj_episode.url)
@@ -127,6 +143,9 @@ def download_series(select_season: MediaItem) -> None:
127
143
  Parameters:
128
144
  - select_season (MediaItem): Selected media item (TV series).
129
145
  """
146
+ if site_constant.TELEGRAM_BOT:
147
+ bot = get_bot_instance()
148
+
130
149
  start_message()
131
150
 
132
151
  # Init class
@@ -138,10 +157,28 @@ def download_series(select_season: MediaItem) -> None:
138
157
 
139
158
  # Prompt user for season selection and download episodes
140
159
  console.print(f"\n[green]Seasons found: [red]{seasons_count}")
141
- index_season_selected = msg.ask(
142
- "\n[cyan]Insert season number [yellow](e.g., 1), [red]* [cyan]to download all seasons, "
143
- "[yellow](e.g., 1-2) [cyan]for a range of seasons, or [yellow](e.g., 3-*) [cyan]to download from a specific season to the end"
144
- )
160
+
161
+ if site_constant.TELEGRAM_BOT:
162
+ console.print("\n[cyan]Insert season number [yellow](e.g., 1), [red]* [cyan]to download all seasons, "
163
+ "[yellow](e.g., 1-2) [cyan]for a range of seasons, or [yellow](e.g., 3-*) [cyan]to download from a specific season to the end")
164
+
165
+ bot.send_message(f"Stagioni trovate: {seasons_count}", None)
166
+
167
+ index_season_selected = bot.ask(
168
+ "select_title_episode",
169
+ "Menu di selezione delle stagioni\n\n"
170
+ "- Inserisci il numero della stagione (ad esempio, 1)\n"
171
+ "- Inserisci * per scaricare tutte le stagioni\n"
172
+ "- Inserisci un intervallo di stagioni (ad esempio, 1-2) per scaricare da una stagione all'altra\n"
173
+ "- Inserisci (ad esempio, 3-*) per scaricare dalla stagione specificata fino alla fine della serie",
174
+ None
175
+ )
176
+
177
+ else:
178
+ index_season_selected = msg.ask(
179
+ "\n[cyan]Insert season number [yellow](e.g., 1), [red]* [cyan]to download all seasons, "
180
+ "[yellow](e.g., 1-2) [cyan]for a range of seasons, or [yellow](e.g., 3-*) [cyan]to download from a specific season to the end"
181
+ )
145
182
 
146
183
  # Manage and validate the selection
147
184
  list_season_select = manage_selection(index_season_selected, seasons_count)
@@ -161,4 +198,12 @@ def download_series(select_season: MediaItem) -> None:
161
198
  else:
162
199
 
163
200
  # Otherwise, let the user select specific episodes for the single season
164
- download_episode(i_season, scrape_serie, download_all=False)
201
+ download_episode(i_season, scrape_serie, download_all=False)
202
+
203
+ if site_constant.TELEGRAM_BOT:
204
+ bot.send_message(f"Finito di scaricare tutte le serie e episodi", None)
205
+
206
+ # Get script_id
207
+ script_id = TelegramSession.get_session()
208
+ if script_id != "unknown":
209
+ TelegramSession.deleteScriptId(script_id)
@@ -1,4 +1,4 @@
1
- # 10.12.23
1
+ # 16.03.25
2
2
 
3
3
 
4
4
  # External libraries
@@ -11,6 +11,7 @@ from rich.console import Console
11
11
  from StreamingCommunity.Util.config_json import config_manager
12
12
  from StreamingCommunity.Util.headers import get_userAgent
13
13
  from StreamingCommunity.Util.table import TVShowManager
14
+ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
14
15
 
15
16
 
16
17
  # Logic class
@@ -35,6 +36,9 @@ def title_search(title_search: str) -> int:
35
36
  Returns:
36
37
  int: The number of titles found.
37
38
  """
39
+ if site_constant.TELEGRAM_BOT:
40
+ bot = get_bot_instance()
41
+
38
42
  media_search_manager.clear()
39
43
  table_show_manager.clear()
40
44
 
@@ -47,14 +51,20 @@ def title_search(title_search: str) -> int:
47
51
 
48
52
  except Exception as e:
49
53
  console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
54
+ if site_constant.TELEGRAM_BOT:
55
+ bot.send_message(f"ERRORE\n\nErrore nella richiesta di ricerca:\n\n{e}", None)
50
56
  return 0
51
-
57
+
58
+ # Prepara le scelte per l'utente
59
+ if site_constant.TELEGRAM_BOT:
60
+ choices = []
61
+
52
62
  # Create soup istance
53
63
  soup = BeautifulSoup(response.text, "html.parser")
54
64
 
55
65
  # Collect data from soup
56
- for movie_div in soup.find_all("div", class_="movie"):
57
-
66
+ for i, movie_div in enumerate(soup.find_all("div", class_="movie")):
67
+
58
68
  title_tag = movie_div.find("h2", class_="movie-title")
59
69
  title = title_tag.find("a").get_text(strip=True)
60
70
  url = title_tag.find("a").get("href")
@@ -70,6 +80,14 @@ def title_search(title_search: str) -> int:
70
80
  'name': title,
71
81
  'type': tipo
72
82
  })
83
+
84
+ if site_constant.TELEGRAM_BOT:
85
+ choice_text = f"{i} - {title} ({tipo})"
86
+ choices.append(choice_text)
87
+
88
+ if site_constant.TELEGRAM_BOT:
89
+ if choices:
90
+ bot.send_message(f"Lista dei risultati:", choices)
73
91
 
74
92
  # Return the number of titles found
75
93
  return media_search_manager.get_length()
@@ -1,4 +1,4 @@
1
- # 01.03.24
1
+ # 16.03.25
2
2
 
3
3
  # External libraries
4
4
  import httpx
@@ -34,7 +34,7 @@ class GetSerieInfo:
34
34
  """
35
35
  response = httpx.get(self.url, headers=self.headers)
36
36
  soup = BeautifulSoup(response.text, "html.parser")
37
- self.serie_name = soup.find("title").get_text(strip=True).split(" - ")[0]
37
+ self.series_name = soup.find("title").get_text(strip=True).split(" - ")[0]
38
38
 
39
39
  # Process all seasons
40
40
  season_items = soup.find_all('div', class_='accordion-item')