StreamingCommunity 3.0.4__py3-none-any.whl → 3.0.5__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.

Files changed (24) hide show
  1. StreamingCommunity/Api/Site/1337xx/__init__.py +1 -0
  2. StreamingCommunity/Api/Site/altadefinizione/__init__.py +1 -0
  3. StreamingCommunity/Api/Site/animeunity/__init__.py +1 -0
  4. StreamingCommunity/Api/Site/animeworld/__init__.py +1 -0
  5. StreamingCommunity/Api/Site/guardaserie/__init__.py +1 -0
  6. StreamingCommunity/Api/Site/raiplay/__init__.py +1 -0
  7. StreamingCommunity/Api/Site/streamingcommunity/__init__.py +1 -0
  8. StreamingCommunity/Api/Site/streamingcommunity/site.py +27 -6
  9. StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +4 -5
  10. StreamingCommunity/Api/Site/streamingwatch/__init__.py +1 -0
  11. StreamingCommunity/Upload/version.py +1 -1
  12. StreamingCommunity/Util/config_json.py +0 -2
  13. StreamingCommunity/global_search.py +2 -1
  14. StreamingCommunity/run.py +31 -43
  15. {streamingcommunity-3.0.4.dist-info → streamingcommunity-3.0.5.dist-info}/METADATA +215 -236
  16. {streamingcommunity-3.0.4.dist-info → streamingcommunity-3.0.5.dist-info}/RECORD +20 -24
  17. StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +0 -74
  18. StreamingCommunity/Api/Site/ddlstreamitaly/series.py +0 -118
  19. StreamingCommunity/Api/Site/ddlstreamitaly/site.py +0 -87
  20. StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +0 -112
  21. {streamingcommunity-3.0.4.dist-info → streamingcommunity-3.0.5.dist-info}/WHEEL +0 -0
  22. {streamingcommunity-3.0.4.dist-info → streamingcommunity-3.0.5.dist-info}/entry_points.txt +0 -0
  23. {streamingcommunity-3.0.4.dist-info → streamingcommunity-3.0.5.dist-info}/licenses/LICENSE +0 -0
  24. {streamingcommunity-3.0.4.dist-info → streamingcommunity-3.0.5.dist-info}/top_level.txt +0 -0
@@ -24,6 +24,7 @@ indice = 3
24
24
  _useFor = "film_serie"
25
25
  _priority = 0
26
26
  _engineDownload = "tor"
27
+ _deprecate = False
27
28
 
28
29
  console = Console()
29
30
  msg = Prompt()
@@ -27,6 +27,7 @@ indice = 2
27
27
  _useFor = "film_serie"
28
28
  _priority = 0
29
29
  _engineDownload = "hls"
30
+ _deprecate = True
30
31
 
31
32
  msg = Prompt()
32
33
  console = Console()
@@ -27,6 +27,7 @@ indice = 1
27
27
  _useFor = "anime"
28
28
  _priority = 0
29
29
  _engineDownload = "mp4"
30
+ _deprecate = False
30
31
 
31
32
  msg = Prompt()
32
33
  console = Console()
@@ -22,6 +22,7 @@ indice = 8
22
22
  _useFor = "anime"
23
23
  _priority = 0
24
24
  _engineDownload = "mp4"
25
+ _deprecate = False
25
26
 
26
27
  msg = Prompt()
27
28
  console = Console()
@@ -24,6 +24,7 @@ indice = 5
24
24
  _useFor = "serie"
25
25
  _priority = 0
26
26
  _engineDownload = "hls"
27
+ _deprecate = False
27
28
 
28
29
  msg = Prompt()
29
30
  console = Console()
@@ -23,6 +23,7 @@ indice = 8
23
23
  _useFor = "film_serie"
24
24
  _priority = 1 # NOTE: Site search need the use of tmbd obj
25
25
  _engineDownload = "hls"
26
+ _deprecate = False
26
27
 
27
28
  msg = Prompt()
28
29
  console = Console()
@@ -28,6 +28,7 @@ indice = 0
28
28
  _useFor = "film_serie"
29
29
  _priority = 0
30
30
  _engineDownload = "hls"
31
+ _deprecate = False
31
32
 
32
33
  msg = Prompt()
33
34
  console = Console()
@@ -1,8 +1,11 @@
1
1
  # 10.12.23
2
2
 
3
+ import json
4
+
3
5
 
4
6
  # External libraries
5
7
  import httpx
8
+ from bs4 import BeautifulSoup
6
9
  from rich.console import Console
7
10
 
8
11
 
@@ -41,16 +44,34 @@ def title_search(query: str) -> int:
41
44
  media_search_manager.clear()
42
45
  table_show_manager.clear()
43
46
 
44
- search_url = f"{site_constant.FULL_URL}/api/search?q={query}"
47
+ try:
48
+ response = httpx.get(
49
+ site_constant.FULL_URL,
50
+ headers={'user-agent': get_userAgent()},
51
+ timeout=max_timeout
52
+ )
53
+ response.raise_for_status()
54
+
55
+ soup = BeautifulSoup(response.text, 'html.parser')
56
+ version = json.loads(soup.find('div', {'id': "app"}).get("data-page"))['version']
57
+
58
+ except Exception as e:
59
+ console.print(f"[red]Site: {site_constant.SITE_NAME} version, request error: {e}")
60
+ return 0
61
+
62
+ search_url = f"{site_constant.FULL_URL}/search?q={query}"
45
63
  console.print(f"[cyan]Search url: [yellow]{search_url}")
46
64
 
47
65
  try:
48
66
  response = httpx.get(
49
67
  search_url,
50
- headers={'user-agent': get_userAgent()},
51
- timeout=max_timeout,
52
- follow_redirects=True,
53
- verify=False
68
+ headers = {
69
+ 'referer': site_constant.FULL_URL,
70
+ 'user-agent': get_userAgent(),
71
+ 'x-inertia': 'true',
72
+ 'x-inertia-version': version
73
+ },
74
+ timeout=max_timeout
54
75
  )
55
76
  response.raise_for_status()
56
77
 
@@ -66,7 +87,7 @@ def title_search(query: str) -> int:
66
87
 
67
88
  # Collect json data
68
89
  try:
69
- data = response.json().get('data', [])
90
+ data = response.json().get('props').get('titles')
70
91
  except Exception as e:
71
92
  console.log(f"Error parsing JSON response: {e}")
72
93
  return 0
@@ -96,17 +96,16 @@ class GetSerieInfo:
96
96
  if not season:
97
97
  logging.error(f"Season {number_season} not found")
98
98
  return
99
-
99
+
100
100
  response = httpx.get(
101
- url=f'{self.url}/titles/{self.media_id}-{self.series_name}/stagione-{number_season}',
101
+ url=f'{self.url}/titles/{self.media_id}-{self.series_name}/season-{number_season}',
102
102
  headers={
103
- 'User-Agent': get_userAgent(),
104
- 'x-inertia': 'true',
103
+ 'User-Agent': self.headers['user-agent'],
104
+ 'x-inertia': 'true',
105
105
  'x-inertia-version': self.version,
106
106
  },
107
107
  timeout=max_timeout
108
108
  )
109
- response.raise_for_status()
110
109
 
111
110
  # Extract episodes from JSON response
112
111
  json_response = response.json().get('props', {}).get('loadedSeason', {}).get('episodes', [])
@@ -23,6 +23,7 @@ indice = 8
23
23
  _useFor = "film_serie"
24
24
  _priority = 10 # !!! MOLTO LENTO
25
25
  _engineDownload = "hls"
26
+ _deprecate = False
26
27
 
27
28
  msg = Prompt()
28
29
  console = Console()
@@ -1,5 +1,5 @@
1
1
  __title__ = 'StreamingCommunity'
2
- __version__ = '3.0.4'
2
+ __version__ = '3.0.5'
3
3
  __author__ = 'Arrowar'
4
4
  __description__ = 'A command-line program to download film'
5
5
  __copyright__ = 'Copyright 2024'
@@ -166,7 +166,6 @@ class ConfigManager:
166
166
  raise Exception(f"Error downloading reference configuration. Code: {response.status_code}")
167
167
 
168
168
  reference_config = response.json()
169
- console.print(f"[bold cyan]Reference configuration downloaded:[/bold cyan] [green]{len(reference_config)} keys available[/green]")
170
169
 
171
170
  # Compare and update missing keys
172
171
  merged_config = self._deep_merge_configs(self.config, reference_config)
@@ -285,7 +284,6 @@ class ConfigManager:
285
284
  self.configSite = data[0]['data']
286
285
 
287
286
  site_count = len(self.configSite) if isinstance(self.configSite, dict) else 0
288
- console.print(f"[bold green]Site data retrieved:[/bold green] {site_count} streaming services available")
289
287
 
290
288
  else:
291
289
  console.print("[bold yellow]API returned an empty data set[/bold yellow]")
@@ -61,7 +61,8 @@ def load_search_functions():
61
61
  priority = getattr(mod, '_priority', 0)
62
62
 
63
63
  if priority == 0:
64
- modules.append((module_name, indice, use_for))
64
+ if not getattr(mod, '_deprecate'):
65
+ modules.append((module_name, indice, use_for))
65
66
 
66
67
  except Exception as e:
67
68
  console.print(f"[red]Failed to import module {module_name}: {str(e)}")
StreamingCommunity/run.py CHANGED
@@ -30,7 +30,7 @@ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance, Teleg
30
30
 
31
31
  # Config
32
32
  SHOW_TRENDING = config_manager.get_bool('DEFAULT', 'show_trending')
33
- CLOSE_CONSOLE = config_manager.get_bool('DEFAULT', 'not_close')
33
+ NOT_CLOSE_CONSOLE = config_manager.get_bool('DEFAULT', 'not_close')
34
34
  TELEGRAM_BOT = config_manager.get_bool('DEFAULT', 'telegram_bot')
35
35
 
36
36
 
@@ -61,7 +61,7 @@ def load_search_functions():
61
61
  loaded_functions = {}
62
62
 
63
63
  # Lista dei siti da escludere se TELEGRAM_BOT è attivo
64
- excluded_sites = {"cb01new", "ddlstreamitaly", "guardaserie", "ilcorsaronero", "mostraguarda"} if TELEGRAM_BOT else set()
64
+ excluded_sites = {"cb01new", "guardaserie", "ilcorsaronero", "mostraguarda"} if TELEGRAM_BOT else set()
65
65
 
66
66
  # Find api home directory
67
67
  if getattr(sys, 'frozen', False): # Modalità PyInstaller
@@ -89,9 +89,11 @@ def load_search_functions():
89
89
  mod = importlib.import_module(f'StreamingCommunity.Api.Site.{module_name}')
90
90
 
91
91
  # Get 'indice' from the module
92
- indice = getattr(mod, 'indice', 0)
93
- use_for = getattr(mod, '_useFor', 'other')
94
- modules.append((module_name, indice, use_for))
92
+ indice = getattr(mod, 'indice')
93
+ use_for = getattr(mod, '_useFor')
94
+
95
+ if not getattr(mod, '_deprecate'):
96
+ modules.append((module_name, indice, use_for))
95
97
 
96
98
  except Exception as e:
97
99
  console.print(f"[red]Failed to import module {module_name}: {str(e)}")
@@ -202,13 +204,16 @@ def main(script_id = 0):
202
204
  initialize()
203
205
 
204
206
  if not internet_manager.check_dns_provider():
207
+ print()
205
208
  console.print("[red]❌ ERROR: DNS configuration is required!")
206
209
  console.print("[red]The program cannot function correctly without proper DNS settings.")
207
210
  console.print("[yellow]Please configure one of these DNS servers:")
208
- console.print("[blue]• Cloudflare (1.1.1.1)")
209
- console.print("[blue]• Quad9 (9.9.9.9)")
211
+ console.print("[blue]• Cloudflare (1.1.1.1) 'https://developers.cloudflare.com/1.1.1.1/setup/windows/'")
212
+ console.print("[blue]• Quad9 (9.9.9.9) 'https://docs.quad9.net/Setup_Guides/Windows/Windows_10/'")
210
213
  console.print("\n[yellow]⚠️ The program will not work until you configure your DNS settings.")
211
- input("[yellow]Press Enter to exit...")
214
+
215
+ time.sleep(1)
216
+ msg.ask("[yellow]Press Enter to exit...")
212
217
 
213
218
  # Load search functions
214
219
  search_functions = load_search_functions()
@@ -259,21 +264,9 @@ def main(script_id = 0):
259
264
  "other": "white"
260
265
  }
261
266
 
262
- # Add dynamic arguments based on loaded search modules
263
- used_short_options = set()
264
-
265
- for alias, (_, use_for) in search_functions.items():
266
- short_option = alias[:3].upper()
267
-
268
- original_short_option = short_option
269
- count = 1
270
- while short_option in used_short_options:
271
- short_option = f"{original_short_option}{count}"
272
- count += 1
273
-
274
- used_short_options.add(short_option)
275
- long_option = alias
276
- parser.add_argument(f'-{short_option}', f'--{long_option}', action='store_true', help=f'Search for {alias.split("_")[0]} on streaming platforms.')
267
+ # Add numeric arguments for each search module
268
+ for idx, (alias, (_, use_for)) in enumerate(search_functions.items()):
269
+ parser.add_argument(f'--{idx}', action='store_true', help=f'Search using {alias.split("_")[0]} ({use_for})')
277
270
 
278
271
  parser.add_argument('-s', '--search', default=None, help='Search terms')
279
272
 
@@ -309,12 +302,11 @@ def main(script_id = 0):
309
302
  global_search(search_terms)
310
303
  return
311
304
 
312
- # Map command-line arguments to functions
313
- arg_to_function = {alias: func for alias, (func, _) in search_functions.items()}
314
-
315
- # Check which argument is provided and run the corresponding function
316
- for arg, func in arg_to_function.items():
317
- if getattr(args, arg):
305
+ # Check for numeric arguments
306
+ search_functions_list = list(search_functions.items())
307
+ for i in range(len(search_functions_list)):
308
+ if getattr(args, str(i)):
309
+ alias, (func, _) = search_functions_list[i]
318
310
  run_function(func, search_terms=search_terms)
319
311
  return
320
312
 
@@ -324,28 +316,23 @@ def main(script_id = 0):
324
316
  # Create dynamic prompt message and choices
325
317
  choice_labels = {str(i): (alias.split("_")[0].capitalize(), use_for) for i, (alias, (_, use_for)) in enumerate(search_functions.items())}
326
318
 
327
- # Add global search option to the menu
328
- #global_search_key = str(len(choice_labels))
329
- #choice_labels[global_search_key] = ("Global Search", "all")
330
- #input_to_function[global_search_key] = global_search
331
-
332
319
  # Display the category legend in a single line
333
320
  legend_text = " | ".join([f"[{color}]{category.capitalize()}[/{color}]" for category, color in color_map.items()])
334
321
  console.print(f"\n[bold green]Category Legend:[/bold green] {legend_text}")
335
322
 
336
- # Construct the prompt message with color-coded site names
323
+ # Construct the prompt message with color-coded site names and aliases
337
324
  prompt_message = "[green]Insert category [white](" + ", ".join(
338
- [f"{key}: [{color_map.get(label[1], 'white')}]{label[0]}[/{color_map.get(label[1], 'white')}]" for key, label in choice_labels.items()]
325
+ [f"{key}: [{color_map.get(label[1], 'white')}]{label[0]}"
326
+ for key, label in choice_labels.items()]
339
327
  ) + "[white])"
340
328
 
341
329
  if TELEGRAM_BOT:
342
-
343
330
  # Display the category legend in a single line
344
331
  category_legend_str = "Categorie: \n" + " | ".join([
345
332
  f"{category.capitalize()}" for category in color_map.keys()
346
333
  ])
347
334
 
348
- # Costruisci il messaggio senza emoji
335
+ # Build message with aliases
349
336
  prompt_message = "Inserisci il sito:\n" + "\n".join(
350
337
  [f"{key}: {label[0]}" for key, label in choice_labels.items()]
351
338
  )
@@ -356,7 +343,7 @@ def main(script_id = 0):
356
343
  category = bot.ask(
357
344
  "select_provider",
358
345
  f"{category_legend_str}\n\n{prompt_message}",
359
- None # Passiamo la lista delle chiavi come scelte
346
+ None
360
347
  )
361
348
 
362
349
  else:
@@ -379,10 +366,11 @@ def main(script_id = 0):
379
366
 
380
367
  console.print("[red]Invalid category.")
381
368
 
382
- if CLOSE_CONSOLE:
383
- restart_script() # Riavvia lo script invece di uscire
369
+ if NOT_CLOSE_CONSOLE:
370
+ restart_script()
371
+
384
372
  else:
385
- force_exit() # Usa la funzione per chiudere sempre
373
+ force_exit()
386
374
 
387
375
  if TELEGRAM_BOT:
388
376
  bot.send_message(f"Chiusura in corso", None)
@@ -390,4 +378,4 @@ def main(script_id = 0):
390
378
  # Delete script_id
391
379
  script_id = TelegramSession.get_session()
392
380
  if script_id != "unknown":
393
- TelegramSession.deleteScriptId(script_id)
381
+ TelegramSession.deleteScriptId(script_id)