StreamingCommunity 3.0.0__py3-none-any.whl → 3.0.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.

Potentially problematic release.


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

@@ -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
@@ -10,7 +10,7 @@ StreamingCommunity/Api/Player/vixcloud.py,sha256=qI9ppYEMGaJ1B5y693BOMeRQri-F4-9
10
10
  StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py,sha256=U-8QlD5kGzIk3-4t4D6QyYmiDe8UBrSuVi1YHRQb7AU,4295
11
11
  StreamingCommunity/Api/Player/Helper/Vixcloud/util.py,sha256=QLUgbwQrpuPIVNzdBlAiEJXnd-eCj_JQFckZZEEL55w,5214
12
12
  StreamingCommunity/Api/Site/1337xx/__init__.py,sha256=OdQxYoJ9UyGSAutZwqH1FgmOH-Z6vGVHb0CLKhwEZGM,1999
13
- StreamingCommunity/Api/Site/1337xx/site.py,sha256=lwpZt8ALBd9_ImuFWKrRx6KCIqPmDMdqZCM-n-pxvGI,2283
13
+ StreamingCommunity/Api/Site/1337xx/site.py,sha256=9W88ErYQjCUoNAPS7PBie4838Gh1UJBTqQ8uGgS_InI,2344
14
14
  StreamingCommunity/Api/Site/1337xx/title.py,sha256=8T3cVRb-Mt9QdOtKWVVFHz8iOHqspf7iw28E7bfTV78,1865
15
15
  StreamingCommunity/Api/Site/altadefinizione/__init__.py,sha256=Oxjfyg6VolwV6n2VGgICLvdRVPPMzJXMSdz8oI2Xs0M,4145
16
16
  StreamingCommunity/Api/Site/altadefinizione/film.py,sha256=0XeqMrMHnk5nbFkVTFaNZWtlXI8pETl7dsORDtIMbjg,4395
@@ -21,15 +21,12 @@ StreamingCommunity/Api/Site/animeunity/__init__.py,sha256=EayZqxyWltgjRRDNfM32JR
21
21
  StreamingCommunity/Api/Site/animeunity/film.py,sha256=Vqg6yag2siR-Y3ougBsV8mzdQXChxg6ghz_KVXFQ3pE,998
22
22
  StreamingCommunity/Api/Site/animeunity/serie.py,sha256=ib86sLXYsYbrvrFNbzKdhlwMUO3DT7JS5yTTrrSr2jk,5711
23
23
  StreamingCommunity/Api/Site/animeunity/site.py,sha256=KLBQ08TAMyzsrZ3SAxw8hZefreCtZAuU1KwEbaJnUAE,5646
24
- StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py,sha256=9q108tS2St3ogR73nGZhMlCTHoZH-taE_CTBC6LY6d0,3374
24
+ StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py,sha256=Ze6a8D2MRhiOvSw3mTpL3ue2iVc6pA5aqoyUMCTnT7A,3809
25
25
  StreamingCommunity/Api/Site/animeworld/__init__.py,sha256=UzHQbfxx_i6qzM586LL940CoiI3Y98IGIVP4-hXUxn4,2790
26
26
  StreamingCommunity/Api/Site/animeworld/film.py,sha256=W9KOS9Wvx3Mlqx5WojR-NgnF9WX8mI79JZPS7UwG-dc,1763
27
27
  StreamingCommunity/Api/Site/animeworld/serie.py,sha256=MXyV1fK05jPW4iV9NWrRKW-R4ect-TSN78-2APayniU,3516
28
28
  StreamingCommunity/Api/Site/animeworld/site.py,sha256=1Ah4CmKXdqsoCGTbyPRSVJRAxtcW449kpBnPKnzR1K8,3650
29
29
  StreamingCommunity/Api/Site/animeworld/util/ScrapeSerie.py,sha256=CBTCH_wnTXUK_MKwq9a1k_XdvOlUrMpbUmpkD5fXVQ0,3589
30
- StreamingCommunity/Api/Site/cb01new/__init__.py,sha256=fy0dPL0NnZxSz3UL_i_zE809Rus7-ZI60WsXq9S4NUs,2039
31
- StreamingCommunity/Api/Site/cb01new/film.py,sha256=vjd1ftm4LhxxG0TTKEwlOXtx0AYgxBbV5ZlQH8aSxGU,1695
32
- StreamingCommunity/Api/Site/cb01new/site.py,sha256=ROT3yh6mpC85qHJAvPkWply91tFd8-V7ayX_3KsdtR4,2152
33
30
  StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py,sha256=2FGeGNJ5SHPQzKEEmVMFWft4woGgJ-XLeNxjbSb6L9s,2141
34
31
  StreamingCommunity/Api/Site/ddlstreamitaly/series.py,sha256=F_D_2lwHHWN5hgLs8oUDNCYe-4SEPtWzJoU4yT_Nzfg,3726
35
32
  StreamingCommunity/Api/Site/ddlstreamitaly/site.py,sha256=hspimNOnIkLdJMrYLgXHmXepLz_mu8z257camnlGfaI,2596
@@ -74,18 +71,18 @@ StreamingCommunity/Lib/TMBD/tmdb.py,sha256=byg0EFnlmd9JeLvn1N9K3QkB1KEfeMuFa7OVf
74
71
  StreamingCommunity/TelegramHelp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
72
  StreamingCommunity/TelegramHelp/telegram_bot.py,sha256=Qe1__aoK4PpDuing8JtWgdHzLee8LuYYyfeLNA7yADU,26307
76
73
  StreamingCommunity/Upload/update.py,sha256=mJTKUIOhC2j03sWXUK6oAZxHyObNP2r1fl3y0BC2jes,3351
77
- StreamingCommunity/Upload/version.py,sha256=w7FJx8AjjjVxIMxI1IxHS70oEvmUKg7KBImjlhijaMI,171
74
+ StreamingCommunity/Upload/version.py,sha256=19qvo-oaTAFq9_mEO90hzV-55WLMgiz_AJymK2rqe1E,171
78
75
  StreamingCommunity/Util/color.py,sha256=NvD0Eni-25oOOkY-szCEoc0lGvzQxyL7xhM0RE4EvUM,458
79
- StreamingCommunity/Util/config_json.py,sha256=xiE5JNw9HgbBdBqKhlywwWw1EnoyDdG47wcxFDTC8sA,24960
76
+ StreamingCommunity/Util/config_json.py,sha256=r31BJP67EItcI6GioEX7FJzmzM0mubmZ7M73mvZ9YWo,24801
80
77
  StreamingCommunity/Util/ffmpeg_installer.py,sha256=yRVIPwbh05tZ-duZmXkH0qasLNxaQCAT_E4cTP79Z3c,14890
81
78
  StreamingCommunity/Util/headers.py,sha256=TItkaFMx1GqsVNEIS3Tr0BGU5EHyF-HkZVliHORT3P8,308
82
79
  StreamingCommunity/Util/logger.py,sha256=9kGD6GmWj2pM8ADpJc85o7jm8DD0c5Aguqnq-9kmxos,3314
83
80
  StreamingCommunity/Util/message.py,sha256=SJaIPLvWeQqsIODVUKw3TgYRmBChovmlbcF6OUxqMI8,1425
84
81
  StreamingCommunity/Util/os.py,sha256=0AD2DYoan9dl1ZC1pjDoUM7D8sRa9p81cGdI-lP1OX4,14993
85
82
  StreamingCommunity/Util/table.py,sha256=Nw5PlsvfEIOQZWy5VhsU5OK3heuBXGwsqmLl0k8yQzc,9813
86
- streamingcommunity-3.0.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
87
- streamingcommunity-3.0.0.dist-info/METADATA,sha256=OwSAYErIcsUYH-VDC9VlXEpNByWJpCBCCZgC-vMu5UY,25012
88
- streamingcommunity-3.0.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
89
- streamingcommunity-3.0.0.dist-info/entry_points.txt,sha256=Qph9XYfDC8n4LfDLOSl6gJGlkb9eFb5f-JOr_Wb_5rk,67
90
- streamingcommunity-3.0.0.dist-info/top_level.txt,sha256=YsOcxKP-WOhWpIWgBlh0coll9XUx7aqmRPT7kmt3fH0,19
91
- streamingcommunity-3.0.0.dist-info/RECORD,,
83
+ streamingcommunity-3.0.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
84
+ streamingcommunity-3.0.1.dist-info/METADATA,sha256=1tW1Y50Qcjy5eYGbXcnln1HWIeIgwxbFhz_vJqRe7AA,25012
85
+ streamingcommunity-3.0.1.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
86
+ streamingcommunity-3.0.1.dist-info/entry_points.txt,sha256=Qph9XYfDC8n4LfDLOSl6gJGlkb9eFb5f-JOr_Wb_5rk,67
87
+ streamingcommunity-3.0.1.dist-info/top_level.txt,sha256=YsOcxKP-WOhWpIWgBlh0coll9XUx7aqmRPT7kmt3fH0,19
88
+ streamingcommunity-3.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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()