StreamingCommunity 2.6.0__py3-none-any.whl → 2.6.1__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.
@@ -1,6 +1,6 @@
1
1
  # 23.11.24
2
2
 
3
- from typing import Dict, Any, List, Union
3
+ from typing import Dict, Any, List, Union, List, Optional
4
4
 
5
5
 
6
6
  class Episode:
@@ -65,6 +65,25 @@ class EpisodeManager:
65
65
  return f"EpisodeManager(num_episodes={len(self.episodes)})"
66
66
 
67
67
 
68
+ class SeasonData:
69
+ def __init__(self, data: Dict[str, Any]):
70
+ self.id: int = data.get('id', 0)
71
+ self.number: int = data.get('number', 0)
72
+
73
+ def __str__(self):
74
+ return f"SeasonData(id={self.id}, number={self.number}, name='{self.name}'"
75
+
76
+ class SeasonManager:
77
+ def __init__(self):
78
+ self.seasons: List[SeasonData] = []
79
+
80
+ def add_season(self, season_data):
81
+ season = SeasonData(season_data)
82
+ self.seasons.append(season)
83
+
84
+ def get_season_by_number(self, number: int) -> Optional[Dict]:
85
+ return self.seasons[number]
86
+
68
87
  class Season:
69
88
  def __init__(self, season_data: Dict[str, Union[int, str, None]]):
70
89
  self.season_data = season_data
@@ -78,7 +97,12 @@ class Season:
78
97
  self.plot: str = season_data.get('plot', '')
79
98
  self.type: str = season_data.get('type', '')
80
99
  self.seasons_count: int = season_data.get('seasons_count', 0)
100
+
81
101
  self.episodes: EpisodeManager = EpisodeManager()
102
+
103
+ self.seasonsData: SeasonManager = SeasonManager()
104
+ for element in season_data['seasons']:
105
+ self.seasonsData.add_season(element)
82
106
 
83
107
 
84
108
  class Stream:
@@ -133,4 +157,4 @@ class WindowParameter:
133
157
  self.url = data.get('url')
134
158
 
135
159
  def __str__(self):
136
- return (f"WindowParameter(token='{self.token}', expires='{self.expires}', url='{self.url}', data={self.data})")
160
+ return (f"WindowParameter(token='{self.token}', expires='{self.expires}', url='{self.url}', data={self.data})")
@@ -1,7 +1,6 @@
1
1
  # 17.09.24
2
2
 
3
3
  import os
4
- import sys
5
4
  import logging
6
5
 
7
6
 
@@ -15,6 +14,7 @@ from StreamingCommunity.Util.console import console
15
14
  from StreamingCommunity.Util.os import os_manager
16
15
  from StreamingCommunity.Util.message import start_message
17
16
  from StreamingCommunity.Util.headers import get_headers
17
+ from StreamingCommunity.Util.table import TVShowManager, get_call_stack
18
18
  from StreamingCommunity.Lib.Downloader import HLS_Downloader
19
19
 
20
20
 
@@ -53,8 +53,13 @@ def download_film(movie_details: Json_film) -> str:
53
53
  raise
54
54
 
55
55
  if "not found" in str(response.text):
56
- logging.error(f"Cant find in the server, Element: {movie_details}")
57
- raise
56
+ logging.error(f"Cant find in the server: {movie_details.title}.")
57
+
58
+ research_func = next((
59
+ f for f in get_call_stack()
60
+ if f['function'] == 'search' and f['script'] == '__init__.py'
61
+ ), None)
62
+ TVShowManager.run_back_command(research_func)
58
63
 
59
64
  # Extract supervideo url
60
65
  soup = BeautifulSoup(response.text, "html.parser")
@@ -13,7 +13,7 @@ from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
13
13
 
14
14
  # Logic class
15
15
  from StreamingCommunity.Api.Template.config_loader import site_constant
16
- from .site import get_version_and_domain, title_search, table_show_manager, media_search_manager
16
+ from .site import title_search, table_show_manager, media_search_manager
17
17
  from .film import download_film
18
18
  from .series import download_series
19
19
 
@@ -52,9 +52,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
52
52
  if string_to_search is None:
53
53
  string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{site_constant.SITE_NAME}").strip()
54
54
 
55
- # Get site domain and version and get result of the search
56
- site_version, domain = get_version_and_domain()
57
- len_database = title_search(quote_plus(string_to_search), domain)
55
+ len_database = title_search(quote_plus(string_to_search))
58
56
 
59
57
  # Return list of elements
60
58
  if get_onylDatabase:
@@ -66,7 +64,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
66
64
  select_title = get_select_title(table_show_manager, media_search_manager)
67
65
 
68
66
  if select_title.type == 'tv':
69
- download_series(select_title, site_version)
67
+ download_series(select_title)
70
68
 
71
69
  else:
72
70
  download_film(select_title)
@@ -132,14 +132,13 @@ def download_episode(index_season_selected: int, scrape_serie: ScrapeSerie, vide
132
132
  if stopped:
133
133
  break
134
134
 
135
- def download_series(select_season: MediaItem, version: str) -> None:
135
+ def download_series(select_season: MediaItem) -> None:
136
136
  """
137
137
  Download episodes of a TV series based on user selection.
138
138
 
139
139
  Parameters:
140
140
  - select_season (MediaItem): Selected media item (TV series).
141
141
  - domain (str): Domain from which to download.
142
- - version (str): Version of the site.
143
142
  """
144
143
  if site_constant.TELEGRAM_BOT:
145
144
  bot = get_bot_instance()
@@ -152,7 +151,7 @@ def download_series(select_season: MediaItem, version: str) -> None:
152
151
  video_source = VideoSource(site_constant.SITE_NAME, True)
153
152
 
154
153
  # Setup video source
155
- scrape_serie.setup(version, select_season.id, select_season.slug)
154
+ scrape_serie.setup(select_season.id, select_season.slug)
156
155
  video_source.setup(select_season.id)
157
156
 
158
157
  # Collect information about seasons
@@ -194,11 +193,11 @@ def download_series(select_season: MediaItem, version: str) -> None:
194
193
  if len(list_season_select) > 1 or index_season_selected == "*":
195
194
 
196
195
  # Download all episodes if multiple seasons are selected or if '*' is used
197
- download_episode(i_season, scrape_serie, video_source, download_all=True)
196
+ download_episode(scrape_serie.season_manager.seasonsData.get_season_by_number(i_season-1).number, scrape_serie, video_source, download_all=True)
198
197
  else:
199
198
 
200
199
  # Otherwise, let the user select specific episodes for the single season
201
- download_episode(i_season, scrape_serie, video_source, download_all=False)
200
+ download_episode(scrape_serie.season_manager.seasonsData.get_season_by_number(i_season-1).number, scrape_serie, video_source, download_all=False)
202
201
 
203
202
  if site_constant.TELEGRAM_BOT:
204
203
  bot.send_message(f"Finito di scaricare tutte le serie e episodi", None)
@@ -1,13 +1,8 @@
1
1
  # 10.12.23
2
2
 
3
- import json
4
- import logging
5
- import secrets
6
-
7
3
 
8
4
  # External libraries
9
5
  import httpx
10
- from bs4 import BeautifulSoup
11
6
 
12
7
 
13
8
  # Internal utilities
@@ -32,72 +27,21 @@ max_timeout = config_manager.get_int("REQUESTS", "timeout")
32
27
  disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
33
28
 
34
29
 
35
- def get_version(domain: str):
30
+ def title_search(title_search: str) -> int:
36
31
  """
37
- Extracts the version from the HTML text of a webpage.
38
-
32
+ Search for titles based on a search query.
33
+
39
34
  Parameters:
40
- - domain (str): The domain of the site.
35
+ - title_search (str): The title to search for.
41
36
 
42
37
  Returns:
43
- str: The version extracted from the webpage.
44
- """
45
- try:
46
- response = httpx.get(
47
- url=f"https://{site_constant.SITE_NAME}.{domain}/",
48
- headers={'User-Agent': get_headers()},
49
- timeout=max_timeout
50
- )
51
- response.raise_for_status()
52
-
53
- # Parse request to site
54
- soup = BeautifulSoup(response.text, "html.parser")
55
-
56
- # Extract version
57
- version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
58
- #console.print(f"[cyan]Get version [white]=> [red]{version} \n")
59
-
60
- return version
61
-
62
- except Exception as e:
63
- logging.error(f"Error extracting version: {e}")
64
- raise
65
-
66
-
67
- def get_version_and_domain():
68
- """
69
- Retrieve the current version and domain of the site.
70
-
71
- This function performs the following steps:
72
- - Determines the correct domain to use for the site by searching for a specific meta tag.
73
- - Fetches the content of the site to extract the version information.
38
+ int: The number of titles found.
74
39
  """
75
40
  domain_to_use = site_constant
76
41
 
77
42
  if not disable_searchDomain:
78
43
  domain_to_use, base_url = search_domain(site_constant.SITE_NAME, f"https://{site_constant.SITE_NAME}.{site_constant.DOMAIN_NOW}")
79
44
 
80
- try:
81
- version = get_version(domain_to_use)
82
- except:
83
- #console.print("[green]Auto generate version ...")
84
- #version = secrets.token_hex(32 // 2)
85
- version = None
86
-
87
- return version, domain_to_use
88
-
89
-
90
- def title_search(title_search: str, domain: str) -> int:
91
- """
92
- Search for titles based on a search query.
93
-
94
- Parameters:
95
- - title_search (str): The title to search for.
96
- - domain (str): The domain to search on.
97
-
98
- Returns:
99
- int: The number of titles found.
100
- """
101
45
  if site_constant.TELEGRAM_BOT:
102
46
  bot = get_bot_instance()
103
47
 
@@ -106,7 +50,7 @@ def title_search(title_search: str, domain: str) -> int:
106
50
 
107
51
  try:
108
52
  response = httpx.get(
109
- url=f"https://{site_constant.SITE_NAME}.{domain}/api/search?q={title_search.replace(' ', '+')}",
53
+ url=f"https://{site_constant.SITE_NAME}.{domain_to_use}/api/search?q={title_search.replace(' ', '+')}",
110
54
  headers={'user-agent': get_headers()},
111
55
  timeout=max_timeout
112
56
  )
@@ -32,16 +32,14 @@ class ScrapeSerie:
32
32
  self.base_name = site_name
33
33
  self.domain = config_manager.get_dict('SITE', self.base_name)['domain']
34
34
 
35
- def setup(self, version: str = None, media_id: int = None, series_name: str = None):
35
+ def setup(self, media_id: int = None, series_name: str = None):
36
36
  """
37
37
  Set up the scraper with specific media details.
38
38
 
39
39
  Args:
40
- version (str, optional): Site version for request headers
41
40
  media_id (int, optional): Unique identifier for the media
42
41
  series_name (str, optional): Name of the TV series
43
42
  """
44
- self.version = version
45
43
  self.media_id = media_id
46
44
 
47
45
  # If series name is provided, initialize series-specific managers
@@ -70,18 +68,6 @@ class ScrapeSerie:
70
68
  soup = BeautifulSoup(response.text, "html.parser")
71
69
  json_response = json.loads(soup.find("div", {"id": "app"}).get("data-page"))
72
70
  self.version = json_response['version']
73
-
74
- """
75
- response = httpx.post(
76
- url=f'https://{self.base_name}.{self.domain}/api/titles/preview/{self.media_id}',
77
- headers={'User-Agent': get_headers()}
78
- )
79
- response.raise_for_status()
80
-
81
-
82
- # Extract seasons from JSON response
83
- json_response = response.json()
84
- """
85
71
 
86
72
  # Collect info about season
87
73
  self.season_manager = Season(json_response.get("props").get("title"))
@@ -6,7 +6,7 @@ from typing import List
6
6
 
7
7
 
8
8
  # Internal utilities
9
- from StreamingCommunity.Util.console import console
9
+ from StreamingCommunity.Util.console import console, msg
10
10
  from StreamingCommunity.Util.os import os_manager
11
11
  from StreamingCommunity.Util._jsonConfig import config_manager
12
12
  from StreamingCommunity.Util.table import TVShowManager
@@ -47,28 +47,33 @@ def manage_selection(cmd_insert: str, max_count: int) -> List[int]:
47
47
  Returns:
48
48
  list_selection (List[int]): List of selected items.
49
49
  """
50
- list_selection = []
51
- logging.info(f"Command insert: {cmd_insert}, end index: {max_count + 1}")
52
-
53
- # For a single number (e.g., '5')
54
- if cmd_insert.isnumeric():
55
- list_selection.append(int(cmd_insert))
56
-
57
- # For a range (e.g., '5-12')
58
- elif "-" in cmd_insert:
59
- start, end = map(str.strip, cmd_insert.split('-'))
60
- start = int(start)
61
- end = int(end) if end.isnumeric() else max_count
62
-
63
- list_selection = list(range(start, end + 1))
64
-
65
- # For all items ('*')
66
- elif cmd_insert == "*":
67
- list_selection = list(range(1, max_count + 1))
68
-
69
- else:
70
- raise ValueError("Invalid input format")
71
-
50
+ while True:
51
+ list_selection = []
52
+ logging.info(f"Command insert: {cmd_insert}, end index: {max_count + 1}")
53
+
54
+ # For a single number (e.g., '5')
55
+ if cmd_insert.isnumeric():
56
+ list_selection.append(int(cmd_insert))
57
+ break
58
+
59
+ # For a range (e.g., '5-12')
60
+ elif "-" in cmd_insert:
61
+ try:
62
+ start, end = map(str.strip, cmd_insert.split('-'))
63
+ start = int(start)
64
+ end = int(end) if end.isnumeric() else max_count
65
+ list_selection = list(range(start, end + 1))
66
+ break
67
+ except ValueError:
68
+ pass
69
+
70
+ # For all items ('*')
71
+ elif cmd_insert == "*":
72
+ list_selection = list(range(1, max_count + 1))
73
+ break
74
+
75
+ cmd_insert = msg.ask("[red]Invalid input. Please enter a valid command: ")
76
+
72
77
  logging.info(f"List return: {list_selection}")
73
78
  return list_selection
74
79
 
@@ -8,6 +8,14 @@ from pathlib import Path
8
8
  from typing import Any, List
9
9
 
10
10
 
11
+ # External library
12
+ from rich.console import Console
13
+
14
+
15
+ # Variable
16
+ console = Console()
17
+
18
+
11
19
  class ConfigManager:
12
20
  def __init__(self, file_name: str = 'config.json') -> None:
13
21
  """Initialize the ConfigManager.
@@ -15,9 +23,14 @@ class ConfigManager:
15
23
  Parameters:
16
24
  - file_path (str, optional): The path to the configuration file. Default is 'config.json'.
17
25
  """
18
- self.file_path = Path(__file__).parent.parent.parent / file_name
26
+ if getattr(sys, 'frozen', False):
27
+ base_path = Path(sys._MEIPASS)
28
+ else:
29
+ base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
30
+ self.file_path = os.path.join(base_path, file_name)
19
31
  self.config = {}
20
32
  self.cache = {}
33
+ console.print(f"[green]Configuration file path: {self.file_path}[/green]")
21
34
 
22
35
  def read_config(self) -> None:
23
36
  """Read the configuration file."""
@@ -85,8 +85,9 @@ class TVShowManager:
85
85
  table.add_row(*row_data)
86
86
 
87
87
  self.console.print(table)
88
-
89
- def run_back_command(self, research_func: dict) -> None:
88
+
89
+ @staticmethod
90
+ def run_back_command(research_func: dict) -> None:
90
91
  """
91
92
  Executes a back-end search command by dynamically importing a module and invoking its search function.
92
93
 
@@ -116,8 +117,7 @@ class TVShowManager:
116
117
  search_func(None)
117
118
 
118
119
  except Exception as e:
119
- self.console.print(f"[red]Error during search: {e}")
120
- logging.exception("Error during search execution")
120
+ logging.error("Error during search execution")
121
121
 
122
122
  finally:
123
123
  if project_root in sys.path:
@@ -181,7 +181,7 @@ class TVShowManager:
181
181
  if self.slice_end > total_items:
182
182
  self.slice_end = total_items
183
183
  elif (key.lower() in ["b", "back"]) and research_func:
184
- self.run_back_command(research_func)
184
+ TVShowManager.run_back_command(research_func)
185
185
  else:
186
186
  break
187
187
 
@@ -215,7 +215,7 @@ class TVShowManager:
215
215
  self.slice_start = 0
216
216
  self.slice_end = self.step
217
217
  elif (key.lower() in ["b", "back"]) and research_func:
218
- self.run_back_command(research_func)
218
+ TVShowManager.run_back_command(research_func)
219
219
  else:
220
220
  break
221
221
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: StreamingCommunity
3
- Version: 2.6.0
3
+ Version: 2.6.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
@@ -592,14 +592,13 @@ python3 telegram_bot.py
592
592
  | Website | Status | Command |
593
593
  |:-------------------|:------:|:--------:|
594
594
  | [1337xx](https://1337xx.to/) | ✅ | -133 |
595
- | [AltadefinizioneGratis](https://altadefinizionegratis.pro/) | ✅ | -ALT |
596
595
  | [AnimeUnity](https://animeunity.so/) | ✅ | -ANI |
597
596
  | [Ilcorsaronero](https://ilcorsaronero.link/) | ✅ | `-ILC` |
598
597
  | [CB01New](https://cb01new.gold/) | ✅ | -CB0 |
599
598
  | [DDLStreamItaly](https://ddlstreamitaly.co/) | ✅ | -DDL |
600
599
  | [GuardaSerie](https://guardaserie.now/) | ✅ | -GUA |
601
600
  | [MostraGuarda](https://mostraguarda.stream/) | ✅ | -MOS |
602
- | [StreamingCommunity](https://streamingcommunity.paris/) | ✅ | -STR |
601
+ | [StreamingCommunity](https://streamingcommunity.lu/) | ✅ | -STR |
603
602
 
604
603
 
605
604
  # Tutorials
@@ -5,13 +5,10 @@ StreamingCommunity/Api/Player/maxstream.py,sha256=Q9td9lOxC_-8YwgB3bQ-H2686uMqjd
5
5
  StreamingCommunity/Api/Player/supervideo.py,sha256=udPbBUvlvHVUCZasOJvFmcQfSFmB0KquoSOWOiGur4M,5925
6
6
  StreamingCommunity/Api/Player/vixcloud.py,sha256=n9SEx2G6-7OsvTMHcSbpO_XmU2U8IDQAwQ6C-qioBUE,9226
7
7
  StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py,sha256=U-8QlD5kGzIk3-4t4D6QyYmiDe8UBrSuVi1YHRQb7AU,4295
8
- StreamingCommunity/Api/Player/Helper/Vixcloud/util.py,sha256=KqTtHJzfhtKHmMTdA7OWMgdpTHTe6LyXCphBLTMYLYs,4727
8
+ StreamingCommunity/Api/Player/Helper/Vixcloud/util.py,sha256=xt96JIbfE5W4Y59W888Cp-baRwnQVEDQO_x7Wq5iyNQ,5492
9
9
  StreamingCommunity/Api/Site/1337xx/__init__.py,sha256=AmvsV_jANao_agPGOrV8WFbGEjNlTCTk86Jec5RdRbs,1314
10
10
  StreamingCommunity/Api/Site/1337xx/site.py,sha256=OyS4FQ_IOSfbNcXHs0cJgnuG3407GfsN4v8P7uGZnrw,2639
11
11
  StreamingCommunity/Api/Site/1337xx/title.py,sha256=1_a8zMtjKX7E64U4jNq373KnGgKpdC1yNsenlclBJMo,1893
12
- StreamingCommunity/Api/Site/altadefinizionegratis/__init__.py,sha256=-d6ajulRxJathFxAveXmzpzOFbkbMtoWpViAThR6arM,2201
13
- StreamingCommunity/Api/Site/altadefinizionegratis/film.py,sha256=IIj7gZ1almed1aLsROd9-jek_q_wikf7CkPXowIEeW8,2274
14
- StreamingCommunity/Api/Site/altadefinizionegratis/site.py,sha256=Uc9dsamGvzWTTHkEiC8ekPwU3U5u_CK8gmu_M9yCVDc,3498
15
12
  StreamingCommunity/Api/Site/animeunity/__init__.py,sha256=2dul294DW-VnYGQeo5-WYlRZj1LjPbpL-bhlyuUl6WI,2219
16
13
  StreamingCommunity/Api/Site/animeunity/film_serie.py,sha256=L_7gQggHPf5T4-PLuDlFwTKqyq9ibH14m6EYyRiZEno,5686
17
14
  StreamingCommunity/Api/Site/animeunity/site.py,sha256=RoKRA28IObeGFgjINeXMziuGmAALv8-zGVb3O4KUwFg,5900
@@ -32,19 +29,19 @@ StreamingCommunity/Api/Site/ilcorsaronero/site.py,sha256=B5LwR0vLLDaXMfwFHF3hnTa
32
29
  StreamingCommunity/Api/Site/ilcorsaronero/title.py,sha256=aVkLZU5NsY40S_yrLYf2eAk3ZyEE_T9FlHZz9ZPCknM,1305
33
30
  StreamingCommunity/Api/Site/ilcorsaronero/util/ilCorsarScraper.py,sha256=BJgmv2UO3XM0gNkSsAt1REJoIUXjD_1nxT6Tpp5HGQg,5114
34
31
  StreamingCommunity/Api/Site/mostraguarda/__init__.py,sha256=Z4SpSr4OpNJYfhqxkNENZehk09jh72_D1cXTuoXNnVI,1184
35
- StreamingCommunity/Api/Site/mostraguarda/film.py,sha256=VlODqQkwhJsIZBkVXScQbmtmDE-VBxI4J8R4mIa2yu0,2476
36
- StreamingCommunity/Api/Site/streamingcommunity/__init__.py,sha256=xg6HC1U3bRExbH2Z-eDL5qr80Ol8lfyytiOZV1ygCi4,2453
32
+ StreamingCommunity/Api/Site/mostraguarda/film.py,sha256=-qOyxlZoLBnGGCaAMGaAoXzWGnPYqtRRmXZ0WUEMsy0,2758
33
+ StreamingCommunity/Api/Site/streamingcommunity/__init__.py,sha256=A9TYTo0ULdLvIT3gchCwWEASGwQnZ29Re_3lDKZrSvE,2292
37
34
  StreamingCommunity/Api/Site/streamingcommunity/film.py,sha256=92BjTgSsQPRK_t5gocN9JNs_SviErjYBJq1DJ_hvuV8,2517
38
- StreamingCommunity/Api/Site/streamingcommunity/series.py,sha256=YoR0X2w6wK3mYSjyS58mOLEmQLjhLbJ61t3EEXOkzeA,7791
39
- StreamingCommunity/Api/Site/streamingcommunity/site.py,sha256=kkf6jnBP3MLtT3OHaEkv6aFJoElonCQUxIErkl_Bb_E,4453
40
- StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py,sha256=t-Of4McSpJv8uZGP8hqBj1cuh57U8A5hhvMM18rHSaQ,4260
35
+ StreamingCommunity/Api/Site/streamingcommunity/series.py,sha256=c0T53pl3LfWsuYNDy5R1I9r4_aGdJaORndFGV70xPqw,7864
36
+ StreamingCommunity/Api/Site/streamingcommunity/site.py,sha256=npGH0QTw1PRmJcAzRpFd2pwb4GBOxg1-DijP_u8FSQU,2874
37
+ StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py,sha256=C88MF-Yqs6d4gGuAerEpgNgWUrrcKUpUpJYcwu959s4,3738
41
38
  StreamingCommunity/Api/Template/__init__.py,sha256=oyfd_4_g5p5q6mxb_rKwSsudZnTM3W3kg1tLwxg-v-Q,46
42
39
  StreamingCommunity/Api/Template/config_loader.py,sha256=FtVXEt7xqfNpTURZl7a0effYfns7Nb-OomJlfX2u4a0,2034
43
40
  StreamingCommunity/Api/Template/site.py,sha256=BNff60a8TWhg8yRnpGQPXtR8UKAVI2Kn3M-Wf1XIeE8,2934
44
41
  StreamingCommunity/Api/Template/Class/SearchType.py,sha256=FtO8xDUGEeJgMWsK2Ab7ZzAFsncalTYL2oEYi8uCnuk,2531
45
42
  StreamingCommunity/Api/Template/Util/__init__.py,sha256=lIP-Of79FzENknlgllwHloFAnuNbozjKCDIFk5L5KRw,276
46
43
  StreamingCommunity/Api/Template/Util/get_domain.py,sha256=OPgjNN3UgrMHPmy457_DbF5xSZ2fhvZCtRJHhqnYshY,7126
47
- StreamingCommunity/Api/Template/Util/manage_ep.py,sha256=vti7Pj2MEDmOtoi0yYpZXOdyczqcS8AJ2sWlrrn0NaE,7852
44
+ StreamingCommunity/Api/Template/Util/manage_ep.py,sha256=CQp7A4KatIpSczSEWZE6RR7_85XVdbqtspSDEIDKifw,8091
48
45
  StreamingCommunity/Api/Template/Util/recall_search.py,sha256=QSKDI4fyQfKF8C2eZXW6lBrAp1HTuhWQeA6g8ybDQYQ,1147
49
46
  StreamingCommunity/Lib/Downloader/__init__.py,sha256=JhbBh5hOnSM7VmtkxJ7zZ_FtWEC1JdnKThsSBjLV5FY,140
50
47
  StreamingCommunity/Lib/Downloader/HLS/downloader.py,sha256=POmu_pSQXuRK5ksYwMHzXG86D81u_q_2CG6dw2ZnDzw,21045
@@ -68,7 +65,7 @@ StreamingCommunity/TelegramHelp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
68
65
  StreamingCommunity/TelegramHelp/telegram_bot.py,sha256=jqyo_1cc8ZPGaurHcTZPvrMDnbCLD7I4WhGPXNCt7Fo,26544
69
66
  StreamingCommunity/Upload/update.py,sha256=ayuUzXEQcvc62SBC2NxJwvSvk4aoHZITHpmOuW5fT5w,2541
70
67
  StreamingCommunity/Upload/version.py,sha256=AwPISdmcGhWmUMpR872ujNW76kbY6A-OWYMSwQpV91U,171
71
- StreamingCommunity/Util/_jsonConfig.py,sha256=p4VkL5tGXIhrTY-Ay9Iad9lyYyC2grSx4A9jMELv-3g,7574
68
+ StreamingCommunity/Util/_jsonConfig.py,sha256=Rm8XMjdj6o6g1MzXosawW6KM8SQ95RJBdXl9JHps-rk,7924
72
69
  StreamingCommunity/Util/call_stack.py,sha256=bVYEjwLJnRNJ1tgfwClpyVcLKCTeTMHM2S6-HM2Ibfo,1375
73
70
  StreamingCommunity/Util/color.py,sha256=TWvoellnYd-oCTeU3bnXqkMf864KgF9YXwzjtI6rd4g,459
74
71
  StreamingCommunity/Util/console.py,sha256=xdGMbH38By9d4ugYMVJFaUrcMJW2krKZh0zbptA3SVQ,218
@@ -77,10 +74,10 @@ StreamingCommunity/Util/headers.py,sha256=RNM583pJIO0ytlf9HKJMQ2PFFwJaQZ1eeyMD5E
77
74
  StreamingCommunity/Util/logger.py,sha256=ekHO3tryCwo5zqSe2RoI6s3qZsZx9ghinTchipMEovg,2112
78
75
  StreamingCommunity/Util/message.py,sha256=F2QKjkcCBl6TjsaM5G6iDck0IhxBnDkKV3itwUebr5c,1403
79
76
  StreamingCommunity/Util/os.py,sha256=xF8wfjI8aLfIN6DwKYc0g2CMkj6PNtJUd4LCNJVCZY4,17426
80
- StreamingCommunity/Util/table.py,sha256=R3UbEJPXT0nIQf3huIYZUWKKwHC8aIAUHHuuS1N0r8E,8937
81
- StreamingCommunity-2.6.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
82
- StreamingCommunity-2.6.0.dist-info/METADATA,sha256=T5xj3NlqFSWbOUz8I65EVuxs6gAT253N6g4E7HMt9iQ,19650
83
- StreamingCommunity-2.6.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
84
- StreamingCommunity-2.6.0.dist-info/entry_points.txt,sha256=Qph9XYfDC8n4LfDLOSl6gJGlkb9eFb5f-JOr_Wb_5rk,67
85
- StreamingCommunity-2.6.0.dist-info/top_level.txt,sha256=YsOcxKP-WOhWpIWgBlh0coll9XUx7aqmRPT7kmt3fH0,19
86
- StreamingCommunity-2.6.0.dist-info/RECORD,,
77
+ StreamingCommunity/Util/table.py,sha256=Ca0bQWwfq_Tfx9ESHeQQgu3tAXTGaR7ku7VlJyr7R8I,8902
78
+ StreamingCommunity-2.6.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
79
+ StreamingCommunity-2.6.1.dist-info/METADATA,sha256=sF_Ek6eatgXhtIMAdS4Y9hPe-VM0iWy33bv1v5AuZpI,19566
80
+ StreamingCommunity-2.6.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
81
+ StreamingCommunity-2.6.1.dist-info/entry_points.txt,sha256=Qph9XYfDC8n4LfDLOSl6gJGlkb9eFb5f-JOr_Wb_5rk,67
82
+ StreamingCommunity-2.6.1.dist-info/top_level.txt,sha256=YsOcxKP-WOhWpIWgBlh0coll9XUx7aqmRPT7kmt3fH0,19
83
+ StreamingCommunity-2.6.1.dist-info/RECORD,,
@@ -1,76 +0,0 @@
1
- # 26.05.24
2
-
3
- import sys
4
- import subprocess
5
- from urllib.parse import quote_plus
6
-
7
-
8
- # Internal utilities
9
- from StreamingCommunity.Util.console import console, msg
10
- from StreamingCommunity.Api.Template import get_select_title
11
- from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
12
-
13
-
14
- # Logic class
15
- from StreamingCommunity.Api.Template.config_loader import site_constant
16
- from .site import title_search, media_search_manager, table_show_manager
17
- from .film import download_film
18
-
19
-
20
- # Variable
21
- indice = 2
22
- _useFor = "film"
23
- _deprecate = False
24
- _priority = 2
25
- _engineDownload = "hls"
26
-
27
-
28
- def search(string_to_search: str = None, get_onylDatabase: bool = False):
29
- """
30
- Main function of the application for film and series.
31
- """
32
- if site_constant.TELEGRAM_BOT:
33
- bot = get_bot_instance()
34
-
35
- if string_to_search is None:
36
-
37
- # Chiedi la scelta all'utente con il bot Telegram
38
- string_to_search = bot.ask(
39
- "key_search",
40
- f"Inserisci la parola da cercare\noppure 🔙 back per tornare alla scelta: ",
41
- None
42
- )
43
-
44
- if string_to_search == 'back':
45
- # Riavvia lo script
46
- # Chiude il processo attuale e avvia una nuova istanza dello script
47
- subprocess.Popen([sys.executable] + sys.argv)
48
- sys.exit()
49
-
50
- else:
51
- if string_to_search is None:
52
- string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{site_constant.SITE_NAME}").strip()
53
-
54
- # Search on database
55
- len_database = title_search(quote_plus(string_to_search))
56
-
57
- # Return list of elements
58
- if get_onylDatabase:
59
- return media_search_manager
60
-
61
- if len_database > 0:
62
-
63
- # Select title from list
64
- select_title = get_select_title(table_show_manager, media_search_manager)
65
-
66
- # Download only film
67
- download_film(select_title)
68
-
69
- else:
70
- if site_constant.TELEGRAM_BOT:
71
- bot.send_message(f"Nessun risultato trovato riprova", None)
72
-
73
- console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
74
-
75
- # Retry
76
- search()
@@ -1,76 +0,0 @@
1
- # 26.05.24
2
-
3
- import os
4
-
5
-
6
- # Internal utilities
7
- from StreamingCommunity.Util.console import console
8
- from StreamingCommunity.Util.os import os_manager
9
- from StreamingCommunity.Util.message import start_message
10
- from StreamingCommunity.Lib.Downloader import HLS_Downloader
11
- from StreamingCommunity.TelegramHelp.telegram_bot import TelegramSession, get_bot_instance
12
-
13
-
14
- # Logic class
15
- from StreamingCommunity.Api.Template.config_loader import site_constant
16
- from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
17
-
18
-
19
- # Player
20
- from StreamingCommunity.Api.Player.supervideo import VideoSource
21
-
22
-
23
- def download_film(select_title: MediaItem) -> str:
24
- """
25
- Downloads a film using the provided film ID, title name, and domain.
26
-
27
- Parameters:
28
- - title_name (str): The name of the film title.
29
- - url (str): The url of the video
30
-
31
- Return:
32
- - str: output path
33
- """
34
- if site_constant.TELEGRAM_BOT:
35
- bot = get_bot_instance()
36
- bot.send_message(f"Download in corso:\n{select_title.name}", None)
37
-
38
- # Get script_id
39
- script_id = TelegramSession.get_session()
40
- if script_id != "unknown":
41
- TelegramSession.updateScriptId(script_id, select_title.name)
42
-
43
- # Start message and display film information
44
- start_message()
45
- console.print(f"[yellow]Download: [red]{select_title.name} \n")
46
-
47
- # Set domain and media ID for the video source
48
- video_source = VideoSource(select_title.url)
49
-
50
- # Define output path
51
- title_name = os_manager.get_sanitize_file(select_title.name) + ".mp4"
52
- mp4_path = os.path.join(site_constant.MOVIE_FOLDER, title_name.replace(".mp4", ""))
53
-
54
- # Get m3u8 master playlist
55
- master_playlist = video_source.get_playlist()
56
-
57
- # Download the film using the m3u8 playlist, and output filename
58
- r_proc = HLS_Downloader(
59
- m3u8_url=master_playlist,
60
- output_path=os.path.join(mp4_path, title_name)
61
- ).start()
62
-
63
- if site_constant.TELEGRAM_BOT:
64
-
65
- # Delete script_id
66
- script_id = TelegramSession.get_session()
67
- if script_id != "unknown":
68
- TelegramSession.deleteScriptId(script_id)
69
-
70
- if "error" in r_proc.keys():
71
- try:
72
- os.remove(r_proc['path'])
73
- except:
74
- pass
75
-
76
- return r_proc['path']
@@ -1,109 +0,0 @@
1
- # 26.05.24
2
-
3
- # External libraries
4
- import httpx
5
- from bs4 import BeautifulSoup
6
-
7
-
8
- # Internal utilities
9
- from StreamingCommunity.Util.console import console
10
- from StreamingCommunity.Util._jsonConfig import config_manager
11
- from StreamingCommunity.Util.headers import get_headers
12
- from StreamingCommunity.Util.table import TVShowManager
13
-
14
-
15
- # Logic class
16
- from StreamingCommunity.Api.Template.config_loader import site_constant
17
- from StreamingCommunity.Api.Template.Util import search_domain
18
- from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
19
-
20
-
21
- # Variable
22
- media_search_manager = MediaManager()
23
- table_show_manager = TVShowManager()
24
- max_timeout = config_manager.get_int("REQUESTS", "timeout")
25
- disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
26
-
27
- # Telegram bot instance
28
- from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
29
- from StreamingCommunity.Util._jsonConfig import config_manager
30
- TELEGRAM_BOT = config_manager.get_bool('DEFAULT', 'telegram_bot')
31
-
32
-
33
- def title_search(title_search: str) -> int:
34
- """
35
- Search for titles based on a search query.
36
-
37
- Parameters:
38
- - title_search (str): The title to search for.
39
-
40
- Returns:
41
- int: The number of titles found.
42
- """
43
- if TELEGRAM_BOT:
44
- bot = get_bot_instance()
45
-
46
- media_search_manager.clear()
47
- table_show_manager.clear()
48
-
49
- # Find new domain if prev dont work
50
- domain_to_use = site_constant.DOMAIN_NOW
51
-
52
- if not disable_searchDomain:
53
- domain_to_use, base_url = search_domain(site_constant.SITE_NAME, f"https://{site_constant.SITE_NAME}.{site_constant.DOMAIN_NOW}")
54
-
55
- # Send request to search for title
56
- client = httpx.Client()
57
-
58
- try:
59
- response = client.get(
60
- url=f"https://{site_constant.SITE_NAME}.{domain_to_use}/?story={title_search.replace(' ', '+')}&do=search&subaction=search&titleonly=3",
61
- headers={'User-Agent': get_headers()},
62
- timeout=max_timeout
63
- )
64
- response.raise_for_status()
65
-
66
- except Exception as e:
67
- console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
68
- raise
69
-
70
- # Create soup and find table
71
- soup = BeautifulSoup(response.text, "html.parser")
72
-
73
- # Inizializza la lista delle scelte
74
- if TELEGRAM_BOT:
75
- choices = []
76
-
77
- for row in soup.find_all('div', class_='col-lg-3 col-md-3 col-xs-4'):
78
- try:
79
-
80
- title_element = row.find('h2', class_='titleFilm').find('a')
81
- title = title_element.get_text(strip=True)
82
- link = title_element['href']
83
-
84
- imdb_element = row.find('div', class_='imdb-rate')
85
- imdb_rating = imdb_element.get_text(strip=True).split(":")[-1]
86
-
87
- film_info = {
88
- 'name': title,
89
- 'url': link,
90
- 'score': imdb_rating
91
- }
92
-
93
- media_search_manager.add_media(film_info)
94
-
95
- if TELEGRAM_BOT:
96
- # Crea una stringa formattata per ogni scelta con numero
97
- choice_text = f"{len(choices)} - {film_info.get('name')} ({film_info.get('url')}) {film_info.get('score')}"
98
- choices.append(choice_text)
99
-
100
- except AttributeError as e:
101
- print(f"Error parsing a film entry: {e}")
102
-
103
-
104
- if TELEGRAM_BOT:
105
- if choices:
106
- bot.send_message(f"Lista dei risultati:", choices)
107
-
108
- # Return the number of titles found
109
- return media_search_manager.get_length()