StreamingCommunity 2.9.4__tar.gz → 2.9.6__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 (97) hide show
  1. {streamingcommunity-2.9.4/StreamingCommunity.egg-info → streamingcommunity-2.9.6}/PKG-INFO +42 -15
  2. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/README.md +39 -13
  3. streamingcommunity-2.9.6/StreamingCommunity/Api/Player/sweetpixel.py +49 -0
  4. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/1337xx/__init__.py +26 -12
  5. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/1337xx/site.py +5 -4
  6. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/1337xx/title.py +4 -6
  7. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/altadefinizione/__init__.py +108 -0
  8. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/altadefinizione/film.py +32 -2
  9. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/altadefinizione/series.py +54 -10
  10. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/altadefinizione/site.py +25 -7
  11. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/altadefinizione/util/ScrapeSerie.py +2 -2
  12. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/animeunity/__init__.py +104 -0
  13. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/animeunity/film_serie.py +8 -5
  14. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/animeunity/site.py +4 -6
  15. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/animeworld/__init__.py +71 -0
  16. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/animeworld/serie.py +107 -0
  17. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/animeworld/site.py +111 -0
  18. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py +79 -0
  19. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/cb01new/__init__.py +26 -14
  20. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/cb01new/film.py +1 -1
  21. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/cb01new/site.py +9 -7
  22. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +75 -0
  23. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/ddlstreamitaly/series.py +2 -2
  24. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/ddlstreamitaly/site.py +3 -3
  25. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/guardaserie/__init__.py +23 -11
  26. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/guardaserie/series.py +1 -1
  27. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/guardaserie/site.py +5 -4
  28. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/mostraguarda/__init__.py +27 -7
  29. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/mostraguarda/film.py +1 -1
  30. streamingcommunity-2.9.6/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +109 -0
  31. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/streamingcommunity/film.py +1 -1
  32. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/streamingcommunity/series.py +6 -3
  33. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/streamingcommunity/site.py +7 -3
  34. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/Downloader/HLS/segments.py +2 -4
  35. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/Downloader/MP4/downloader.py +7 -6
  36. streamingcommunity-2.9.6/StreamingCommunity/Lib/Downloader/TOR/downloader.py +476 -0
  37. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/FFmpeg/util.py +12 -0
  38. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/M3U8/estimator.py +5 -8
  39. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Upload/version.py +1 -1
  40. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/config_json.py +2 -8
  41. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/table.py +12 -2
  42. streamingcommunity-2.9.6/StreamingCommunity/global_search.py +315 -0
  43. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/run.py +39 -5
  44. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6/StreamingCommunity.egg-info}/PKG-INFO +42 -15
  45. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity.egg-info/SOURCES.txt +6 -0
  46. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/setup.py +1 -1
  47. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/altadefinizione/__init__.py +0 -61
  48. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/animeunity/__init__.py +0 -83
  49. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +0 -64
  50. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +0 -86
  51. streamingcommunity-2.9.4/StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -306
  52. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/LICENSE +0 -0
  53. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/MANIFEST.in +0 -0
  54. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -0
  55. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +0 -0
  56. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Player/ddl.py +0 -0
  57. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Player/maxstream.py +0 -0
  58. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Player/supervideo.py +0 -0
  59. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Player/vixcloud.py +0 -0
  60. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +0 -0
  61. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +0 -0
  62. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -0
  63. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +0 -0
  64. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Template/Class/SearchType.py +0 -0
  65. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Template/Util/__init__.py +0 -0
  66. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Template/Util/manage_ep.py +0 -0
  67. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Template/__init__.py +0 -0
  68. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Template/config_loader.py +0 -0
  69. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Api/Template/site.py +0 -0
  70. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/Downloader/HLS/downloader.py +0 -0
  71. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/Downloader/__init__.py +0 -0
  72. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/FFmpeg/__init__.py +0 -0
  73. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/FFmpeg/capture.py +0 -0
  74. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/FFmpeg/command.py +0 -0
  75. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/M3U8/__init__.py +0 -0
  76. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/M3U8/decryptor.py +0 -0
  77. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/M3U8/parser.py +0 -0
  78. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/M3U8/url_fixer.py +0 -0
  79. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/TMBD/__init__.py +0 -0
  80. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -0
  81. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Lib/TMBD/tmdb.py +0 -0
  82. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/TelegramHelp/__init__.py +0 -0
  83. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/TelegramHelp/telegram_bot.py +0 -0
  84. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Upload/update.py +0 -0
  85. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/color.py +0 -0
  86. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/ffmpeg_installer.py +0 -0
  87. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/headers.py +0 -0
  88. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/logger.py +0 -0
  89. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/message.py +0 -0
  90. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/Util/os.py +0 -0
  91. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity/__init__.py +0 -0
  92. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity.egg-info/dependency_links.txt +0 -0
  93. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity.egg-info/entry_points.txt +0 -0
  94. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity.egg-info/requires.txt +0 -0
  95. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/StreamingCommunity.egg-info/top_level.txt +0 -0
  96. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/requirements.txt +0 -0
  97. {streamingcommunity-2.9.4 → streamingcommunity-2.9.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: StreamingCommunity
3
- Version: 2.9.4
3
+ Version: 2.9.6
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
@@ -28,6 +28,7 @@ Dynamic: description
28
28
  Dynamic: description-content-type
29
29
  Dynamic: home-page
30
30
  Dynamic: keywords
31
+ Dynamic: license-file
31
32
  Dynamic: project-url
32
33
  Dynamic: requires-dist
33
34
  Dynamic: requires-python
@@ -79,6 +80,7 @@ Dynamic: requires-python
79
80
  - 📥 [Download](#m3u8_download-settings)
80
81
  - 🔍 [Parser](#m3u8_parser-settings)
81
82
  - 📝 [Command](#command)
83
+ - 🔍 [Global search](#global-search)
82
84
  - 💻 [Examples of terminal](#examples-of-terminal-usage)
83
85
  - 🔧 [Manual domain configuration](#update-domains)
84
86
  - 🐳 [Docker](#docker)
@@ -198,13 +200,10 @@ from StreamingCommunity.Download import TOR_downloader
198
200
  client = TOR_downloader()
199
201
 
200
202
  # Add magnet link
201
- client.add_magnet_link("magnet:?xt=urn:btih:example_hash&dn=example_name")
203
+ client.add_magnet_link("magnet:?xt=urn:btih:example_hash&dn=example_name", save_path=".")
202
204
 
203
205
  # Start download
204
206
  client.start_download()
205
-
206
- # Move downloaded files to specific location
207
- client.move_downloaded_files("/downloads/torrents/")
208
207
  ```
209
208
 
210
209
  See [Torrent example](./Test/Download/TOR.py) for complete usage.
@@ -668,19 +667,44 @@ The API-based domain updates are currently deprecated. To use it anyway, set `us
668
667
 
669
668
  Note: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.
670
669
 
671
- # COMMAND
670
+ #### 💡 Adding a New Site to the Legacy API
671
+ 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
+
673
+ # Global Search
674
+
675
+ 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.
676
+
677
+ ## Using Global Search
678
+
679
+ The Global Search feature provides a unified interface to search across all supported sites:
680
+
681
+ ## Search Options
682
+
683
+ When using Global Search, you have three ways to select which sites to search:
672
684
 
673
- - Download a specific season by entering its number.
674
- * **Example:** `1` will download *Season 1* only.
685
+ 1. **Search all sites** - Searches across all available streaming sites
686
+ 2. **Search by category** - Group sites by their categories (movies, series, anime, etc.)
687
+ 3. **Select specific sites** - Choose individual sites to include in your search
675
688
 
676
- - Use the wildcard `*` to download every available season.
677
- * **Example:** `*` will download all seasons in the series.
689
+ ## Navigation and Selection
678
690
 
679
- - Specify a range of seasons using a hyphen `-`.
680
- * **Example:** `1-2` will download *Seasons 1 and 2*.
691
+ After performing a search:
681
692
 
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.
693
+ 1. Results are displayed in a consolidated table showing:
694
+ - Title
695
+ - Media type (movie, TV series, etc.)
696
+ - Source site
697
+
698
+ 2. Select an item by number to view details or download
699
+
700
+ 3. The system will automatically use the appropriate site's API to handle the download
701
+
702
+ ## Command Line Arguments
703
+
704
+ The Global Search can be configured from the command line:
705
+
706
+ - `--global` - Perform a global search across multiple sites.
707
+ - `-s`, `--search` - Specify the search terms.
684
708
 
685
709
  # Examples of terminal usage
686
710
 
@@ -693,6 +717,9 @@ python test_run.py --specific_list_audio ita,eng --specific_list_subtitles eng,s
693
717
 
694
718
  # Keep console open after download
695
719
  python test_run.py --not_close true
720
+
721
+ # Use global search
722
+ python test_run.py --global -s "cars"
696
723
  ```
697
724
 
698
725
  # 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)
@@ -164,13 +165,10 @@ from StreamingCommunity.Download import TOR_downloader
164
165
  client = TOR_downloader()
165
166
 
166
167
  # Add magnet link
167
- client.add_magnet_link("magnet:?xt=urn:btih:example_hash&dn=example_name")
168
+ client.add_magnet_link("magnet:?xt=urn:btih:example_hash&dn=example_name", save_path=".")
168
169
 
169
170
  # Start download
170
171
  client.start_download()
171
-
172
- # Move downloaded files to specific location
173
- client.move_downloaded_files("/downloads/torrents/")
174
172
  ```
175
173
 
176
174
  See [Torrent example](./Test/Download/TOR.py) for complete usage.
@@ -634,19 +632,44 @@ The API-based domain updates are currently deprecated. To use it anyway, set `us
634
632
 
635
633
  Note: If `use_api` is set to `false` and no `domains.json` file is found, the script will raise an error.
636
634
 
637
- # COMMAND
635
+ #### 💡 Adding a New Site to the Legacy API
636
+ If you want to add a new site to the legacy API, just message me on the Discord server, and I'll add it!
637
+
638
+ # Global Search
639
+
640
+ 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.
641
+
642
+ ## Using Global Search
643
+
644
+ The Global Search feature provides a unified interface to search across all supported sites:
645
+
646
+ ## Search Options
647
+
648
+ When using Global Search, you have three ways to select which sites to search:
638
649
 
639
- - Download a specific season by entering its number.
640
- * **Example:** `1` will download *Season 1* only.
650
+ 1. **Search all sites** - Searches across all available streaming sites
651
+ 2. **Search by category** - Group sites by their categories (movies, series, anime, etc.)
652
+ 3. **Select specific sites** - Choose individual sites to include in your search
641
653
 
642
- - Use the wildcard `*` to download every available season.
643
- * **Example:** `*` will download all seasons in the series.
654
+ ## Navigation and Selection
644
655
 
645
- - Specify a range of seasons using a hyphen `-`.
646
- * **Example:** `1-2` will download *Seasons 1 and 2*.
656
+ After performing a search:
647
657
 
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.
658
+ 1. Results are displayed in a consolidated table showing:
659
+ - Title
660
+ - Media type (movie, TV series, etc.)
661
+ - Source site
662
+
663
+ 2. Select an item by number to view details or download
664
+
665
+ 3. The system will automatically use the appropriate site's API to handle the download
666
+
667
+ ## Command Line Arguments
668
+
669
+ The Global Search can be configured from the command line:
670
+
671
+ - `--global` - Perform a global search across multiple sites.
672
+ - `-s`, `--search` - Specify the search terms.
650
673
 
651
674
  # Examples of terminal usage
652
675
 
@@ -659,6 +682,9 @@ python test_run.py --specific_list_audio ita,eng --specific_list_subtitles eng,s
659
682
 
660
683
  # Keep console open after download
661
684
  python test_run.py --not_close true
685
+
686
+ # Use global search
687
+ python test_run.py --global -s "cars"
662
688
  ```
663
689
 
664
690
  # Docker
@@ -0,0 +1,49 @@
1
+ # 21.03.25
2
+
3
+ import logging
4
+
5
+
6
+ # External libraries
7
+ import httpx
8
+
9
+
10
+ # Internal utilities
11
+ from StreamingCommunity.Util.config_json import config_manager
12
+ from StreamingCommunity.Util.headers import get_userAgent
13
+
14
+
15
+ # Variable
16
+ MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
17
+
18
+
19
+ class AnimeWorldPlayer:
20
+ def __init__(self, full_url, episode_data, session_id, csrf_token):
21
+ """Initialize the AnimeWorldPlayer with session details, episode data, and URL."""
22
+ self.session_id = session_id
23
+ self.csrf_token = csrf_token
24
+ self.episode_data = episode_data
25
+ self.number = episode_data['number']
26
+ self.link = episode_data['link']
27
+
28
+ # Create an HTTP client with session cookies, headers, and base URL.
29
+ self.client = httpx.Client(
30
+ cookies={"sessionId": session_id},
31
+ headers={"User-Agent": get_userAgent(), "csrf-token": csrf_token},
32
+ base_url=full_url,
33
+ timeout=MAX_TIMEOUT
34
+ )
35
+
36
+ def get_download_link(self):
37
+ """Fetch the download link from AnimeWorld using the episode link."""
38
+ try:
39
+ # Make a POST request to the episode link and follow any redirects
40
+ res = self.client.post(self.link, follow_redirects=True)
41
+ data = res.json()
42
+
43
+ # Extract the first available server link and return it after modifying the URL
44
+ server_link = data["links"]["9"][list(data["links"]["9"].keys())[0]]["link"]
45
+ return server_link.replace('download-file.php?id=', '')
46
+
47
+ except Exception as e:
48
+ logging.error(f"Error in new API system: {e}")
49
+ return None
@@ -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()
@@ -26,12 +26,12 @@ table_show_manager = TVShowManager()
26
26
  max_timeout = config_manager.get_int("REQUESTS", "timeout")
27
27
 
28
28
 
29
- def title_search(word_to_search: str) -> int:
29
+ def title_search(query: str) -> int:
30
30
  """
31
31
  Search for titles based on a search query.
32
32
 
33
33
  Parameters:
34
- - title_search (str): The title to search for.
34
+ - query (str): The query to search for.
35
35
 
36
36
  Returns:
37
37
  - int: The number of titles found.
@@ -39,7 +39,7 @@ def title_search(word_to_search: str) -> int:
39
39
  media_search_manager.clear()
40
40
  table_show_manager.clear()
41
41
 
42
- search_url = f"{site_constant.FULL_URL}/search/{word_to_search}/1/"
42
+ search_url = f"{site_constant.FULL_URL}/search/{query}/1/"
43
43
  console.print(f"[cyan]Search url: [yellow]{search_url}")
44
44
 
45
45
  try:
@@ -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
 
@@ -33,9 +33,8 @@ def download_title(select_title: MediaItem):
33
33
  - select_title (MediaItem): The media item to be downloaded. This should be an instance of the MediaItem class, containing attributes like `name` and `url`.
34
34
  """
35
35
  start_message()
36
- console.print(f"[yellow]Download: [red]{select_title.name} \n")
37
- print()
38
-
36
+ console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
37
+
39
38
  # Define output path
40
39
  title_name = os_manager.get_sanitize_file(select_title.name)
41
40
  mp4_path = os.path.join(site_constant.MOVIE_FOLDER, title_name.replace(".mp4", ""))
@@ -58,6 +57,5 @@ def download_title(select_title: MediaItem):
58
57
 
59
58
  # Tor manager
60
59
  manager = TOR_downloader()
61
- manager.add_magnet_link(final_url)
62
- manager.start_download()
63
- manager.move_downloaded_files(mp4_path)
60
+ manager.add_magnet_link(final_url, save_path=mp4_path)
61
+ manager.start_download()
@@ -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,8 +42,21 @@ 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
- console.print(f"[yellow]Download: [red]{select_title.name} \n")
59
+ console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
46
60
 
47
61
  # Extract mostraguarda link
48
62
  try:
@@ -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
@@ -53,12 +55,25 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
53
55
 
54
56
  # Get info about episode
55
57
  obj_episode = scrape_serie.seasons_manager.get_season_by_number(int(index_season_selected)).episodes.get(index_episode_selected-1)
56
- console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.name}")
57
- print()
58
+ console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [bold magenta]{obj_episode.name}[/bold magenta] ([cyan]S{index_season_selected}E{index_episode_selected}[/cyan]) \n")
59
+
60
+ if site_constant.TELEGRAM_BOT:
61
+ bot = get_bot_instance()
62
+
63
+ # Invio a telegram
64
+ bot.send_message(
65
+ f"Download in corso\nSerie: {scrape_serie.series_name}\nStagione: {index_season_selected}\nEpisodio: {index_episode_selected}\nTitolo: {obj_episode.name}",
66
+ None
67
+ )
68
+
69
+ # Get script_id and update it
70
+ script_id = TelegramSession.get_session()
71
+ if script_id != "unknown":
72
+ TelegramSession.updateScriptId(script_id, f"{scrape_serie.series_name} - S{index_season_selected} - E{index_episode_selected} - {obj_episode.name}")
58
73
 
59
74
  # 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}")
75
+ mp4_name = f"{map_episode_title(scrape_serie.series_name, index_season_selected, index_episode_selected, obj_episode.name)}.mp4"
76
+ mp4_path = os.path.join(site_constant.SERIES_FOLDER, scrape_serie.series_name, f"S{index_season_selected}")
62
77
 
63
78
  # Retrieve scws and if available master playlist
64
79
  video_source = VideoSource(obj_episode.url)
@@ -127,6 +142,9 @@ def download_series(select_season: MediaItem) -> None:
127
142
  Parameters:
128
143
  - select_season (MediaItem): Selected media item (TV series).
129
144
  """
145
+ if site_constant.TELEGRAM_BOT:
146
+ bot = get_bot_instance()
147
+
130
148
  start_message()
131
149
 
132
150
  # Init class
@@ -138,10 +156,28 @@ def download_series(select_season: MediaItem) -> None:
138
156
 
139
157
  # Prompt user for season selection and download episodes
140
158
  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
- )
159
+
160
+ if site_constant.TELEGRAM_BOT:
161
+ console.print("\n[cyan]Insert season number [yellow](e.g., 1), [red]* [cyan]to download all seasons, "
162
+ "[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")
163
+
164
+ bot.send_message(f"Stagioni trovate: {seasons_count}", None)
165
+
166
+ index_season_selected = bot.ask(
167
+ "select_title_episode",
168
+ "Menu di selezione delle stagioni\n\n"
169
+ "- Inserisci il numero della stagione (ad esempio, 1)\n"
170
+ "- Inserisci * per scaricare tutte le stagioni\n"
171
+ "- Inserisci un intervallo di stagioni (ad esempio, 1-2) per scaricare da una stagione all'altra\n"
172
+ "- Inserisci (ad esempio, 3-*) per scaricare dalla stagione specificata fino alla fine della serie",
173
+ None
174
+ )
175
+
176
+ else:
177
+ index_season_selected = msg.ask(
178
+ "\n[cyan]Insert season number [yellow](e.g., 1), [red]* [cyan]to download all seasons, "
179
+ "[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"
180
+ )
145
181
 
146
182
  # Manage and validate the selection
147
183
  list_season_select = manage_selection(index_season_selected, seasons_count)
@@ -161,4 +197,12 @@ def download_series(select_season: MediaItem) -> None:
161
197
  else:
162
198
 
163
199
  # Otherwise, let the user select specific episodes for the single season
164
- download_episode(i_season, scrape_serie, download_all=False)
200
+ download_episode(i_season, scrape_serie, download_all=False)
201
+
202
+ if site_constant.TELEGRAM_BOT:
203
+ bot.send_message(f"Finito di scaricare tutte le serie e episodi", None)
204
+
205
+ # Get script_id
206
+ script_id = TelegramSession.get_session()
207
+ if script_id != "unknown":
208
+ TelegramSession.deleteScriptId(script_id)