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

@@ -1,5 +1,5 @@
1
1
  __title__ = 'StreamingCommunity'
2
- __version__ = '3.0.8'
2
+ __version__ = '3.0.9'
3
3
  __author__ = 'Arrowar'
4
4
  __description__ = 'A command-line program to download film'
5
5
  __copyright__ = 'Copyright 2024'
@@ -268,33 +268,32 @@ class ConfigManager:
268
268
  self._load_site_data_from_file()
269
269
 
270
270
  def _load_site_data_from_api(self) -> None:
271
- """Load site data from API."""
271
+ """Load site data from GitHub."""
272
+ domains_github_url = "https://raw.githubusercontent.com/Arrowar/StreamingCommunity/refs/heads/main/.github/.domain/domains.json"
272
273
  headers = {
273
- "apikey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2Zm5ncG94d3Jnc3duenl0YWRoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDAxNTIxNjMsImV4cCI6MjA1NTcyODE2M30.FNTCCMwi0QaKjOu8gtZsT5yQttUW8QiDDGXmzkn89QE",
274
- "Authorization": f"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp2Zm5ncG94d3Jnc3duenl0YWRoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDAxNTIxNjMsImV4cCI6MjA1NTcyODE2M30.FNTCCMwi0QaKjOu8gtZsT5yQttUW8QiDDGXmzkn89QE",
275
- "Content-Type": "application/json",
276
- "User-Agent": get_userAgent()
274
+ "User-Agent": get_userAgent()
277
275
  }
278
276
 
279
277
  try:
280
- console.print("[bold cyan]Retrieving site data from API...[/bold cyan]")
281
- response = requests.get("https://zvfngpoxwrgswnzytadh.supabase.co/rest/v1/public", timeout=8, headers=headers)
278
+ console.print(f"[bold cyan]Retrieving site data from GitHub:[/bold cyan] [green]{domains_github_url}[/green]")
279
+ response = requests.get(domains_github_url, timeout=8, headers=headers)
282
280
 
283
281
  if response.ok:
284
- data = response.json()
285
- if data and len(data) > 0:
286
- self.configSite = data[0]['data']
287
-
288
- site_count = len(self.configSite) if isinstance(self.configSite, dict) else 0
289
-
290
- else:
291
- console.print("[bold yellow]API returned an empty data set[/bold yellow]")
282
+ self.configSite = response.json()
283
+
284
+ site_count = len(self.configSite) if isinstance(self.configSite, dict) else 0
285
+ console.print(f"[bold green]Site data loaded from GitHub:[/bold green] {site_count} streaming services found.")
286
+
292
287
  else:
293
- console.print(f"[bold red]API request failed:[/bold red] HTTP {response.status_code}, {response.text[:100]}")
288
+ console.print(f"[bold red]GitHub request failed:[/bold red] HTTP {response.status_code}, {response.text[:100]}")
294
289
  self._handle_site_data_fallback()
295
290
 
291
+ except json.JSONDecodeError as e:
292
+ console.print(f"[bold red]Error parsing JSON from GitHub:[/bold red] {str(e)}")
293
+ self._handle_site_data_fallback()
294
+
296
295
  except Exception as e:
297
- console.print(f"[bold red]API connection error:[/bold red] {str(e)}")
296
+ console.print(f"[bold red]GitHub connection error:[/bold red] {str(e)}")
298
297
  self._handle_site_data_fallback()
299
298
 
300
299
  def _load_site_data_from_file(self) -> None:
@@ -12,7 +12,7 @@ import inspect
12
12
  import subprocess
13
13
  import contextlib
14
14
  import importlib.metadata
15
-
15
+ import socket
16
16
 
17
17
  # External library
18
18
  from unidecode import unidecode
@@ -283,38 +283,62 @@ class InternManager():
283
283
  else:
284
284
  return f"{bytes / (1024 * 1024):.2f} MB/s"
285
285
 
286
- def check_dns_provider(self):
286
+ # def check_dns_provider(self):
287
+ # """
288
+ # Check if the system's current DNS server matches any known DNS providers.
289
+
290
+ # Returns:
291
+ # bool: True if the current DNS server matches a known provider,
292
+ # False if no match is found or in case of errors
293
+ # """
294
+ # dns_providers = {
295
+ # "Cloudflare": ["1.1.1.1", "1.0.0.1"],
296
+ # "Google": ["8.8.8.8", "8.8.4.4"],
297
+ # "OpenDNS": ["208.67.222.222", "208.67.220.220"],
298
+ # "Quad9": ["9.9.9.9", "149.112.112.112"],
299
+ # "AdGuard": ["94.140.14.14", "94.140.15.15"],
300
+ # "Comodo": ["8.26.56.26", "8.20.247.20"],
301
+ # "Level3": ["209.244.0.3", "209.244.0.4"],
302
+ # "Norton": ["199.85.126.10", "199.85.127.10"],
303
+ # "CleanBrowsing": ["185.228.168.9", "185.228.169.9"],
304
+ # "Yandex": ["77.88.8.8", "77.88.8.1"]
305
+ # }
306
+
307
+ # try:
308
+ # resolver = dns.resolver.Resolver()
309
+ # nameservers = resolver.nameservers
310
+
311
+ # if not nameservers:
312
+ # return False
313
+
314
+ # for server in nameservers:
315
+ # for provider, ips in dns_providers.items():
316
+ # if server in ips:
317
+ # return True
318
+ # return False
319
+
320
+ # except Exception:
321
+ # return False
322
+
323
+ def check_dns_resolve(self):
287
324
  """
288
- Check if the system's current DNS server matches any known DNS providers.
325
+ Check if the system's current DNS server can resolve a domain name.
326
+ Works on both Windows and Unix-like systems.
289
327
 
290
328
  Returns:
291
- bool: True if the current DNS server matches a known provider,
292
- False if no match is found or in case of errors
329
+ bool: True if the current DNS server can resolve a domain name,
330
+ False if can't resolve or in case of errors
293
331
  """
294
- dns_providers = {
295
- "Cloudflare": ["1.1.1.1", "1.0.0.1"],
296
- "Google": ["8.8.8.8", "8.8.4.4"],
297
- "OpenDNS": ["208.67.222.222", "208.67.220.220"],
298
- "Quad9": ["9.9.9.9", "149.112.112.112"],
299
- }
332
+ test_domains = ["github.com", "google.com", "microsoft.com", "amazon.com"]
300
333
 
301
334
  try:
302
- resolver = dns.resolver.Resolver()
303
- nameservers = resolver.nameservers
304
-
305
- if not nameservers:
306
- return False
307
-
308
- for server in nameservers:
309
- for provider, ips in dns_providers.items():
310
- if server in ips:
311
- return True
312
- return False
313
-
314
- except Exception:
335
+ for domain in test_domains:
336
+ # socket.gethostbyname() works consistently across all platforms
337
+ socket.gethostbyname(domain)
338
+ return True
339
+ except (socket.gaierror, socket.error):
315
340
  return False
316
341
 
317
-
318
342
  class OsSummary:
319
343
  def __init__(self):
320
344
  self.ffmpeg_path = None
StreamingCommunity/run.py CHANGED
@@ -210,7 +210,19 @@ def main(script_id = 0):
210
210
  log_not = Logger()
211
211
  initialize()
212
212
 
213
- if not internet_manager.check_dns_provider():
213
+ # if not internet_manager.check_dns_provider():
214
+ # print()
215
+ # console.print("[red]❌ ERROR: DNS configuration is required!")
216
+ # console.print("[red]The program cannot function correctly without proper DNS settings.")
217
+ # console.print("[yellow]Please configure one of these DNS servers:")
218
+ # console.print("[blue]• Cloudflare (1.1.1.1) 'https://developers.cloudflare.com/1.1.1.1/setup/windows/'")
219
+ # console.print("[blue]• Quad9 (9.9.9.9) 'https://docs.quad9.net/Setup_Guides/Windows/Windows_10/'")
220
+ # console.print("\n[yellow]⚠️ The program will not work until you configure your DNS settings.")
221
+
222
+ # time.sleep(2)
223
+ # msg.ask("[yellow]Press Enter to continue ...")
224
+
225
+ if not internet_manager.check_dns_resolve():
214
226
  print()
215
227
  console.print("[red]❌ ERROR: DNS configuration is required!")
216
228
  console.print("[red]The program cannot function correctly without proper DNS settings.")
@@ -219,8 +231,7 @@ def main(script_id = 0):
219
231
  console.print("[blue]• Quad9 (9.9.9.9) 'https://docs.quad9.net/Setup_Guides/Windows/Windows_10/'")
220
232
  console.print("\n[yellow]⚠️ The program will not work until you configure your DNS settings.")
221
233
 
222
- time.sleep(2)
223
- msg.ask("[yellow]Press Enter to continue ...")
234
+ os._exit(0)
224
235
 
225
236
  # Load search functions
226
237
  search_functions = load_search_functions()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: StreamingCommunity
3
- Version: 3.0.8
3
+ Version: 3.0.9
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
@@ -1,6 +1,6 @@
1
1
  StreamingCommunity/__init__.py,sha256=Cw-N0VCg7sef1WqdtvVwrhs1zc4LoUhs5C8k7vpM1lQ,207
2
2
  StreamingCommunity/global_search.py,sha256=fAl_tRCP8SeQoBifXs7hGX9-7Bd9FlJw69NjsWNUUL0,12396
3
- StreamingCommunity/run.py,sha256=Ad-_SUbfJblh6vtgSnA1ZIw8IXYl0AY3n4OhoTvEH5A,12384
3
+ StreamingCommunity/run.py,sha256=IOMEMkfn4p5hoYbDO2JNt8kIxz3GvgXOn8puzkXjS4I,13067
4
4
  StreamingCommunity/Api/Player/ddl.py,sha256=S3UZFonJl3d3xU1fQrosRFXFhwAm8hGVQ8Ff8g-6xSI,2071
5
5
  StreamingCommunity/Api/Player/hdplayer.py,sha256=zfPcmtt8f-NfH9yapwwWpVSts-7s47vJ4_XHKJFg0i8,1875
6
6
  StreamingCommunity/Api/Player/maxstream.py,sha256=6y2h7cMSA_kmaeiOWqqyMVBMrtX6HTt2WT0QXxirCxg,4839
@@ -79,18 +79,18 @@ StreamingCommunity/TelegramHelp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
79
79
  StreamingCommunity/TelegramHelp/config.json,sha256=x1rtclDIrlnFcmiAmCQnV3WpnlTl5ds1LRRqECIF7xk,1581
80
80
  StreamingCommunity/TelegramHelp/telegram_bot.py,sha256=zCqj7xBofh9FYfEYl55mgT945jqtKo7qJhn-SMLvAvA,26455
81
81
  StreamingCommunity/Upload/update.py,sha256=Tp7PdU49rk1bga76_DiaghrbE7Fb3p4iq5S4CqZZy2A,3462
82
- StreamingCommunity/Upload/version.py,sha256=pv7LAMw9I6WYR7HXQzKw8PBByU3jr_Bx4FlaZB2Lsxs,171
82
+ StreamingCommunity/Upload/version.py,sha256=aTDk5HZGG-MlYRi76ZutQ0dPdPG1Lsm1cLMGSfgy38A,171
83
83
  StreamingCommunity/Util/color.py,sha256=NvD0Eni-25oOOkY-szCEoc0lGvzQxyL7xhM0RE4EvUM,458
84
- StreamingCommunity/Util/config_json.py,sha256=yeVXqAtmwQQasdnD97OoNId2MGSdx6bCKHs7AKEGbqA,24602
84
+ StreamingCommunity/Util/config_json.py,sha256=bC55i7nJuBQSsdnqQo9QtW4l-Ho2BaF0pJhIVr0nJjA,24321
85
85
  StreamingCommunity/Util/ffmpeg_installer.py,sha256=yRVIPwbh05tZ-duZmXkH0qasLNxaQCAT_E4cTP79Z3c,14890
86
86
  StreamingCommunity/Util/headers.py,sha256=TItkaFMx1GqsVNEIS3Tr0BGU5EHyF-HkZVliHORT3P8,308
87
87
  StreamingCommunity/Util/logger.py,sha256=9kGD6GmWj2pM8ADpJc85o7jm8DD0c5Aguqnq-9kmxos,3314
88
88
  StreamingCommunity/Util/message.py,sha256=SJaIPLvWeQqsIODVUKw3TgYRmBChovmlbcF6OUxqMI8,1425
89
- StreamingCommunity/Util/os.py,sha256=tYLOGqqmR4hPvJo1kPpKTs7Go0ILii4ye5QFBBn9fYQ,16045
89
+ StreamingCommunity/Util/os.py,sha256=zCPlV9hb8hbBJglwnrJU0XGhBu538x3zgdNO5sLQ73c,17176
90
90
  StreamingCommunity/Util/table.py,sha256=Nw5PlsvfEIOQZWy5VhsU5OK3heuBXGwsqmLl0k8yQzc,9813
91
- streamingcommunity-3.0.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
92
- streamingcommunity-3.0.8.dist-info/METADATA,sha256=cy1f5rd0Na_xPYoDmIDK3JuaPM5cOZtwE9nTBsw68r4,24958
93
- streamingcommunity-3.0.8.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
94
- streamingcommunity-3.0.8.dist-info/entry_points.txt,sha256=Qph9XYfDC8n4LfDLOSl6gJGlkb9eFb5f-JOr_Wb_5rk,67
95
- streamingcommunity-3.0.8.dist-info/top_level.txt,sha256=YsOcxKP-WOhWpIWgBlh0coll9XUx7aqmRPT7kmt3fH0,19
96
- streamingcommunity-3.0.8.dist-info/RECORD,,
91
+ streamingcommunity-3.0.9.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
92
+ streamingcommunity-3.0.9.dist-info/METADATA,sha256=6QMVwuzxoNs3c1xmUXEe_XjNHDBK1_Wb2a70rJQOHqc,24958
93
+ streamingcommunity-3.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
94
+ streamingcommunity-3.0.9.dist-info/entry_points.txt,sha256=Qph9XYfDC8n4LfDLOSl6gJGlkb9eFb5f-JOr_Wb_5rk,67
95
+ streamingcommunity-3.0.9.dist-info/top_level.txt,sha256=YsOcxKP-WOhWpIWgBlh0coll9XUx7aqmRPT7kmt3fH0,19
96
+ streamingcommunity-3.0.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5