StreamingCommunity 2.9.2__tar.gz → 2.9.4__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 (88) hide show
  1. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/MANIFEST.in +2 -1
  2. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/PKG-INFO +105 -7
  3. StreamingCommunity-2.9.2/StreamingCommunity.egg-info/PKG-INFO → streamingcommunity-2.9.4/README.md +81 -17
  4. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +40 -38
  5. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Player/maxstream.py +6 -11
  6. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Player/supervideo.py +4 -0
  7. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/1337xx/site.py +1 -9
  8. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/altadefinizione/__init__.py +61 -0
  9. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/altadefinizione/film.py +98 -0
  10. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/altadefinizione/series.py +164 -0
  11. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/altadefinizione/site.py +75 -0
  12. streamingcommunity-2.9.4/StreamingCommunity/Api/Site/altadefinizione/util/ScrapeSerie.py +72 -0
  13. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/animeunity/film_serie.py +2 -2
  14. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/animeunity/site.py +15 -41
  15. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/cb01new/site.py +5 -16
  16. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/ddlstreamitaly/site.py +1 -9
  17. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/guardaserie/series.py +1 -1
  18. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/guardaserie/site.py +1 -9
  19. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/streamingcommunity/series.py +30 -12
  20. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/streamingcommunity/site.py +10 -10
  21. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +38 -17
  22. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Template/Class/SearchType.py +1 -1
  23. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Template/Util/__init__.py +0 -1
  24. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Template/Util/manage_ep.py +43 -16
  25. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Template/config_loader.py +0 -4
  26. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Template/site.py +1 -1
  27. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/Downloader/HLS/downloader.py +13 -2
  28. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/Downloader/HLS/segments.py +37 -11
  29. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/Downloader/MP4/downloader.py +5 -3
  30. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/FFmpeg/command.py +2 -2
  31. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/FFmpeg/util.py +11 -15
  32. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/M3U8/estimator.py +4 -4
  33. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/TMBD/tmdb.py +1 -1
  34. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Upload/version.py +1 -1
  35. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/config_json.py +0 -3
  36. streamingcommunity-2.9.4/StreamingCommunity/__init__.py +6 -0
  37. StreamingCommunity-2.9.2/README.md → streamingcommunity-2.9.4/StreamingCommunity.egg-info/PKG-INFO +115 -5
  38. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity.egg-info/SOURCES.txt +6 -1
  39. streamingcommunity-2.9.4/requirements.txt +14 -0
  40. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/setup.py +3 -3
  41. StreamingCommunity-2.9.2/StreamingCommunity/Api/Template/Util/get_domain.py +0 -100
  42. StreamingCommunity-2.9.2/StreamingCommunity/__init__.py +0 -0
  43. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/LICENSE +0 -0
  44. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -0
  45. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Player/ddl.py +0 -0
  46. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Player/vixcloud.py +0 -0
  47. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/1337xx/__init__.py +0 -0
  48. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/1337xx/title.py +0 -0
  49. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/animeunity/__init__.py +0 -0
  50. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +0 -0
  51. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/cb01new/__init__.py +0 -0
  52. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/cb01new/film.py +0 -0
  53. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +0 -0
  54. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/ddlstreamitaly/series.py +0 -0
  55. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +0 -0
  56. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/guardaserie/__init__.py +0 -0
  57. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -0
  58. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/mostraguarda/__init__.py +0 -0
  59. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/mostraguarda/film.py +0 -0
  60. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +0 -0
  61. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Site/streamingcommunity/film.py +0 -0
  62. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Api/Template/__init__.py +0 -0
  63. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -0
  64. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/Downloader/__init__.py +0 -0
  65. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/FFmpeg/__init__.py +0 -0
  66. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/FFmpeg/capture.py +0 -0
  67. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/M3U8/__init__.py +0 -0
  68. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/M3U8/decryptor.py +0 -0
  69. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/M3U8/parser.py +0 -0
  70. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/M3U8/url_fixer.py +0 -0
  71. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/TMBD/__init__.py +0 -0
  72. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -0
  73. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/TelegramHelp/__init__.py +0 -0
  74. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/TelegramHelp/telegram_bot.py +0 -0
  75. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Upload/update.py +0 -0
  76. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/color.py +0 -0
  77. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/ffmpeg_installer.py +0 -0
  78. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/headers.py +0 -0
  79. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/logger.py +0 -0
  80. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/message.py +0 -0
  81. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/os.py +0 -0
  82. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/Util/table.py +0 -0
  83. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity/run.py +0 -0
  84. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity.egg-info/dependency_links.txt +0 -0
  85. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity.egg-info/entry_points.txt +0 -0
  86. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity.egg-info/requires.txt +0 -0
  87. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/StreamingCommunity.egg-info/top_level.txt +0 -0
  88. {StreamingCommunity-2.9.2 → streamingcommunity-2.9.4}/setup.cfg +0 -0
@@ -1,3 +1,4 @@
1
1
  recursive-include StreamingCommunity *
2
2
  recursive-include StreamingCommunity/Api *
3
- recursive-include StreamingCommunity/Lib *
3
+ recursive-include StreamingCommunity/Lib *
4
+ include requirements.txt
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: StreamingCommunity
3
- Version: 2.9.2
3
+ Version: 2.9.4
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
@@ -9,6 +9,28 @@ Keywords: streaming community
9
9
  Requires-Python: >=3.8
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
+ Requires-Dist: httpx
13
+ Requires-Dist: bs4
14
+ Requires-Dist: rich
15
+ Requires-Dist: tqdm
16
+ Requires-Dist: m3u8
17
+ Requires-Dist: certifi
18
+ Requires-Dist: psutil
19
+ Requires-Dist: unidecode
20
+ Requires-Dist: jsbeautifier
21
+ Requires-Dist: pathvalidate
22
+ Requires-Dist: pycryptodomex
23
+ Requires-Dist: ua-generator
24
+ Requires-Dist: qbittorrent-api
25
+ Requires-Dist: pyTelegramBotAPI
26
+ Dynamic: author
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: keywords
31
+ Dynamic: project-url
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
12
34
 
13
35
  <p align="center">
14
36
  <img src="https://i.ibb.co/v6RnT0wY/s2.jpg" alt="Project Logo" width="700"/>
@@ -58,6 +80,7 @@ License-File: LICENSE
58
80
  - 🔍 [Parser](#m3u8_parser-settings)
59
81
  - 📝 [Command](#command)
60
82
  - 💻 [Examples of terminal](#examples-of-terminal-usage)
83
+ - 🔧 [Manual domain configuration](#update-domains)
61
84
  - 🐳 [Docker](#docker)
62
85
  - 📝 [Telegram Usage](#telegram-usage)
63
86
  - 🎓 [Tutorial](#tutorials)
@@ -90,9 +113,15 @@ Install directly from PyPI:
90
113
  pip install StreamingCommunity
91
114
  ```
92
115
 
93
- ### Creating a Run Script
116
+ Update to the latest version:
94
117
 
95
- Create `run_streaming.py`:
118
+ ```bash
119
+ pip install --upgrade StreamingCommunity
120
+ ```
121
+
122
+ ## Quick Start
123
+
124
+ Create a simple script (`run_streaming.py`) to launch the main application:
96
125
 
97
126
  ```python
98
127
  from StreamingCommunity.run import main
@@ -102,16 +131,85 @@ if __name__ == "__main__":
102
131
  ```
103
132
 
104
133
  Run the script:
134
+
105
135
  ```bash
106
136
  python run_streaming.py
107
137
  ```
108
138
 
109
- ### Updating via PyPI
139
+ ## Modules
110
140
 
111
- ```bash
112
- pip install --upgrade StreamingCommunity
141
+ ### HLS Downloader
142
+
143
+ Download HTTP Live Streaming (HLS) content from m3u8 URLs.
144
+
145
+ ```python
146
+ from StreamingCommunity.Download import HLS_Downloader
147
+
148
+ # Initialize with m3u8 URL and optional output path
149
+ downloader = HLS_Downloader(
150
+ m3u8_url="https://example.com/stream.m3u8",
151
+ output_path="/downloads/video.mp4" # Optional
152
+ )
153
+
154
+ # Start the download
155
+ downloader.download()
113
156
  ```
114
157
 
158
+ See [HLS example](./Test/Download/HLS.py) for complete usage.
159
+
160
+ ### MP4 Downloader
161
+
162
+ Direct MP4 file downloader with support for custom headers and referrer.
163
+
164
+ ```python
165
+ from StreamingCommunity.Download import MP4_downloader
166
+
167
+ # Basic usage
168
+ downloader = MP4_downloader(
169
+ url="https://example.com/video.mp4",
170
+ path="/downloads/saved_video.mp4"
171
+ )
172
+
173
+ # Advanced usage with custom headers and referrer
174
+ headers = {
175
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
176
+ }
177
+ downloader = MP4_downloader(
178
+ url="https://example.com/video.mp4",
179
+ path="/downloads/saved_video.mp4",
180
+ referer="https://example.com",
181
+ headers_=headers
182
+ )
183
+
184
+ # Start download
185
+ downloader.download()
186
+ ```
187
+
188
+ See [MP4 example](./Test/Download/MP4.py) for complete usage.
189
+
190
+ ### Torrent Client
191
+
192
+ Download content via torrent magnet links.
193
+
194
+ ```python
195
+ from StreamingCommunity.Download import TOR_downloader
196
+
197
+ # Initialize torrent client
198
+ client = TOR_downloader()
199
+
200
+ # Add magnet link
201
+ client.add_magnet_link("magnet:?xt=urn:btih:example_hash&dn=example_name")
202
+
203
+ # Start download
204
+ client.start_download()
205
+
206
+ # Move downloaded files to specific location
207
+ client.move_downloaded_files("/downloads/torrents/")
208
+ ```
209
+
210
+ See [Torrent example](./Test/Download/TOR.py) for complete usage.
211
+
212
+
115
213
  ## 2. Automatic Installation
116
214
 
117
215
  ### Supported Operating Systems 💿
@@ -1,15 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: StreamingCommunity
3
- Version: 2.9.2
4
- Home-page: https://github.com/Lovi-0/StreamingCommunity
5
- Author: Lovi-0
6
- Project-URL: Bug Reports, https://github.com/Lovi-0/StreamingCommunity/issues
7
- Project-URL: Source, https://github.com/Lovi-0/StreamingCommunity
8
- Keywords: streaming community
9
- Requires-Python: >=3.8
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE
12
-
13
1
  <p align="center">
14
2
  <img src="https://i.ibb.co/v6RnT0wY/s2.jpg" alt="Project Logo" width="700"/>
15
3
  </p>
@@ -58,6 +46,7 @@ License-File: LICENSE
58
46
  - 🔍 [Parser](#m3u8_parser-settings)
59
47
  - 📝 [Command](#command)
60
48
  - 💻 [Examples of terminal](#examples-of-terminal-usage)
49
+ - 🔧 [Manual domain configuration](#update-domains)
61
50
  - 🐳 [Docker](#docker)
62
51
  - 📝 [Telegram Usage](#telegram-usage)
63
52
  - 🎓 [Tutorial](#tutorials)
@@ -90,9 +79,15 @@ Install directly from PyPI:
90
79
  pip install StreamingCommunity
91
80
  ```
92
81
 
93
- ### Creating a Run Script
82
+ Update to the latest version:
83
+
84
+ ```bash
85
+ pip install --upgrade StreamingCommunity
86
+ ```
94
87
 
95
- Create `run_streaming.py`:
88
+ ## Quick Start
89
+
90
+ Create a simple script (`run_streaming.py`) to launch the main application:
96
91
 
97
92
  ```python
98
93
  from StreamingCommunity.run import main
@@ -102,16 +97,85 @@ if __name__ == "__main__":
102
97
  ```
103
98
 
104
99
  Run the script:
100
+
105
101
  ```bash
106
102
  python run_streaming.py
107
103
  ```
108
104
 
109
- ### Updating via PyPI
105
+ ## Modules
110
106
 
111
- ```bash
112
- pip install --upgrade StreamingCommunity
107
+ ### HLS Downloader
108
+
109
+ Download HTTP Live Streaming (HLS) content from m3u8 URLs.
110
+
111
+ ```python
112
+ from StreamingCommunity.Download import HLS_Downloader
113
+
114
+ # Initialize with m3u8 URL and optional output path
115
+ downloader = HLS_Downloader(
116
+ m3u8_url="https://example.com/stream.m3u8",
117
+ output_path="/downloads/video.mp4" # Optional
118
+ )
119
+
120
+ # Start the download
121
+ downloader.download()
122
+ ```
123
+
124
+ See [HLS example](./Test/Download/HLS.py) for complete usage.
125
+
126
+ ### MP4 Downloader
127
+
128
+ Direct MP4 file downloader with support for custom headers and referrer.
129
+
130
+ ```python
131
+ from StreamingCommunity.Download import MP4_downloader
132
+
133
+ # Basic usage
134
+ downloader = MP4_downloader(
135
+ url="https://example.com/video.mp4",
136
+ path="/downloads/saved_video.mp4"
137
+ )
138
+
139
+ # Advanced usage with custom headers and referrer
140
+ headers = {
141
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
142
+ }
143
+ downloader = MP4_downloader(
144
+ url="https://example.com/video.mp4",
145
+ path="/downloads/saved_video.mp4",
146
+ referer="https://example.com",
147
+ headers_=headers
148
+ )
149
+
150
+ # Start download
151
+ downloader.download()
152
+ ```
153
+
154
+ See [MP4 example](./Test/Download/MP4.py) for complete usage.
155
+
156
+ ### Torrent Client
157
+
158
+ Download content via torrent magnet links.
159
+
160
+ ```python
161
+ from StreamingCommunity.Download import TOR_downloader
162
+
163
+ # Initialize torrent client
164
+ client = TOR_downloader()
165
+
166
+ # Add magnet link
167
+ client.add_magnet_link("magnet:?xt=urn:btih:example_hash&dn=example_name")
168
+
169
+ # Start download
170
+ client.start_download()
171
+
172
+ # Move downloaded files to specific location
173
+ client.move_downloaded_files("/downloads/torrents/")
113
174
  ```
114
175
 
176
+ See [Torrent example](./Test/Download/TOR.py) for complete usage.
177
+
178
+
115
179
  ## 2. Automatic Installation
116
180
 
117
181
  ### Supported Operating Systems 💿
@@ -11,6 +11,7 @@ class Episode:
11
11
  self.number: int = data.get('number', 1)
12
12
  self.name: str = data.get('name', '')
13
13
  self.duration: int = data.get('duration', 0)
14
+ self.url: str = data.get('url', '')
14
15
 
15
16
  def __str__(self):
16
17
  return f"Episode(id={self.id}, number={self.number}, name='{self.name}', duration={self.duration} sec)"
@@ -35,69 +36,70 @@ class EpisodeManager:
35
36
 
36
37
  Parameters:
37
38
  - index (int): The zero-based index of the episode to retrieve.
38
-
39
- Returns:
40
- Episode: The Episode object at the specified index.
41
39
  """
42
40
  return self.episodes[index]
43
41
 
44
- def length(self) -> int:
45
- """
46
- Get the number of episodes in the manager.
47
-
48
- Returns:
49
- int: Number of episodes.
50
- """
51
- return len(self.episodes)
52
-
53
42
  def clear(self) -> None:
54
43
  """
55
44
  This method clears the episodes list.
56
-
57
- Parameters:
58
- - self: The object instance.
59
45
  """
60
46
  self.episodes.clear()
61
47
 
48
+ def __len__(self) -> int:
49
+ """
50
+ Get the number of episodes in the manager.
51
+ """
52
+ return len(self.episodes)
53
+
62
54
  def __str__(self):
63
55
  return f"EpisodeManager(num_episodes={len(self.episodes)})"
64
56
 
65
57
 
66
- class SeasonData:
58
+ class Season:
67
59
  def __init__(self, data: Dict[str, Any]):
68
60
  self.id: int = data.get('id', 0)
69
61
  self.number: int = data.get('number', 0)
62
+ self.name: str = data.get('name', '')
63
+ self.slug: str = data.get('slug', '')
64
+ self.type: str = data.get('type', '')
65
+ self.episodes: EpisodeManager = EpisodeManager()
70
66
 
71
67
  def __str__(self):
72
- return f"SeasonData(id={self.id}, number={self.number}, name='{self.name}'"
68
+ return f"Season(id={self.id}, number={self.number}, name='{self.name}', episodes={self.episodes.length()})"
69
+
73
70
 
74
71
  class SeasonManager:
75
72
  def __init__(self):
76
- self.seasons: List[SeasonData] = []
73
+ self.seasons: List[Season] = []
77
74
 
78
- def add_season(self, season_data):
79
- season = SeasonData(season_data)
75
+ def add_season(self, season_data: Dict[str, Any]) -> Season:
76
+ """
77
+ Add a new season to the manager and return it.
78
+
79
+ Parameters:
80
+ - season_data (Dict[str, Any]): A dictionary containing data for the new season.
81
+ """
82
+ season = Season(season_data)
80
83
  self.seasons.append(season)
84
+ return season
81
85
 
82
- def get_season_by_number(self, number: int) -> Optional[Dict]:
83
- return self.seasons[number]
84
-
85
- class Season:
86
- def __init__(self, season_data: Dict[str, Union[int, str, None]]):
87
- self.season_data = season_data
88
-
89
- self.id: int = season_data.get('id', 0)
90
- self.number: int = season_data.get('number', 0)
91
- self.name: str = season_data.get('name', '')
92
- self.slug: str = season_data.get('slug', '')
93
- self.type: str = season_data.get('type', '')
94
- self.seasons_count: int = season_data.get('seasons_count', 0)
86
+ def get_season_by_number(self, number: int) -> Optional[Season]:
87
+ """
88
+ Get a season by its number.
95
89
 
96
- self.episodes: EpisodeManager = EpisodeManager()
97
-
98
- self.seasonsData: SeasonManager = SeasonManager()
99
- for element in season_data['seasons']:
100
- self.seasonsData.add_season(element)
90
+ Parameters:
91
+ - number (int): The season number (1-based index)
92
+ """
93
+ for season in self.seasons:
94
+ if season.number == number:
95
+ return season
96
+ return None
97
+
98
+ def __len__(self) -> int:
99
+ """
100
+ Return the number of seasons managed.
101
+ """
102
+ return len(self.seasons)
101
103
 
102
104
 
103
105
  class Stream:
@@ -48,11 +48,7 @@ class VideoSource:
48
48
 
49
49
  return self.redirect_url
50
50
 
51
- except httpx.RequestError as e:
52
- logging.error(f"Error during the initial request: {e}")
53
- raise
54
-
55
- except AttributeError as e:
51
+ except Exception as e:
56
52
  logging.error(f"Error parsing HTML: {e}")
57
53
  raise
58
54
 
@@ -98,12 +94,8 @@ class VideoSource:
98
94
 
99
95
  return self.maxstream_url
100
96
 
101
- except httpx.RequestError as e:
102
- logging.error(f"Error during the request to the redirect URL: {e}")
103
- raise
104
-
105
- except AttributeError as e:
106
- logging.error(f"Error parsing HTML: {e}")
97
+ except Exception as e:
98
+ logging.error(f"Error during the request: {e}")
107
99
  raise
108
100
 
109
101
  def get_m3u8_url(self):
@@ -130,6 +122,9 @@ class VideoSource:
130
122
  logging.info(f"M3U8 URL: {self.m3u8_url}")
131
123
  break
132
124
 
125
+ else:
126
+ logging.error("Failed to find M3U8 URL: No match found")
127
+
133
128
  return self.m3u8_url
134
129
 
135
130
  except Exception as e:
@@ -119,6 +119,8 @@ class VideoSource:
119
119
 
120
120
  if match:
121
121
  return match.group(1)
122
+ else:
123
+ logging.error("Failed to find M3U8 URL: No match found")
122
124
 
123
125
  else:
124
126
 
@@ -151,6 +153,8 @@ class VideoSource:
151
153
 
152
154
  if match:
153
155
  return match.group(1)
156
+ else:
157
+ logging.error("Failed to find M3U8 URL: No match found")
154
158
 
155
159
  return None
156
160
 
@@ -16,7 +16,6 @@ from StreamingCommunity.Util.table import TVShowManager
16
16
 
17
17
  # Logic class
18
18
  from StreamingCommunity.Api.Template.config_loader import site_constant
19
- from StreamingCommunity.Api.Template.Util import search_domain
20
19
  from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
21
20
 
22
21
 
@@ -40,14 +39,6 @@ def title_search(word_to_search: str) -> int:
40
39
  media_search_manager.clear()
41
40
  table_show_manager.clear()
42
41
 
43
- # Check if domain is working
44
- domain_to_use, base_url = search_domain(site_constant.FULL_URL)
45
-
46
- if domain_to_use is None or base_url is None:
47
- console.log("[bold red]Error: Unable to determine valid domain or base URL.[/bold red]")
48
- console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
49
- sys.exit(1)
50
-
51
42
  search_url = f"{site_constant.FULL_URL}/search/{word_to_search}/1/"
52
43
  console.print(f"[cyan]Search url: [yellow]{search_url}")
53
44
 
@@ -57,6 +48,7 @@ def title_search(word_to_search: str) -> int:
57
48
 
58
49
  except Exception as e:
59
50
  console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
51
+ return 0
60
52
 
61
53
  # Create soup and find table
62
54
  soup = BeautifulSoup(response.text, "html.parser")
@@ -0,0 +1,61 @@
1
+ # 21.05.24
2
+
3
+ from urllib.parse import quote_plus
4
+
5
+
6
+ # External library
7
+ from rich.console import Console
8
+ from rich.prompt import Prompt
9
+
10
+
11
+ # Internal utilities
12
+ from StreamingCommunity.Api.Template import get_select_title
13
+
14
+
15
+ # Logic class
16
+ from StreamingCommunity.Api.Template.config_loader import site_constant
17
+ from .site import title_search, table_show_manager, media_search_manager
18
+ from .film import download_film
19
+ from .series import download_series
20
+
21
+
22
+ # Variable
23
+ indice = 2
24
+ _useFor = "film_serie"
25
+ _deprecate = False
26
+ _priority = 1
27
+ _engineDownload = "hls"
28
+
29
+ msg = Prompt()
30
+ console = Console()
31
+
32
+
33
+ def search(string_to_search: str = None, get_onylDatabase: bool = False):
34
+ """
35
+ Main function of the application for film and series.
36
+ """
37
+ if string_to_search is None:
38
+ string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{site_constant.SITE_NAME}").strip()
39
+
40
+ len_database = title_search(quote_plus(string_to_search))
41
+
42
+ # Return list of elements
43
+ if get_onylDatabase:
44
+ return media_search_manager
45
+
46
+ if len_database > 0:
47
+
48
+ # Select title from list
49
+ select_title = get_select_title(table_show_manager, media_search_manager)
50
+
51
+ if select_title.type == 'tv':
52
+ download_series(select_title)
53
+
54
+ else:
55
+ download_film(select_title)
56
+
57
+ else:
58
+ console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
59
+
60
+ # Retry
61
+ search()
@@ -0,0 +1,98 @@
1
+ # 3.12.23
2
+
3
+ import os
4
+
5
+
6
+ # External library
7
+ import httpx
8
+ from bs4 import BeautifulSoup
9
+ from rich.console import Console
10
+
11
+
12
+ # Internal utilities
13
+ from StreamingCommunity.Util.os import os_manager
14
+ from StreamingCommunity.Util.message import start_message
15
+ from StreamingCommunity.Util.headers import get_headers
16
+ from StreamingCommunity.Util.config_json import config_manager
17
+ from StreamingCommunity.Lib.Downloader import HLS_Downloader
18
+
19
+
20
+ # Logic class
21
+ from StreamingCommunity.Api.Template.config_loader import site_constant
22
+ from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
23
+
24
+
25
+ # Player
26
+ from StreamingCommunity.Api.Player.supervideo import VideoSource
27
+
28
+
29
+ # Variable
30
+ console = Console()
31
+ max_timeout = config_manager.get_int("REQUESTS", "timeout")
32
+
33
+
34
+ def download_film(select_title: MediaItem) -> str:
35
+ """
36
+ Downloads a film using the provided film ID, title name, and domain.
37
+
38
+ Parameters:
39
+ - select_title (MediaItem): The selected media item.
40
+
41
+ Return:
42
+ - str: output path if successful, otherwise None
43
+ """
44
+ start_message()
45
+ console.print(f"[yellow]Download: [red]{select_title.name} \n")
46
+
47
+ # Extract mostraguarda link
48
+ try:
49
+ response = httpx.get(select_title.url, headers=get_headers(), timeout=10)
50
+ response.raise_for_status()
51
+
52
+ except Exception as e:
53
+ console.print(f"[red]Error fetching the page: {e}")
54
+ return None
55
+
56
+ # Create mostraguarda url
57
+ soup = BeautifulSoup(response.text, "html.parser")
58
+ iframe_tag = soup.find_all("iframe")
59
+ url_mostraGuarda = iframe_tag[0].get('data-src')
60
+ if not url_mostraGuarda:
61
+ console.print("Error: data-src attribute not found in iframe.")
62
+
63
+ # Extract supervideo URL
64
+ try:
65
+ response = httpx.get(url_mostraGuarda, headers=get_headers(), timeout=10)
66
+ response.raise_for_status()
67
+
68
+ except Exception as e:
69
+ console.print(f"[red]Error fetching mostraguarda link: {e}")
70
+ return None
71
+
72
+ # Create supervio URL
73
+ soup = BeautifulSoup(response.text, "html.parser")
74
+ player_links = soup.find("ul", class_="_player-mirrors")
75
+ player_items = player_links.find_all("li")
76
+ supervideo_url = "https:" + player_items[0].get("data-link")
77
+ if not supervideo_url:
78
+ return None
79
+
80
+ # Init class
81
+ video_source = VideoSource(url=supervideo_url)
82
+ master_playlist = video_source.get_playlist()
83
+
84
+ # Define the filename and path for the downloaded film
85
+ title_name = os_manager.get_sanitize_file(select_title.name) + ".mp4"
86
+ mp4_path = os.path.join(site_constant.MOVIE_FOLDER, title_name.replace(".mp4", ""))
87
+
88
+ # Download the film using the m3u8 playlist, and output filename
89
+ r_proc = HLS_Downloader(
90
+ m3u8_url=master_playlist,
91
+ output_path=os.path.join(mp4_path, title_name)
92
+ ).start()
93
+
94
+ if r_proc['error'] is not None:
95
+ try: os.remove(r_proc['path'])
96
+ except: pass
97
+
98
+ return r_proc['path']