StreamingCommunity 2.7.0__py3-none-any.whl → 2.8.0__py3-none-any.whl
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.
- StreamingCommunity/Api/Player/ddl.py +2 -2
- StreamingCommunity/Api/Player/maxstream.py +7 -13
- StreamingCommunity/Api/Player/supervideo.py +7 -33
- StreamingCommunity/Api/Player/vixcloud.py +8 -80
- StreamingCommunity/Api/Site/1337xx/__init__.py +8 -1
- StreamingCommunity/Api/Site/1337xx/site.py +10 -16
- StreamingCommunity/Api/Site/1337xx/title.py +4 -1
- StreamingCommunity/Api/Site/animeunity/__init__.py +9 -2
- StreamingCommunity/Api/Site/animeunity/film_serie.py +7 -1
- StreamingCommunity/Api/Site/animeunity/site.py +8 -10
- StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +1 -1
- StreamingCommunity/Api/Site/cb01new/__init__.py +8 -1
- StreamingCommunity/Api/Site/cb01new/film.py +7 -1
- StreamingCommunity/Api/Site/cb01new/site.py +16 -15
- StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +9 -2
- StreamingCommunity/Api/Site/ddlstreamitaly/series.py +7 -1
- StreamingCommunity/Api/Site/ddlstreamitaly/site.py +10 -15
- StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +1 -1
- StreamingCommunity/Api/Site/guardaserie/__init__.py +9 -2
- StreamingCommunity/Api/Site/guardaserie/series.py +9 -1
- StreamingCommunity/Api/Site/guardaserie/site.py +12 -17
- StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +1 -1
- StreamingCommunity/Api/Site/mostraguarda/__init__.py +6 -2
- StreamingCommunity/Api/Site/mostraguarda/film.py +7 -3
- StreamingCommunity/Api/Site/streamingcommunity/__init__.py +9 -2
- StreamingCommunity/Api/Site/streamingcommunity/film.py +8 -1
- StreamingCommunity/Api/Site/streamingcommunity/series.py +14 -5
- StreamingCommunity/Api/Site/streamingcommunity/site.py +10 -15
- StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +2 -2
- StreamingCommunity/Api/Template/Util/__init__.py +0 -1
- StreamingCommunity/Api/Template/Util/get_domain.py +24 -66
- StreamingCommunity/Api/Template/Util/manage_ep.py +10 -5
- StreamingCommunity/Api/Template/config_loader.py +8 -8
- StreamingCommunity/Api/Template/site.py +3 -6
- StreamingCommunity/Lib/Downloader/HLS/downloader.py +10 -13
- StreamingCommunity/Lib/Downloader/HLS/segments.py +11 -31
- StreamingCommunity/Lib/Downloader/MP4/downloader.py +12 -9
- StreamingCommunity/Lib/Downloader/TOR/downloader.py +109 -101
- StreamingCommunity/Lib/FFmpeg/__init__.py +1 -1
- StreamingCommunity/Lib/FFmpeg/capture.py +10 -12
- StreamingCommunity/Lib/FFmpeg/command.py +15 -14
- StreamingCommunity/Lib/FFmpeg/util.py +9 -38
- StreamingCommunity/Lib/M3U8/decryptor.py +72 -146
- StreamingCommunity/Lib/M3U8/estimator.py +8 -16
- StreamingCommunity/Lib/M3U8/parser.py +1 -17
- StreamingCommunity/Lib/M3U8/url_fixer.py +1 -4
- StreamingCommunity/Lib/TMBD/__init__.py +2 -0
- StreamingCommunity/Lib/TMBD/obj_tmbd.py +3 -17
- StreamingCommunity/Lib/TMBD/tmdb.py +4 -9
- StreamingCommunity/TelegramHelp/telegram_bot.py +50 -50
- StreamingCommunity/Upload/update.py +3 -2
- StreamingCommunity/Upload/version.py +1 -1
- StreamingCommunity/Util/color.py +1 -1
- StreamingCommunity/Util/{_jsonConfig.py → config_json.py} +148 -54
- StreamingCommunity/Util/headers.py +2 -38
- StreamingCommunity/Util/logger.py +72 -42
- StreamingCommunity/Util/message.py +8 -3
- StreamingCommunity/Util/os.py +41 -93
- StreamingCommunity/Util/table.py +8 -17
- StreamingCommunity/run.py +26 -34
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/METADATA +165 -92
- StreamingCommunity-2.8.0.dist-info/RECORD +75 -0
- StreamingCommunity/Api/Template/Util/recall_search.py +0 -37
- StreamingCommunity/Lib/Downloader/HLS/proxyes.py +0 -110
- StreamingCommunity/Util/call_stack.py +0 -42
- StreamingCommunity/Util/console.py +0 -12
- StreamingCommunity-2.7.0.dist-info/RECORD +0 -79
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/LICENSE +0 -0
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/WHEEL +0 -0
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/entry_points.txt +0 -0
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/top_level.txt +0 -0
|
@@ -9,7 +9,7 @@ from bs4 import BeautifulSoup
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
# Internal utilities
|
|
12
|
-
from StreamingCommunity.Util.
|
|
12
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
13
13
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
14
|
|
|
15
15
|
|
|
@@ -85,4 +85,4 @@ class VideoSource:
|
|
|
85
85
|
logging.error("Failed to retrieve content from the URL.")
|
|
86
86
|
|
|
87
87
|
except Exception as e:
|
|
88
|
-
logging.error(f"An error occurred while parsing the playlist: {e}")
|
|
88
|
+
logging.error(f"An error occurred while parsing the playlist: {e}")
|
|
@@ -11,12 +11,12 @@ from bs4 import BeautifulSoup
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
# Internal utilities
|
|
14
|
-
from StreamingCommunity.Util.
|
|
14
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
15
15
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
# Variable
|
|
19
|
-
|
|
19
|
+
MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class VideoSource:
|
|
@@ -38,9 +38,7 @@ class VideoSource:
|
|
|
38
38
|
Sends a request to the initial URL and extracts the redirect URL.
|
|
39
39
|
"""
|
|
40
40
|
try:
|
|
41
|
-
|
|
42
|
-
# Send a GET request to the initial URL
|
|
43
|
-
response = httpx.get(self.url, headers=self.headers, follow_redirects=True, timeout=max_timeout)
|
|
41
|
+
response = httpx.get(self.url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
44
42
|
response.raise_for_status()
|
|
45
43
|
|
|
46
44
|
# Extract the redirect URL from the HTML
|
|
@@ -63,9 +61,7 @@ class VideoSource:
|
|
|
63
61
|
Sends a request to the redirect URL and extracts the Maxstream URL.
|
|
64
62
|
"""
|
|
65
63
|
try:
|
|
66
|
-
|
|
67
|
-
# Send a GET request to the redirect URL
|
|
68
|
-
response = httpx.get(self.redirect_url, headers=self.headers, follow_redirects=True, timeout=max_timeout)
|
|
64
|
+
response = httpx.get(self.redirect_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
69
65
|
response.raise_for_status()
|
|
70
66
|
|
|
71
67
|
# Extract the Maxstream URL from the HTML
|
|
@@ -89,7 +85,7 @@ class VideoSource:
|
|
|
89
85
|
uprot_url = response.json()['data']['value']
|
|
90
86
|
|
|
91
87
|
# Retry getting maxtstream url
|
|
92
|
-
response = httpx.get(uprot_url, headers=self.headers, follow_redirects=True, timeout=
|
|
88
|
+
response = httpx.get(uprot_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
93
89
|
response.raise_for_status()
|
|
94
90
|
soup = BeautifulSoup(response.text, "html.parser")
|
|
95
91
|
maxstream_url = soup.find("a").get("href")
|
|
@@ -115,9 +111,7 @@ class VideoSource:
|
|
|
115
111
|
Sends a request to the Maxstream URL and extracts the .m3u8 file URL.
|
|
116
112
|
"""
|
|
117
113
|
try:
|
|
118
|
-
|
|
119
|
-
# Send a GET request to the Maxstream URL
|
|
120
|
-
response = httpx.get(self.maxstream_url, headers=self.headers, follow_redirects=True, timeout=max_timeout)
|
|
114
|
+
response = httpx.get(self.maxstream_url, headers=self.headers, follow_redirects=True, timeout=MAX_TIMEOUT)
|
|
121
115
|
response.raise_for_status()
|
|
122
116
|
soup = BeautifulSoup(response.text, "html.parser")
|
|
123
117
|
|
|
@@ -148,4 +142,4 @@ class VideoSource:
|
|
|
148
142
|
"""
|
|
149
143
|
self.get_redirect_url()
|
|
150
144
|
self.get_maxstream_url()
|
|
151
|
-
return self.get_m3u8_url()
|
|
145
|
+
return self.get_m3u8_url()
|
|
@@ -11,12 +11,12 @@ from bs4 import BeautifulSoup
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
# Internal utilities
|
|
14
|
-
from StreamingCommunity.Util.
|
|
14
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
15
15
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
# Variable
|
|
19
|
-
|
|
19
|
+
MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class VideoSource:
|
|
@@ -45,40 +45,15 @@ class VideoSource:
|
|
|
45
45
|
Returns:
|
|
46
46
|
- str: The response content if successful, None otherwise.
|
|
47
47
|
"""
|
|
48
|
-
|
|
49
48
|
try:
|
|
50
|
-
response = self.client.get(
|
|
51
|
-
url=url,
|
|
52
|
-
headers=self.headers,
|
|
53
|
-
follow_redirects=True,
|
|
54
|
-
timeout=max_timeout
|
|
55
|
-
)
|
|
49
|
+
response = self.client.get(url, headers=self.headers, timeout=MAX_TIMEOUT, follow_redirects=True)
|
|
56
50
|
response.raise_for_status()
|
|
57
51
|
return response.text
|
|
58
52
|
|
|
59
53
|
except Exception as e:
|
|
60
54
|
logging.error(f"Request failed: {e}")
|
|
61
55
|
return None
|
|
62
|
-
|
|
63
|
-
def parse_html(self, html_content: str) -> BeautifulSoup:
|
|
64
|
-
"""
|
|
65
|
-
Parse the provided HTML content using BeautifulSoup.
|
|
66
|
-
|
|
67
|
-
Parameters:
|
|
68
|
-
- html_content (str): The HTML content to parse.
|
|
69
|
-
|
|
70
|
-
Returns:
|
|
71
|
-
- BeautifulSoup: Parsed HTML content if successful, None otherwise.
|
|
72
|
-
"""
|
|
73
|
-
|
|
74
|
-
try:
|
|
75
|
-
soup = BeautifulSoup(html_content, "html.parser")
|
|
76
|
-
return soup
|
|
77
|
-
|
|
78
|
-
except Exception as e:
|
|
79
|
-
logging.error(f"Failed to parse HTML content: {e}")
|
|
80
|
-
return None
|
|
81
|
-
|
|
56
|
+
|
|
82
57
|
def get_iframe(self, soup):
|
|
83
58
|
"""
|
|
84
59
|
Extracts the source URL of the second iframe in the provided BeautifulSoup object.
|
|
@@ -107,7 +82,7 @@ class VideoSource:
|
|
|
107
82
|
"""
|
|
108
83
|
content = self.make_request(url)
|
|
109
84
|
if content:
|
|
110
|
-
return
|
|
85
|
+
return BeautifulSoup(content, "html.parser")
|
|
111
86
|
|
|
112
87
|
return None
|
|
113
88
|
|
|
@@ -140,7 +115,7 @@ class VideoSource:
|
|
|
140
115
|
logging.error("Failed to fetch HTML content.")
|
|
141
116
|
return None
|
|
142
117
|
|
|
143
|
-
soup =
|
|
118
|
+
soup = BeautifulSoup(html_content, "html.parser")
|
|
144
119
|
if not soup:
|
|
145
120
|
logging.error("Failed to parse HTML content.")
|
|
146
121
|
return None
|
|
@@ -190,5 +165,4 @@ class VideoSource:
|
|
|
190
165
|
|
|
191
166
|
except Exception as e:
|
|
192
167
|
logging.error(f"An error occurred: {e}")
|
|
193
|
-
return None
|
|
194
|
-
|
|
168
|
+
return None
|
|
@@ -8,18 +8,19 @@ from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
|
|
8
8
|
# External libraries
|
|
9
9
|
import httpx
|
|
10
10
|
from bs4 import BeautifulSoup
|
|
11
|
+
from rich.console import Console
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
# Internal utilities
|
|
14
15
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
15
|
-
from StreamingCommunity.Util.
|
|
16
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
16
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
17
17
|
from .Helper.Vixcloud.util import WindowVideo, WindowParameter, StreamsCollection
|
|
18
18
|
from .Helper.Vixcloud.js_parser import JavaScriptParser
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
# Variable
|
|
22
|
-
|
|
22
|
+
MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
|
|
23
|
+
console = Console()
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
class VideoSource:
|
|
@@ -60,13 +61,7 @@ class VideoSource:
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
try:
|
|
63
|
-
|
|
64
|
-
# Make a request to get iframe source
|
|
65
|
-
response = httpx.get(
|
|
66
|
-
url=f"{self.url}/iframe/{self.media_id}",
|
|
67
|
-
params=params,
|
|
68
|
-
timeout=max_timeout
|
|
69
|
-
)
|
|
64
|
+
response = httpx.get(f"{self.url}/iframe/{self.media_id}", params=params, timeout=MAX_TIMEOUT)
|
|
70
65
|
response.raise_for_status()
|
|
71
66
|
|
|
72
67
|
# Parse response with BeautifulSoup to get iframe source
|
|
@@ -108,19 +103,8 @@ class VideoSource:
|
|
|
108
103
|
"""
|
|
109
104
|
try:
|
|
110
105
|
if self.iframe_src is not None:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
try:
|
|
114
|
-
response = httpx.get(
|
|
115
|
-
url=self.iframe_src,
|
|
116
|
-
headers=self.headers,
|
|
117
|
-
timeout=max_timeout
|
|
118
|
-
)
|
|
119
|
-
response.raise_for_status()
|
|
120
|
-
|
|
121
|
-
except Exception as e:
|
|
122
|
-
logging.error(f"Failed to get vixcloud contente with error: {e}")
|
|
123
|
-
sys.exit(0)
|
|
106
|
+
response = httpx.get(self.iframe_src, headers=self.headers, timeout=MAX_TIMEOUT)
|
|
107
|
+
response.raise_for_status()
|
|
124
108
|
|
|
125
109
|
# Parse response with BeautifulSoup to get content
|
|
126
110
|
soup = BeautifulSoup(response.text, "html.parser")
|
|
@@ -140,7 +124,6 @@ class VideoSource:
|
|
|
140
124
|
Returns:
|
|
141
125
|
str: Fully constructed playlist URL with authentication parameters
|
|
142
126
|
"""
|
|
143
|
-
# Initialize parameters dictionary
|
|
144
127
|
params = {}
|
|
145
128
|
|
|
146
129
|
# Add 'h' parameter if video quality is 1080p
|
|
@@ -167,56 +150,6 @@ class VideoSource:
|
|
|
167
150
|
# Construct the new URL with updated query parameters
|
|
168
151
|
return urlunparse(parsed_url._replace(query=query_string))
|
|
169
152
|
|
|
170
|
-
def get_mp4(self, url_to_download: str, scws_id: str) -> list:
|
|
171
|
-
"""
|
|
172
|
-
Generate download links for the specified resolutions from StreamingCommunity.
|
|
173
|
-
|
|
174
|
-
Args:
|
|
175
|
-
url_to_download (str): URL of the video page.
|
|
176
|
-
scws_id (str): SCWS ID of the title.
|
|
177
|
-
|
|
178
|
-
Returns:
|
|
179
|
-
list: A list of video download URLs.
|
|
180
|
-
"""
|
|
181
|
-
headers = {
|
|
182
|
-
'referer': url_to_download,
|
|
183
|
-
'user-agent': get_userAgent(),
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
# API request to get video details
|
|
187
|
-
video_api_url = f'{self.url}/api/video/{scws_id}'
|
|
188
|
-
response = httpx.get(video_api_url, headers=headers)
|
|
189
|
-
|
|
190
|
-
if response.status_code == 200:
|
|
191
|
-
response_json = response.json()
|
|
192
|
-
|
|
193
|
-
video_tracks = response_json.get('video_tracks', [])
|
|
194
|
-
track = video_tracks[-1]
|
|
195
|
-
console.print(f"[cyan]Available resolutions: [red]{[str(track['quality']) for track in video_tracks]}")
|
|
196
|
-
|
|
197
|
-
# Request download link generation for each track
|
|
198
|
-
download_response = httpx.post(
|
|
199
|
-
url=f'{self.url}/api/download/generate_link?scws_id={track["video_id"]}&rendition={track["quality"]}',
|
|
200
|
-
headers={
|
|
201
|
-
'referer': url_to_download,
|
|
202
|
-
'user-agent': get_userAgent(),
|
|
203
|
-
'x-xsrf-token': config_manager.get("SITE", self.base_name)['extra']['x-xsrf-token']
|
|
204
|
-
},
|
|
205
|
-
cookies={
|
|
206
|
-
'streamingcommunity_session': config_manager.get("SITE", self.base_name)['extra']['streamingcommunity_session']
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
if download_response.status_code == 200:
|
|
211
|
-
return {'url': download_response.text, 'quality': track["quality"]}
|
|
212
|
-
|
|
213
|
-
else:
|
|
214
|
-
logging.error(f"Failed to generate link for resolution {track['quality']} (HTTP {download_response.status_code}).")
|
|
215
|
-
|
|
216
|
-
else:
|
|
217
|
-
logging.error(f"Error fetching video API URL (HTTP {response.status_code}).")
|
|
218
|
-
return []
|
|
219
|
-
|
|
220
153
|
|
|
221
154
|
class VideoSourceAnime(VideoSource):
|
|
222
155
|
def __init__(self, url: str):
|
|
@@ -243,12 +176,7 @@ class VideoSourceAnime(VideoSource):
|
|
|
243
176
|
str: Parsed script content
|
|
244
177
|
"""
|
|
245
178
|
try:
|
|
246
|
-
|
|
247
|
-
response = httpx.get(
|
|
248
|
-
url=f"{self.url}/embed-url/{episode_id}",
|
|
249
|
-
headers=self.headers,
|
|
250
|
-
timeout=max_timeout
|
|
251
|
-
)
|
|
179
|
+
response = httpx.get(f"{self.url}/embed-url/{episode_id}", headers=self.headers, timeout=MAX_TIMEOUT)
|
|
252
180
|
response.raise_for_status()
|
|
253
181
|
|
|
254
182
|
# Extract and clean embed URL
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
from urllib.parse import quote_plus
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
# External library
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.prompt import Prompt
|
|
9
|
+
|
|
10
|
+
|
|
6
11
|
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util.console import console, msg
|
|
8
12
|
from StreamingCommunity.Api.Template import get_select_title
|
|
9
13
|
|
|
10
14
|
|
|
@@ -21,6 +25,9 @@ _deprecate = False
|
|
|
21
25
|
_priority = 2
|
|
22
26
|
_engineDownload = "tor"
|
|
23
27
|
|
|
28
|
+
console = Console()
|
|
29
|
+
msg = Prompt()
|
|
30
|
+
|
|
24
31
|
|
|
25
32
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
26
33
|
"""
|
|
@@ -5,11 +5,11 @@ import sys
|
|
|
5
5
|
# External libraries
|
|
6
6
|
import httpx
|
|
7
7
|
from bs4 import BeautifulSoup
|
|
8
|
+
from rich.console import Console
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
# Internal utilities
|
|
11
|
-
from StreamingCommunity.Util.
|
|
12
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
12
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
13
13
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
14
|
from StreamingCommunity.Util.table import TVShowManager
|
|
15
15
|
|
|
@@ -21,10 +21,10 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
# Variable
|
|
24
|
+
console = Console()
|
|
24
25
|
media_search_manager = MediaManager()
|
|
25
26
|
table_show_manager = TVShowManager()
|
|
26
27
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
27
|
-
disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
def title_search(word_to_search: str) -> int:
|
|
@@ -40,25 +40,19 @@ def title_search(word_to_search: str) -> int:
|
|
|
40
40
|
media_search_manager.clear()
|
|
41
41
|
table_show_manager.clear()
|
|
42
42
|
|
|
43
|
-
#
|
|
44
|
-
domain_to_use = site_constant.
|
|
45
|
-
|
|
46
|
-
if not disable_searchDomain:
|
|
47
|
-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
43
|
+
# Check if domain is working
|
|
44
|
+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
48
45
|
|
|
49
46
|
if domain_to_use is None or base_url is None:
|
|
50
|
-
console.
|
|
47
|
+
console.log("[bold red]Error: Unable to determine valid domain or base URL.[/bold red]")
|
|
51
48
|
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
|
|
52
49
|
sys.exit(1)
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
search_url = f"{site_constant.FULL_URL}/search/{word_to_search}/1/"
|
|
52
|
+
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
|
53
|
+
|
|
55
54
|
try:
|
|
56
|
-
response = httpx.get(
|
|
57
|
-
url=f"{site_constant.FULL_URL}/search/{word_to_search}/1/",
|
|
58
|
-
headers={'user-agent': get_userAgent()},
|
|
59
|
-
follow_redirects=True,
|
|
60
|
-
timeout=max_timeout
|
|
61
|
-
)
|
|
55
|
+
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
|
62
56
|
response.raise_for_status()
|
|
63
57
|
|
|
64
58
|
except Exception as e:
|
|
@@ -6,10 +6,10 @@ import os
|
|
|
6
6
|
# External libraries
|
|
7
7
|
import httpx
|
|
8
8
|
from bs4 import BeautifulSoup
|
|
9
|
+
from rich.console import Console
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
# Internal utilities
|
|
12
|
-
from StreamingCommunity.Util.console import console
|
|
13
13
|
from StreamingCommunity.Util.os import os_manager
|
|
14
14
|
from StreamingCommunity.Util.message import start_message
|
|
15
15
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
@@ -21,6 +21,9 @@ from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
|
21
21
|
from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
# Variable
|
|
25
|
+
console = Console()
|
|
26
|
+
|
|
24
27
|
|
|
25
28
|
def download_title(select_title: MediaItem):
|
|
26
29
|
"""
|
|
@@ -4,8 +4,12 @@ import sys
|
|
|
4
4
|
import subprocess
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
# External library
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.prompt import Prompt
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
# Internal utilities
|
|
8
|
-
from StreamingCommunity.Util.console import console, msg
|
|
9
13
|
from StreamingCommunity.Api.Template import get_select_title
|
|
10
14
|
from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
|
|
11
15
|
|
|
@@ -23,6 +27,9 @@ _deprecate = False
|
|
|
23
27
|
_priority = 2
|
|
24
28
|
_engineDownload = "mp4"
|
|
25
29
|
|
|
30
|
+
msg = Prompt()
|
|
31
|
+
console = Console()
|
|
32
|
+
|
|
26
33
|
|
|
27
34
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
28
35
|
|
|
@@ -34,7 +41,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
|
34
41
|
# Chiedi la scelta all'utente con il bot Telegram
|
|
35
42
|
string_to_search = bot.ask(
|
|
36
43
|
"key_search",
|
|
37
|
-
f"Inserisci la parola da cercare\noppure
|
|
44
|
+
f"Inserisci la parola da cercare\noppure back per tornare alla scelta: ",
|
|
38
45
|
None
|
|
39
46
|
)
|
|
40
47
|
|
|
@@ -5,8 +5,12 @@ import logging
|
|
|
5
5
|
from typing import Tuple
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
# External library
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
from rich.prompt import Prompt
|
|
11
|
+
|
|
12
|
+
|
|
8
13
|
# Internal utilities
|
|
9
|
-
from StreamingCommunity.Util.console import console, msg
|
|
10
14
|
from StreamingCommunity.Util.os import os_manager
|
|
11
15
|
from StreamingCommunity.Util.message import start_message
|
|
12
16
|
from StreamingCommunity.Lib.Downloader import MP4_downloader
|
|
@@ -25,6 +29,8 @@ from StreamingCommunity.Api.Player.vixcloud import VideoSourceAnime
|
|
|
25
29
|
|
|
26
30
|
|
|
27
31
|
# Variable
|
|
32
|
+
console = Console()
|
|
33
|
+
msg = Prompt()
|
|
28
34
|
KILL_HANDLER = bool(False)
|
|
29
35
|
|
|
30
36
|
|
|
@@ -7,11 +7,11 @@ import logging
|
|
|
7
7
|
# External libraries
|
|
8
8
|
import httpx
|
|
9
9
|
from bs4 import BeautifulSoup
|
|
10
|
+
from rich.console import Console
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
# Internal utilities
|
|
13
|
-
from StreamingCommunity.Util.
|
|
14
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
14
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
15
15
|
from StreamingCommunity.Util.table import TVShowManager
|
|
16
16
|
from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
|
|
17
17
|
|
|
@@ -23,10 +23,10 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
# Variable
|
|
26
|
+
console = Console()
|
|
26
27
|
media_search_manager = MediaManager()
|
|
27
28
|
table_show_manager = TVShowManager()
|
|
28
29
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
29
|
-
disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
def get_token(site_name: str, domain: str) -> dict:
|
|
@@ -110,14 +110,11 @@ def title_search(title: str) -> int:
|
|
|
110
110
|
media_search_manager.clear()
|
|
111
111
|
table_show_manager.clear()
|
|
112
112
|
|
|
113
|
-
#
|
|
114
|
-
domain_to_use = site_constant.
|
|
115
|
-
|
|
116
|
-
if not disable_searchDomain:
|
|
117
|
-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
113
|
+
# Check if domain is working
|
|
114
|
+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
118
115
|
|
|
119
116
|
if domain_to_use is None or base_url is None:
|
|
120
|
-
console.print("[bold red]
|
|
117
|
+
console.print("[bold red]Error: Unable to determine valid domain or base URL.[/bold red]")
|
|
121
118
|
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
|
|
122
119
|
sys.exit(1)
|
|
123
120
|
|
|
@@ -144,7 +141,7 @@ def title_search(title: str) -> int:
|
|
|
144
141
|
# Send a POST request to the API endpoint for live search
|
|
145
142
|
try:
|
|
146
143
|
response = httpx.post(
|
|
147
|
-
|
|
144
|
+
f'{site_constant.FULL_URL}/livesearch',
|
|
148
145
|
cookies=cookies,
|
|
149
146
|
headers=headers,
|
|
150
147
|
json=json_data,
|
|
@@ -175,6 +172,7 @@ def title_search(title: str) -> int:
|
|
|
175
172
|
})
|
|
176
173
|
|
|
177
174
|
if site_constant.TELEGRAM_BOT:
|
|
175
|
+
|
|
178
176
|
# Crea una stringa formattata per ogni scelta con numero
|
|
179
177
|
choice_text = f"{len(choices)} - {dict_title.get('name')} ({dict_title.get('type')}) - Episodi: {dict_title.get('episodes_count')}"
|
|
180
178
|
choices.append(choice_text)
|
|
@@ -9,7 +9,7 @@ import httpx
|
|
|
9
9
|
|
|
10
10
|
# Internal utilities
|
|
11
11
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
12
|
-
from StreamingCommunity.Util.
|
|
12
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
13
13
|
from StreamingCommunity.Api.Player.Helper.Vixcloud.util import EpisodeManager, Episode
|
|
14
14
|
|
|
15
15
|
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
from urllib.parse import quote_plus
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
# External library
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.prompt import Prompt
|
|
9
|
+
|
|
10
|
+
|
|
6
11
|
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util.console import console, msg
|
|
8
12
|
from StreamingCommunity.Api.Template import get_select_title
|
|
9
13
|
|
|
10
14
|
|
|
@@ -21,6 +25,9 @@ _deprecate = False
|
|
|
21
25
|
_priority = 2
|
|
22
26
|
_engineDownload = "mp4"
|
|
23
27
|
|
|
28
|
+
msg = Prompt()
|
|
29
|
+
console = Console()
|
|
30
|
+
|
|
24
31
|
|
|
25
32
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
26
33
|
"""
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
# External library
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util.console import console
|
|
8
11
|
from StreamingCommunity.Util.os import os_manager
|
|
9
12
|
from StreamingCommunity.Util.message import start_message
|
|
10
13
|
from StreamingCommunity.Lib.Downloader import HLS_Downloader
|
|
@@ -19,6 +22,9 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
|
|
19
22
|
from StreamingCommunity.Api.Player.maxstream import VideoSource
|
|
20
23
|
|
|
21
24
|
|
|
25
|
+
# Variable
|
|
26
|
+
console = Console()
|
|
27
|
+
|
|
22
28
|
|
|
23
29
|
def download_film(select_title: MediaItem) -> str:
|
|
24
30
|
"""
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
# External libraries
|
|
6
7
|
import httpx
|
|
7
8
|
from bs4 import BeautifulSoup
|
|
9
|
+
from rich.console import Console
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
# Internal utilities
|
|
11
|
-
from StreamingCommunity.Util.
|
|
12
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
13
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
13
14
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
15
|
from StreamingCommunity.Util.table import TVShowManager
|
|
15
16
|
|
|
@@ -21,10 +22,10 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
# Variable
|
|
25
|
+
console = Console()
|
|
24
26
|
media_search_manager = MediaManager()
|
|
25
27
|
table_show_manager = TVShowManager()
|
|
26
28
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
27
|
-
disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
def title_search(word_to_search: str) -> int:
|
|
@@ -40,23 +41,23 @@ def title_search(word_to_search: str) -> int:
|
|
|
40
41
|
media_search_manager.clear()
|
|
41
42
|
table_show_manager.clear()
|
|
42
43
|
|
|
43
|
-
#
|
|
44
|
-
domain_to_use = site_constant.
|
|
45
|
-
|
|
46
|
-
if not disable_searchDomain:
|
|
47
|
-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
44
|
+
# Check if domain is working
|
|
45
|
+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
48
46
|
|
|
49
47
|
if domain_to_use is None or base_url is None:
|
|
50
|
-
console.print("[bold red]
|
|
48
|
+
console.print("[bold red]Error: Unable to determine valid domain or base URL.[/bold red]")
|
|
51
49
|
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
|
|
52
50
|
sys.exit(1)
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
search_url = f"{site_constant.FULL_URL}/?s={word_to_search}"
|
|
53
|
+
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
|
54
|
+
|
|
55
|
+
try:
|
|
56
|
+
response = httpx.get(url=search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
|
57
|
+
response.raise_for_status()
|
|
58
|
+
|
|
59
|
+
except Exception as e:
|
|
60
|
+
console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
|
|
60
61
|
|
|
61
62
|
# Create soup and find table
|
|
62
63
|
soup = BeautifulSoup(response.text, "html.parser")
|
|
@@ -4,13 +4,17 @@ import logging
|
|
|
4
4
|
from urllib.parse import quote_plus
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
# External library
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.prompt import Prompt
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
# Internal utilities
|
|
8
|
-
from StreamingCommunity.Util.console import console, msg
|
|
9
13
|
from StreamingCommunity.Api.Template import get_select_title
|
|
14
|
+
from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
10
15
|
|
|
11
16
|
|
|
12
17
|
# Logic class
|
|
13
|
-
from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
14
18
|
from .site import title_search, media_search_manager, table_show_manager
|
|
15
19
|
from .series import download_thread
|
|
16
20
|
|
|
@@ -22,6 +26,9 @@ _deprecate = False
|
|
|
22
26
|
_priority = 2
|
|
23
27
|
_engineDownload = "mp4"
|
|
24
28
|
|
|
29
|
+
msg = Prompt()
|
|
30
|
+
console = Console()
|
|
31
|
+
|
|
25
32
|
|
|
26
33
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
27
34
|
"""
|