StreamingCommunity 3.2.8__py3-none-any.whl → 3.2.9__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 (79) hide show
  1. StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +2 -1
  2. StreamingCommunity/Api/Player/hdplayer.py +2 -2
  3. StreamingCommunity/Api/Player/sweetpixel.py +5 -8
  4. StreamingCommunity/Api/Site/altadefinizione/__init__.py +2 -2
  5. StreamingCommunity/Api/Site/altadefinizione/film.py +10 -8
  6. StreamingCommunity/Api/Site/altadefinizione/series.py +9 -7
  7. StreamingCommunity/Api/Site/altadefinizione/site.py +1 -1
  8. StreamingCommunity/Api/Site/animeunity/__init__.py +2 -2
  9. StreamingCommunity/Api/Site/animeunity/serie.py +2 -2
  10. StreamingCommunity/Api/Site/animeworld/site.py +3 -5
  11. StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py +8 -10
  12. StreamingCommunity/Api/Site/cb01new/film.py +7 -5
  13. StreamingCommunity/Api/Site/crunchyroll/__init__.py +1 -3
  14. StreamingCommunity/Api/Site/crunchyroll/film.py +9 -7
  15. StreamingCommunity/Api/Site/crunchyroll/series.py +9 -7
  16. StreamingCommunity/Api/Site/crunchyroll/site.py +10 -1
  17. StreamingCommunity/Api/Site/guardaserie/series.py +8 -6
  18. StreamingCommunity/Api/Site/guardaserie/site.py +0 -3
  19. StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +1 -2
  20. StreamingCommunity/Api/Site/mediasetinfinity/__init__.py +1 -1
  21. StreamingCommunity/Api/Site/mediasetinfinity/film.py +10 -16
  22. StreamingCommunity/Api/Site/mediasetinfinity/series.py +12 -18
  23. StreamingCommunity/Api/Site/mediasetinfinity/site.py +11 -3
  24. StreamingCommunity/Api/Site/mediasetinfinity/util/ScrapeSerie.py +214 -180
  25. StreamingCommunity/Api/Site/mediasetinfinity/util/get_license.py +2 -31
  26. StreamingCommunity/Api/Site/raiplay/__init__.py +1 -1
  27. StreamingCommunity/Api/Site/raiplay/film.py +41 -10
  28. StreamingCommunity/Api/Site/raiplay/series.py +44 -12
  29. StreamingCommunity/Api/Site/raiplay/site.py +4 -1
  30. StreamingCommunity/Api/Site/raiplay/util/ScrapeSerie.py +2 -1
  31. StreamingCommunity/Api/Site/raiplay/util/get_license.py +40 -0
  32. StreamingCommunity/Api/Site/streamingcommunity/__init__.py +0 -1
  33. StreamingCommunity/Api/Site/streamingcommunity/film.py +7 -5
  34. StreamingCommunity/Api/Site/streamingcommunity/series.py +9 -7
  35. StreamingCommunity/Api/Site/streamingcommunity/site.py +4 -2
  36. StreamingCommunity/Api/Site/streamingwatch/film.py +7 -5
  37. StreamingCommunity/Api/Site/streamingwatch/series.py +8 -6
  38. StreamingCommunity/Api/Site/streamingwatch/site.py +3 -1
  39. StreamingCommunity/Api/Site/streamingwatch/util/ScrapeSerie.py +3 -3
  40. StreamingCommunity/Api/Template/Util/__init__.py +10 -1
  41. StreamingCommunity/Api/Template/Util/manage_ep.py +4 -4
  42. StreamingCommunity/Api/Template/__init__.py +5 -1
  43. StreamingCommunity/Api/Template/site.py +10 -6
  44. StreamingCommunity/Lib/Downloader/DASH/cdm_helpher.py +5 -12
  45. StreamingCommunity/Lib/Downloader/DASH/decrypt.py +1 -1
  46. StreamingCommunity/Lib/Downloader/DASH/downloader.py +1 -1
  47. StreamingCommunity/Lib/Downloader/DASH/parser.py +1 -1
  48. StreamingCommunity/Lib/Downloader/DASH/segments.py +4 -3
  49. StreamingCommunity/Lib/Downloader/HLS/downloader.py +11 -9
  50. StreamingCommunity/Lib/Downloader/HLS/segments.py +4 -9
  51. StreamingCommunity/Lib/Downloader/MP4/downloader.py +4 -3
  52. StreamingCommunity/Lib/Downloader/TOR/downloader.py +3 -5
  53. StreamingCommunity/Lib/Downloader/__init__.py +9 -1
  54. StreamingCommunity/Lib/FFmpeg/__init__.py +10 -1
  55. StreamingCommunity/Lib/FFmpeg/command.py +4 -6
  56. StreamingCommunity/Lib/FFmpeg/util.py +1 -1
  57. StreamingCommunity/Lib/M3U8/__init__.py +9 -1
  58. StreamingCommunity/Lib/M3U8/decryptor.py +8 -4
  59. StreamingCommunity/Lib/M3U8/estimator.py +0 -6
  60. StreamingCommunity/Lib/M3U8/parser.py +1 -1
  61. StreamingCommunity/Lib/M3U8/url_fixer.py +1 -1
  62. StreamingCommunity/Lib/TMBD/__init__.py +6 -1
  63. StreamingCommunity/TelegramHelp/config.json +1 -5
  64. StreamingCommunity/TelegramHelp/telegram_bot.py +9 -10
  65. StreamingCommunity/Upload/version.py +2 -2
  66. StreamingCommunity/Util/config_json.py +139 -59
  67. StreamingCommunity/Util/http_client.py +201 -0
  68. StreamingCommunity/Util/message.py +1 -1
  69. StreamingCommunity/Util/os.py +5 -5
  70. StreamingCommunity/Util/table.py +3 -3
  71. StreamingCommunity/__init__.py +9 -1
  72. StreamingCommunity/run.py +396 -260
  73. {streamingcommunity-3.2.8.dist-info → streamingcommunity-3.2.9.dist-info}/METADATA +143 -45
  74. streamingcommunity-3.2.9.dist-info/RECORD +113 -0
  75. streamingcommunity-3.2.8.dist-info/RECORD +0 -111
  76. {streamingcommunity-3.2.8.dist-info → streamingcommunity-3.2.9.dist-info}/WHEEL +0 -0
  77. {streamingcommunity-3.2.8.dist-info → streamingcommunity-3.2.9.dist-info}/entry_points.txt +0 -0
  78. {streamingcommunity-3.2.8.dist-info → streamingcommunity-3.2.9.dist-info}/licenses/LICENSE +0 -0
  79. {streamingcommunity-3.2.8.dist-info → streamingcommunity-3.2.9.dist-info}/top_level.txt +0 -0
@@ -23,6 +23,7 @@ from rich.console import Console
23
23
  # Internal utilities
24
24
  from StreamingCommunity.Util.color import Colors
25
25
  from StreamingCommunity.Util.headers import get_userAgent
26
+ from StreamingCommunity.Util.http_client import create_client
26
27
  from StreamingCommunity.Util.config_json import config_manager
27
28
 
28
29
 
@@ -198,14 +199,7 @@ class M3U8_Segments:
198
199
  print("Signal handler must be set in the main thread")
199
200
 
200
201
  def _get_http_client(self):
201
- client_params = {
202
- 'headers': {'User-Agent': get_userAgent()},
203
- 'timeout': SEGMENT_MAX_TIMEOUT,
204
- 'follow_redirects': True,
205
- 'http2': False,
206
- 'verify': REQUEST_VERIFY
207
- }
208
- return httpx.Client(**client_params)
202
+ return create_client(headers={'User-Agent': get_userAgent()}, follow_redirects=True)
209
203
 
210
204
  def download_segment(self, ts_url: str, index: int, progress_bar: tqdm, backoff_factor: float = 1.1) -> None:
211
205
  """
@@ -264,7 +258,8 @@ class M3U8_Segments:
264
258
  with self.active_retries_lock:
265
259
  self.active_retries += 1
266
260
 
267
- sleep_time = backoff_factor * (2 ** attempt)
261
+ #sleep_time = backoff_factor * (2 ** attempt)
262
+ sleep_time = backoff_factor * (attempt + 1)
268
263
  logging.info(f"Retrying segment {index} in {sleep_time} seconds...")
269
264
  time.sleep(sleep_time)
270
265
 
@@ -10,7 +10,6 @@ from functools import partial
10
10
 
11
11
 
12
12
  # External libraries
13
- import httpx
14
13
  from tqdm import tqdm
15
14
  from rich.console import Console
16
15
  from rich.prompt import Prompt
@@ -19,6 +18,7 @@ from rich.panel import Panel
19
18
 
20
19
  # Internal utilities
21
20
  from StreamingCommunity.Util.headers import get_userAgent
21
+ from StreamingCommunity.Util.http_client import create_client
22
22
  from StreamingCommunity.Util.color import Colors
23
23
  from StreamingCommunity.Util.config_json import config_manager
24
24
  from StreamingCommunity.Util.os import internet_manager, os_manager
@@ -83,7 +83,7 @@ def MP4_downloader(url: str, path: str, referer: str = None, headers_: dict = No
83
83
  if os.path.exists(path):
84
84
  console.log("[red]Output file already exists.")
85
85
  if TELEGRAM_BOT:
86
- bot.send_message(f"Contenuto già scaricato!", None)
86
+ bot.send_message("Contenuto già scaricato!", None)
87
87
  return None, False
88
88
 
89
89
  if not (url.lower().startswith('http://') or url.lower().startswith('https://')):
@@ -110,7 +110,8 @@ def MP4_downloader(url: str, path: str, referer: str = None, headers_: dict = No
110
110
  os.makedirs(os.path.dirname(path), exist_ok=True)
111
111
 
112
112
  try:
113
- with httpx.Client(verify=REQUEST_VERIFY) as client:
113
+ # Use unified HTTP client (verify/timeout/proxy from config)
114
+ with create_client() as client:
114
115
  with client.stream("GET", url, headers=headers) as response:
115
116
  response.raise_for_status()
116
117
  total = int(response.headers.get('content-length', 0))
@@ -229,7 +229,7 @@ class TOR_downloader:
229
229
  torrent_info.num_seeds == 0 and
230
230
  torrent_info.state in ('stalledDL', 'missingFiles', 'error')):
231
231
 
232
- self.console.print(f"[bold red]Torrent not downloadable. No seeds or peers available. Removing...[/bold red]")
232
+ self.console.print("[bold red]Torrent not downloadable. No seeds or peers available. Removing...[/bold red]")
233
233
  self._remove_torrent(self.latest_torrent_hash)
234
234
  self.latest_torrent_hash = None
235
235
  return False
@@ -250,7 +250,7 @@ class TOR_downloader:
250
250
  """
251
251
  try:
252
252
  self.qb.torrents_delete(delete_files=delete_files, torrent_hashes=torrent_hash)
253
- self.console.print(f"[yellow]Torrent removed from client[/yellow]")
253
+ self.console.print("[yellow]Torrent removed from client[/yellow]")
254
254
  except Exception as e:
255
255
  logging.error(f"Error removing torrent: {str(e)}")
256
256
 
@@ -356,10 +356,8 @@ class TOR_downloader:
356
356
 
357
357
  # Get download statistics
358
358
  download_speed = torrent_info.dlspeed
359
- upload_speed = torrent_info.upspeed
360
359
  total_size = torrent_info.size
361
360
  downloaded_size = torrent_info.downloaded
362
- eta = torrent_info.eta # eta in seconds
363
361
 
364
362
  # Format sizes and speeds using the existing functions without modification
365
363
  downloaded_size_str = internet_manager.format_file_size(downloaded_size)
@@ -465,5 +463,5 @@ class TOR_downloader:
465
463
 
466
464
  try:
467
465
  self.qb.auth_log_out()
468
- except:
466
+ except Exception:
469
467
  pass
@@ -2,4 +2,12 @@
2
2
 
3
3
  from .HLS.downloader import HLS_Downloader
4
4
  from .MP4.downloader import MP4_downloader
5
- from .TOR.downloader import TOR_downloader
5
+ from .TOR.downloader import TOR_downloader
6
+ from .DASH.downloader import DASH_Downloader
7
+
8
+ __all__ = [
9
+ "HLS_Downloader",
10
+ "MP4_downloader",
11
+ "TOR_downloader",
12
+ "DASH_Downloader"
13
+ ]
@@ -1,4 +1,13 @@
1
1
  # 18.04.24
2
2
 
3
3
  from .command import join_video, join_audios, join_subtitle
4
- from .util import print_duration_table, get_video_duration
4
+ from .util import print_duration_table, get_video_duration
5
+
6
+
7
+ __all__ = [
8
+ "join_video",
9
+ "join_audios",
10
+ "join_subtitle",
11
+ "print_duration_table",
12
+ "get_video_duration",
13
+ ]
@@ -1,6 +1,5 @@
1
1
  # 31.01.24
2
2
 
3
- import sys
4
3
  import logging
5
4
  import subprocess
6
5
  from typing import List, Dict, Tuple, Optional
@@ -110,13 +109,12 @@ def join_video(video_path: str, out_path: str, codec: M3U8_Codec = None):
110
109
  if need_to_force_to_ts(video_path):
111
110
  #console.log("[red]Force input file to 'mpegts'.")
112
111
  ffmpeg_cmd.extend(['-f', 'mpegts'])
113
- vcodec = "libx264"
114
112
 
115
113
  # Insert input video path
116
114
  ffmpeg_cmd.extend(['-i', video_path])
117
115
 
118
116
  # Add output Parameters
119
- if USE_CODEC and codec != None:
117
+ if USE_CODEC and codec is not None:
120
118
  if USE_VCODEC:
121
119
  if codec.video_codec_name:
122
120
  if not USE_GPU:
@@ -162,7 +160,7 @@ def join_video(video_path: str, out_path: str, codec: M3U8_Codec = None):
162
160
  print()
163
161
 
164
162
  else:
165
- console.log(f"[purple]FFmpeg [white][[cyan]Join video[white]] ...")
163
+ console.log("[purple]FFmpeg [white][[cyan]Join video[white]] ...")
166
164
  with suppress_output():
167
165
  capture_ffmpeg_real_time(ffmpeg_cmd, "[cyan]Join video")
168
166
  print()
@@ -258,7 +256,7 @@ def join_audios(video_path: str, audio_tracks: List[Dict[str, str]], out_path: s
258
256
  print()
259
257
 
260
258
  else:
261
- console.log(f"[purple]FFmpeg [white][[cyan]Join audio[white]] ...")
259
+ console.log("[purple]FFmpeg [white][[cyan]Join audio[white]] ...")
262
260
  with suppress_output():
263
261
  capture_ffmpeg_real_time(ffmpeg_cmd, "[cyan]Join audio")
264
262
  print()
@@ -313,7 +311,7 @@ def join_subtitle(video_path: str, subtitles_list: List[Dict[str, str]], out_pat
313
311
  print()
314
312
 
315
313
  else:
316
- console.log(f"[purple]FFmpeg [white][[cyan]Join subtitle[white]] ...")
314
+ console.log("[purple]FFmpeg [white][[cyan]Join subtitle[white]] ...")
317
315
  with suppress_output():
318
316
  capture_ffmpeg_real_time(ffmpeg_cmd, "[cyan]Join subtitle")
319
317
  print()
@@ -76,7 +76,7 @@ def get_video_duration(file_path: str) -> float:
76
76
  try:
77
77
  return float(probe_result['format']['duration'])
78
78
 
79
- except:
79
+ except Exception:
80
80
  return 1
81
81
 
82
82
  except Exception as e:
@@ -3,4 +3,12 @@
3
3
  from .decryptor import M3U8_Decryption
4
4
  from .estimator import M3U8_Ts_Estimator
5
5
  from .parser import M3U8_Parser, M3U8_Codec
6
- from .url_fixer import M3U8_UrlFix
6
+ from .url_fixer import M3U8_UrlFix
7
+
8
+ __all__ = [
9
+ "M3U8_Decryption",
10
+ "M3U8_Ts_Estimator",
11
+ "M3U8_Parser",
12
+ "M3U8_Codec",
13
+ "M3U8_UrlFix"
14
+ ]
@@ -1,7 +1,6 @@
1
1
  # 03.04.24
2
2
 
3
3
  import sys
4
- import time
5
4
  import logging
6
5
  import importlib.util
7
6
 
@@ -10,18 +9,23 @@ import importlib.util
10
9
  from rich.console import Console
11
10
 
12
11
 
12
+ # Cryptodome imports
13
+ from Cryptodome.Cipher import AES
14
+ from Cryptodome.Util.Padding import unpad
15
+
16
+
13
17
  # Check if Cryptodome module is installed
14
18
  console = Console()
15
19
  crypto_spec = importlib.util.find_spec("Cryptodome")
16
20
  crypto_installed = crypto_spec is not None
17
21
 
22
+
18
23
  if not crypto_installed:
19
24
  console.log("[red]pycryptodomex non è installato. Per favore installalo. Leggi readme.md [Requirement].")
20
25
  sys.exit(0)
21
26
 
22
- logging.info("[cyan]Decrypy use: Cryptodomex")
23
- from Cryptodome.Cipher import AES
24
- from Cryptodome.Util.Padding import unpad
27
+
28
+ logging.info("[cyan]Decryption use: Cryptodomex")
25
29
 
26
30
 
27
31
 
@@ -121,12 +121,6 @@ class M3U8_Ts_Estimator:
121
121
  number_file_total_size = file_total_size.split(' ')[0]
122
122
  units_file_total_size = file_total_size.split(' ')[1]
123
123
 
124
- # Reduce lock contention by acquiring data with minimal synchronization
125
- retry_count = 0
126
- if self.segments_instance:
127
- with self.segments_instance.active_retries_lock:
128
- retry_count = self.segments_instance.active_retries
129
-
130
124
  # Get speed data outside of any locks
131
125
  speed_data = ["N/A", ""]
132
126
  with self.lock:
@@ -485,7 +485,7 @@ class M3U8_Parser:
485
485
  try:
486
486
  for playlist in m3u8_obj.playlists:
487
487
 
488
- there_is_codec = not playlist.stream_info.codecs is None
488
+ there_is_codec = playlist.stream_info.codecs is not None
489
489
  logging.info(f"There is coded: {there_is_codec}")
490
490
 
491
491
  if there_is_codec:
@@ -33,7 +33,7 @@ class M3U8_UrlFix:
33
33
  Returns:
34
34
  str: The full URL for the specified resource.
35
35
  """
36
- if self.url_playlist == None:
36
+ if self.url_playlist is None:
37
37
  logging.error("[M3U8_UrlFix] Cant generate full url, playlist not present")
38
38
  raise
39
39
 
@@ -1,4 +1,9 @@
1
1
  # 17.09.24
2
2
 
3
3
  from .tmdb import tmdb
4
- from .obj_tmbd import Json_film
4
+ from .obj_tmbd import Json_film
5
+
6
+ __all__ = [
7
+ "tmdb",
8
+ "Json_film"
9
+ ]
@@ -2,10 +2,8 @@
2
2
  "DEFAULT": {
3
3
  "debug": false,
4
4
  "show_message": true,
5
- "clean_console": true,
6
5
  "show_trending": true,
7
6
  "use_api": true,
8
- "not_close": false,
9
7
  "telegram_bot": true,
10
8
  "download_site_data": true,
11
9
  "validate_github_config": true
@@ -45,9 +43,7 @@
45
43
  "use_acodec": true,
46
44
  "use_bitrate": true,
47
45
  "use_gpu": false,
48
- "default_preset": "ultrafast"
49
- },
50
- "M3U8_PARSER": {
46
+ "default_preset": "ultrafast",
51
47
  "force_resolution": "Best"
52
48
  },
53
49
  "REQUESTS": {
@@ -9,7 +9,6 @@ import uuid
9
9
  import json
10
10
  import threading
11
11
  import subprocess
12
- import threading
13
12
  from typing import Optional
14
13
 
15
14
  # External libraries
@@ -305,7 +304,7 @@ class TelegramBot:
305
304
 
306
305
  def handle_get_id(self, message):
307
306
  if not self.is_authorized(message.from_user.id):
308
- print(f" Non sei autorizzato.")
307
+ print(" Non sei autorizzato.")
309
308
  self.bot.send_message(message.chat.id, " Non sei autorizzato.")
310
309
  return
311
310
 
@@ -384,7 +383,7 @@ class TelegramBot:
384
383
 
385
384
  def handle_list_scripts(self, message):
386
385
  if not self.is_authorized(message.from_user.id):
387
- print(f" Non sei autorizzato.")
386
+ print(" Non sei autorizzato.")
388
387
  self.bot.send_message(message.chat.id, " Non sei autorizzato.")
389
388
  return
390
389
 
@@ -395,7 +394,7 @@ class TelegramBot:
395
394
  scripts_data = []
396
395
 
397
396
  if not scripts_data:
398
- print(f" Nessuno script registrato.")
397
+ print(" Nessuno script registrato.")
399
398
  self.bot.send_message(message.chat.id, " Nessuno script registrato.")
400
399
  return
401
400
 
@@ -437,7 +436,7 @@ class TelegramBot:
437
436
 
438
437
  def handle_stop_script(self, message):
439
438
  if not self.is_authorized(message.from_user.id):
440
- print(f" Non sei autorizzato.")
439
+ print(" Non sei autorizzato.")
441
440
  self.bot.send_message(message.chat.id, " Non sei autorizzato.")
442
441
  return
443
442
 
@@ -452,7 +451,7 @@ class TelegramBot:
452
451
  running_scripts = [s for s in scripts_data if s["status"] == "running"]
453
452
 
454
453
  if not running_scripts:
455
- print(f" Nessuno script attivo da fermare.")
454
+ print(" Nessuno script attivo da fermare.")
456
455
  self.bot.send_message(
457
456
  message.chat.id, " Nessuno script attivo da fermare."
458
457
  )
@@ -526,7 +525,7 @@ class TelegramBot:
526
525
  def handle_screen_status(self, message):
527
526
  command_parts = message.text.split()
528
527
  if len(command_parts) < 2:
529
- print(f" ID mancante nel comando. Usa: /screen <ID>")
528
+ print(" ID mancante nel comando. Usa: /screen <ID>")
530
529
  self.bot.send_message(
531
530
  message.chat.id, " ID mancante nel comando. Usa: /screen <ID>"
532
531
  )
@@ -557,9 +556,9 @@ class TelegramBot:
557
556
  return
558
557
 
559
558
  if not os.path.exists(temp_file):
560
- print(f" Impossibile catturare l'output della screen.")
559
+ print(" Impossibile catturare l'output della screen.")
561
560
  self.bot.send_message(
562
- message.chat.id, f" Impossibile catturare l'output della screen."
561
+ message.chat.id, " Impossibile catturare l'output della screen."
563
562
  )
564
563
  return
565
564
 
@@ -669,7 +668,7 @@ class TelegramBot:
669
668
  return response
670
669
  time.sleep(1)
671
670
 
672
- print(f" Timeout: nessuna risposta ricevuta.")
671
+ print(" Timeout: nessuna risposta ricevuta.")
673
672
  for chat_id in self.authorized_users: # Manda a tutti gli ID autorizzati
674
673
  self.bot.send_message(chat_id, " Timeout: nessuna risposta ricevuta.")
675
674
  self.request_manager.clear_file()
@@ -1,5 +1,5 @@
1
1
  __title__ = 'StreamingCommunity'
2
- __version__ = '3.2.8'
2
+ __version__ = '3.2.9'
3
3
  __author__ = 'Arrowar'
4
4
  __description__ = 'A command-line program to download film'
5
- __copyright__ = 'Copyright 2025'
5
+ __copyright__ = 'Copyright 2025'