StreamingCommunity 3.0.0__tar.gz → 3.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of StreamingCommunity might be problematic. Click here for more details.

Files changed (98) hide show
  1. {streamingcommunity-3.0.0/StreamingCommunity.egg-info → streamingcommunity-3.0.1}/PKG-INFO +1 -1
  2. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/1337xx/site.py +4 -1
  3. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +22 -12
  4. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Upload/version.py +1 -1
  5. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/config_json.py +11 -13
  6. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1/StreamingCommunity.egg-info}/PKG-INFO +1 -1
  7. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity.egg-info/SOURCES.txt +0 -3
  8. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/setup.py +1 -1
  9. streamingcommunity-3.0.0/StreamingCommunity/Api/Site/cb01new/__init__.py +0 -71
  10. streamingcommunity-3.0.0/StreamingCommunity/Api/Site/cb01new/film.py +0 -62
  11. streamingcommunity-3.0.0/StreamingCommunity/Api/Site/cb01new/site.py +0 -81
  12. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/LICENSE +0 -0
  13. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/MANIFEST.in +0 -0
  14. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/README.md +0 -0
  15. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -0
  16. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +0 -0
  17. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/ddl.py +0 -0
  18. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/maxstream.py +0 -0
  19. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/mediapolisvod.py +0 -0
  20. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/supervideo.py +0 -0
  21. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/sweetpixel.py +0 -0
  22. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Player/vixcloud.py +0 -0
  23. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/1337xx/__init__.py +0 -0
  24. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/1337xx/title.py +0 -0
  25. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/altadefinizione/__init__.py +0 -0
  26. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/altadefinizione/film.py +0 -0
  27. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/altadefinizione/series.py +0 -0
  28. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/altadefinizione/site.py +0 -0
  29. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/altadefinizione/util/ScrapeSerie.py +0 -0
  30. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeunity/__init__.py +0 -0
  31. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeunity/film.py +0 -0
  32. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeunity/serie.py +0 -0
  33. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeunity/site.py +0 -0
  34. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeworld/__init__.py +0 -0
  35. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeworld/film.py +0 -0
  36. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeworld/serie.py +0 -0
  37. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeworld/site.py +0 -0
  38. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py +0 -0
  39. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +0 -0
  40. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/ddlstreamitaly/series.py +0 -0
  41. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/ddlstreamitaly/site.py +0 -0
  42. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +0 -0
  43. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/guardaserie/__init__.py +0 -0
  44. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/guardaserie/series.py +0 -0
  45. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/guardaserie/site.py +0 -0
  46. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -0
  47. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/raiplay/__init__.py +0 -0
  48. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/raiplay/film.py +0 -0
  49. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/raiplay/series.py +0 -0
  50. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/raiplay/site.py +0 -0
  51. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py +0 -0
  52. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/streamingcommunity/__init__.py +0 -0
  53. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/streamingcommunity/film.py +0 -0
  54. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/streamingcommunity/series.py +0 -0
  55. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/streamingcommunity/site.py +0 -0
  56. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +0 -0
  57. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Template/Class/SearchType.py +0 -0
  58. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Template/Util/__init__.py +0 -0
  59. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Template/Util/manage_ep.py +0 -0
  60. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Template/__init__.py +0 -0
  61. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Template/config_loader.py +0 -0
  62. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Api/Template/site.py +0 -0
  63. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/Downloader/HLS/downloader.py +0 -0
  64. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/Downloader/HLS/segments.py +0 -0
  65. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/Downloader/MP4/downloader.py +0 -0
  66. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -0
  67. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/Downloader/__init__.py +0 -0
  68. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/FFmpeg/__init__.py +0 -0
  69. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/FFmpeg/capture.py +0 -0
  70. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/FFmpeg/command.py +0 -0
  71. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/FFmpeg/util.py +0 -0
  72. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/M3U8/__init__.py +0 -0
  73. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/M3U8/decryptor.py +0 -0
  74. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/M3U8/estimator.py +0 -0
  75. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/M3U8/parser.py +0 -0
  76. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/M3U8/url_fixer.py +0 -0
  77. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/TMBD/__init__.py +0 -0
  78. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -0
  79. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Lib/TMBD/tmdb.py +0 -0
  80. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/TelegramHelp/__init__.py +0 -0
  81. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/TelegramHelp/telegram_bot.py +0 -0
  82. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Upload/update.py +0 -0
  83. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/color.py +0 -0
  84. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/ffmpeg_installer.py +0 -0
  85. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/headers.py +0 -0
  86. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/logger.py +0 -0
  87. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/message.py +0 -0
  88. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/os.py +0 -0
  89. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/Util/table.py +0 -0
  90. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/__init__.py +0 -0
  91. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/global_search.py +0 -0
  92. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity/run.py +0 -0
  93. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity.egg-info/dependency_links.txt +0 -0
  94. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity.egg-info/entry_points.txt +0 -0
  95. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity.egg-info/requires.txt +0 -0
  96. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/StreamingCommunity.egg-info/top_level.txt +0 -0
  97. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/requirements.txt +0 -0
  98. {streamingcommunity-3.0.0 → streamingcommunity-3.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: StreamingCommunity
3
- Version: 3.0.0
3
+ Version: 3.0.1
4
4
  Home-page: https://github.com/Lovi-0/StreamingCommunity
5
5
  Author: Lovi-0
6
6
  Project-URL: Bug Reports, https://github.com/Lovi-0/StreamingCommunity/issues
@@ -58,7 +58,7 @@ def title_search(query: str) -> int:
58
58
  # Create soup and find table
59
59
  soup = BeautifulSoup(response.text, "html.parser")
60
60
 
61
- for tr in soup.find_all('tr'):
61
+ for i, tr in enumerate(soup.find_all('tr')):
62
62
  try:
63
63
 
64
64
  title_info = {
@@ -72,6 +72,9 @@ def title_search(query: str) -> int:
72
72
  }
73
73
  media_search_manager.add_media(title_info)
74
74
 
75
+ if i == 20:
76
+ break
77
+
75
78
  except Exception as e:
76
79
  print(f"Error parsing a film entry: {e}")
77
80
 
@@ -68,22 +68,32 @@ class ScrapeSerieAnime:
68
68
  Fetch all episodes data at once and cache it
69
69
  """
70
70
  try:
71
+ all_episodes = []
71
72
  count = self.get_count_episodes()
72
73
  if not count:
73
74
  return
74
-
75
- response = httpx.get(
76
- url=f"{self.url}/info_api/{self.media_id}/1",
77
- params={
78
- "start_range": 1,
79
- "end_range": count
80
- },
81
- headers=self.headers,
82
- timeout=max_timeout
83
- )
84
- response.raise_for_status()
85
75
 
86
- self.episodes_cache = response.json()["episodes"]
76
+ # Fetch episodes
77
+ start_range = 1
78
+ while start_range <= count:
79
+ end_range = min(start_range + 119, count)
80
+
81
+ response = httpx.get(
82
+ url=f"{self.url}/info_api/{self.media_id}/1",
83
+ params={
84
+ "start_range": start_range,
85
+ "end_range": end_range
86
+ },
87
+ headers=self.headers,
88
+ timeout=max_timeout
89
+ )
90
+ response.raise_for_status()
91
+
92
+ chunk_episodes = response.json().get("episodes", [])
93
+ all_episodes.extend(chunk_episodes)
94
+ start_range = end_range + 1
95
+
96
+ self.episodes_cache = all_episodes
87
97
  except Exception as e:
88
98
  logging.error(f"Error fetching all episodes: {e}")
89
99
  self.episodes_cache = None
@@ -1,5 +1,5 @@
1
1
  __title__ = 'StreamingCommunity'
2
- __version__ = '3.0.0'
2
+ __version__ = '3.0.1'
3
3
  __author__ = 'Arrowar'
4
4
  __description__ = 'A command-line program to download film'
5
5
  __copyright__ = 'Copyright 2024'
@@ -12,6 +12,10 @@ from typing import Any, List
12
12
  from rich.console import Console
13
13
 
14
14
 
15
+ # Internal utilities
16
+ from StreamingCommunity.Util.headers import get_userAgent
17
+
18
+
15
19
  # Variable
16
20
  console = Console()
17
21
  download_site_data = True
@@ -134,7 +138,7 @@ class ConfigManager:
134
138
  console.print(f"[bold cyan]Downloading reference configuration:[/bold cyan] [green]{self.reference_config_url}[/green]")
135
139
 
136
140
  try:
137
- response = requests.get(self.reference_config_url, timeout=10)
141
+ response = requests.get(self.reference_config_url, timeout=8, headers={'User-Agent': get_userAgent()})
138
142
 
139
143
  if response.status_code == 200:
140
144
  with open(self.file_path, 'wb') as f:
@@ -156,7 +160,7 @@ class ConfigManager:
156
160
  try:
157
161
  # Download the reference configuration
158
162
  console.print(f"[bold cyan]Validating configuration with GitHub...[/bold cyan]")
159
- response = requests.get(self.reference_config_url, timeout=10)
163
+ response = requests.get(self.reference_config_url, timeout=8, headers={'User-Agent': get_userAgent()})
160
164
 
161
165
  if not response.ok:
162
166
  raise Exception(f"Error downloading reference configuration. Code: {response.status_code}")
@@ -267,13 +271,14 @@ class ConfigManager:
267
271
  headers = {
268
272
  "apikey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2Zm5ncG94d3Jnc3duenl0YWRoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDAxNTIxNjMsImV4cCI6MjA1NTcyODE2M30.FNTCCMwi0QaKjOu8gtZsT5yQttUW8QiDDGXmzkn89QE",
269
273
  "Authorization": f"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2Zm5ncG94d3Jnc3duenl0YWRoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDAxNTIxNjMsImV4cCI6MjA1NTcyODE2M30.FNTCCMwi0QaKjOu8gtZsT5yQttUW8QiDDGXmzkn89QE",
270
- "Content-Type": "application/json"
274
+ "Content-Type": "application/json",
275
+ "User-Agent": get_userAgent()
271
276
  }
272
277
 
273
278
  try:
274
279
  console.print("[bold cyan]Retrieving site data from API...[/bold cyan]")
275
- response = requests.get("https://zvfngpoxwrgswnzytadh.supabase.co/rest/v1/public", headers=headers, timeout=10)
276
-
280
+ response = requests.get("https://zvfngpoxwrgswnzytadh.supabase.co/rest/v1/public", timeout=8, headers=headers)
281
+
277
282
  if response.ok:
278
283
  data = response.json()
279
284
  if data and len(data) > 0:
@@ -282,13 +287,6 @@ class ConfigManager:
282
287
  site_count = len(self.configSite) if isinstance(self.configSite, dict) else 0
283
288
  console.print(f"[bold green]Site data retrieved:[/bold green] {site_count} streaming services available")
284
289
 
285
- # Show some sites as examples
286
- if site_count > 0:
287
- examples = list(self.configSite.items())[:3]
288
- sites_info = []
289
- for site, info in examples:
290
- url = info.get('full_url', 'N/A')
291
- console.print(f" • [cyan]{site}[/cyan]: {url}")
292
290
  else:
293
291
  console.print("[bold yellow]API returned an empty data set[/bold yellow]")
294
292
  else:
@@ -347,7 +345,7 @@ class ConfigManager:
347
345
  try:
348
346
  logging.info(f"Downloading {filename} from {url}...")
349
347
  console.print(f"[bold cyan]File download:[/bold cyan] {os.path.basename(filename)}")
350
- response = requests.get(url, timeout=10)
348
+ response = requests.get(url, timeout=8, headers={'User-Agent': get_userAgent()})
351
349
 
352
350
  if response.status_code == 200:
353
351
  with open(filename, 'wb') as f:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: StreamingCommunity
3
- Version: 3.0.0
3
+ Version: 3.0.1
4
4
  Home-page: https://github.com/Lovi-0/StreamingCommunity
5
5
  Author: Lovi-0
6
6
  Project-URL: Bug Reports, https://github.com/Lovi-0/StreamingCommunity/issues
@@ -38,9 +38,6 @@ StreamingCommunity/Api/Site/animeworld/film.py
38
38
  StreamingCommunity/Api/Site/animeworld/serie.py
39
39
  StreamingCommunity/Api/Site/animeworld/site.py
40
40
  StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py
41
- StreamingCommunity/Api/Site/cb01new/__init__.py
42
- StreamingCommunity/Api/Site/cb01new/film.py
43
- StreamingCommunity/Api/Site/cb01new/site.py
44
41
  StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py
45
42
  StreamingCommunity/Api/Site/ddlstreamitaly/series.py
46
43
  StreamingCommunity/Api/Site/ddlstreamitaly/site.py
@@ -10,7 +10,7 @@ with open(os.path.join(os.path.dirname(__file__), "requirements.txt"), "r", enco
10
10
 
11
11
  setup(
12
12
  name="StreamingCommunity",
13
- version="3.0.0",
13
+ version="3.0.1",
14
14
  long_description=read_readme(),
15
15
  long_description_content_type="text/markdown",
16
16
  author="Lovi-0",
@@ -1,71 +0,0 @@
1
- # 09.06.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
- from StreamingCommunity.Api.Template.config_loader import site_constant
14
- from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
15
-
16
-
17
- # Logic class
18
- from .site import title_search, media_search_manager, table_show_manager
19
- from .film import download_film
20
-
21
-
22
- # Variable
23
- indice = 4
24
- _useFor = "film"
25
- _priority = 0
26
- _engineDownload = "mp4"
27
-
28
- msg = Prompt()
29
- console = Console()
30
-
31
-
32
- def process_search_result(select_title):
33
- """
34
- Handles the search result and initiates the download for either a film or series.
35
- """
36
- # !!! ADD TYPE DONT WORK FOR SERIE
37
- download_film(select_title)
38
-
39
- def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_item: dict = None):
40
- """
41
- Main function of the application for search.
42
-
43
- Parameters:
44
- string_to_search (str, optional): String to search for
45
- get_onylDatabase (bool, optional): If True, return only the database object
46
- direct_item (dict, optional): Direct item to process (bypass search)
47
- """
48
- if direct_item:
49
- select_title = MediaItem(**direct_item)
50
- process_search_result(select_title)
51
- return
52
-
53
- if string_to_search is None:
54
- string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{site_constant.SITE_NAME}").strip()
55
-
56
- # Search on database
57
- len_database = title_search(quote_plus(string_to_search))
58
-
59
- ## If only the database is needed, return the manager
60
- if get_onlyDatabase:
61
- return media_search_manager
62
-
63
- if len_database > 0:
64
- select_title = get_select_title(table_show_manager, media_search_manager)
65
- process_search_result(select_title)
66
-
67
- else:
68
-
69
- # If no results are found, ask again
70
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
71
- search()
@@ -1,62 +0,0 @@
1
- # 03.07.24
2
-
3
- import os
4
-
5
-
6
- # External library
7
- from rich.console import Console
8
-
9
-
10
- # Internal utilities
11
- from StreamingCommunity.Util.os import os_manager
12
- from StreamingCommunity.Util.message import start_message
13
- from StreamingCommunity.Lib.Downloader import HLS_Downloader
14
-
15
-
16
- # Logic class
17
- from StreamingCommunity.Api.Template.config_loader import site_constant
18
- from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
19
-
20
-
21
- # Player
22
- from StreamingCommunity.Api.Player.maxstream import VideoSource
23
-
24
-
25
- # Variable
26
- console = Console()
27
-
28
-
29
- def download_film(select_title: MediaItem) -> str:
30
- """
31
- Downloads a film using the provided obj.
32
-
33
- Parameters:
34
- - select_title (MediaItem): The media item to be downloaded. This should be an instance of the MediaItem class, containing attributes like `name` and `url`.
35
-
36
- Return:
37
- - str: output path
38
- """
39
- start_message()
40
- console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
41
-
42
- # Setup api manger
43
- video_source = VideoSource(select_title.url)
44
-
45
- # Define output path
46
- title_name = os_manager.get_sanitize_file(select_title.name) +".mp4"
47
- mp4_path = os.path.join(site_constant.MOVIE_FOLDER, title_name.replace(".mp4", ""))
48
-
49
- # Get m3u8 master playlist
50
- master_playlist = video_source.get_playlist()
51
-
52
- # Download the film using the m3u8 playlist, and output filename
53
- r_proc = HLS_Downloader(
54
- m3u8_url=master_playlist,
55
- output_path=os.path.join(mp4_path, title_name)
56
- ).start()
57
-
58
- if r_proc['error'] is not None:
59
- try: os.remove(r_proc['path'])
60
- except: pass
61
-
62
- return r_proc['path']
@@ -1,81 +0,0 @@
1
- # 03.07.24
2
-
3
- import sys
4
-
5
-
6
- # External libraries
7
- import httpx
8
- from bs4 import BeautifulSoup
9
- from rich.console import Console
10
-
11
-
12
- # Internal utilities
13
- from StreamingCommunity.Util.config_json import config_manager
14
- from StreamingCommunity.Util.headers import get_userAgent
15
- from StreamingCommunity.Util.table import TVShowManager
16
-
17
-
18
- # Logic class
19
- from StreamingCommunity.Api.Template.config_loader import site_constant
20
- from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
21
-
22
-
23
- # Variable
24
- console = Console()
25
- media_search_manager = MediaManager()
26
- table_show_manager = TVShowManager()
27
- max_timeout = config_manager.get_int("REQUESTS", "timeout")
28
-
29
-
30
- def title_search(query: str) -> int:
31
- """
32
- Search for titles based on a search query.
33
-
34
- Parameters:
35
- - query (str): The query to search for.
36
-
37
- Returns:
38
- - int: The number of titles found.
39
- """
40
- media_search_manager.clear()
41
- table_show_manager.clear()
42
-
43
- search_url = f"{site_constant.FULL_URL}/?s={query}"
44
- console.print(f"[cyan]Search url: [yellow]{search_url}")
45
-
46
- try:
47
- response = httpx.get(
48
- search_url,
49
- headers={'user-agent': get_userAgent()},
50
- timeout=max_timeout,
51
- follow_redirects=True,
52
- verify=False
53
- )
54
- response.raise_for_status()
55
-
56
- except Exception as e:
57
- console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
58
- return 0
59
-
60
- # Create soup and find table
61
- soup = BeautifulSoup(response.text, "html.parser")
62
-
63
- for card in soup.find_all("div", class_=["card", "mp-post", "horizontal"]):
64
- try:
65
- title_tag = card.find("h3", class_="card-title").find("a")
66
- url = title_tag.get("href")
67
- title = title_tag.get_text(strip=True)
68
-
69
- title_info = {
70
- 'name': title,
71
- 'url': url,
72
- 'type': 'film'
73
- }
74
-
75
- media_search_manager.add_media(title_info)
76
-
77
- except Exception as e:
78
- print(f"Error parsing a film entry: {e}")
79
-
80
- # Return the number of titles found
81
- return media_search_manager.get_length()