mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
api: Add search verify=False
This commit is contained in:
parent
57cc01b6bc
commit
0a03be0fae
@ -22,8 +22,7 @@ from .title import download_title
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 3
|
indice = 3
|
||||||
_useFor = "film_serie"
|
_useFor = "film_serie"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 2
|
|
||||||
_engineDownload = "tor"
|
_engineDownload = "tor"
|
||||||
|
|
||||||
console = Console()
|
console = Console()
|
||||||
|
@ -43,7 +43,12 @@ def title_search(query: str) -> int:
|
|||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
response = httpx.get(
|
||||||
|
search_url,
|
||||||
|
headers={'user-agent': get_userAgent()},
|
||||||
|
timeout=max_timeout,
|
||||||
|
follow_redirects=True
|
||||||
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -25,8 +25,7 @@ from .series import download_series
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 2
|
indice = 2
|
||||||
_useFor = "film_serie"
|
_useFor = "film_serie"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 1
|
|
||||||
_engineDownload = "hls"
|
_engineDownload = "hls"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -46,7 +46,12 @@ def title_search(query: str) -> int:
|
|||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.post(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
response = httpx.post(
|
||||||
|
search_url,
|
||||||
|
headers={'user-agent': get_userAgent()},
|
||||||
|
timeout=max_timeout,
|
||||||
|
follow_redirects=True
|
||||||
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -25,8 +25,7 @@ from .serie import download_series
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 1
|
indice = 1
|
||||||
_useFor = "anime"
|
_useFor = "anime"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 2
|
|
||||||
_engineDownload = "mp4"
|
_engineDownload = "mp4"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -20,8 +20,7 @@ from .film import download_film
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 8
|
indice = 8
|
||||||
_useFor = "anime"
|
_useFor = "anime"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 2
|
|
||||||
_engineDownload = "mp4"
|
_engineDownload = "mp4"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -70,7 +70,12 @@ def title_search(query: str) -> int:
|
|||||||
|
|
||||||
# Make the GET request
|
# Make the GET request
|
||||||
try:
|
try:
|
||||||
response = httpx.get(search_url, headers={'User-Agent': get_userAgent()})
|
response = httpx.get(
|
||||||
|
search_url,
|
||||||
|
headers={'User-Agent': get_userAgent()},
|
||||||
|
timeout=max_timeout,
|
||||||
|
verify=False
|
||||||
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
|
console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
|
||||||
|
@ -22,8 +22,7 @@ from .film import download_film
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 4
|
indice = 4
|
||||||
_useFor = "film"
|
_useFor = "film"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 2
|
|
||||||
_engineDownload = "mp4"
|
_engineDownload = "mp4"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -44,7 +44,13 @@ def title_search(query: str) -> int:
|
|||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.get(url=search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
response = httpx.get(
|
||||||
|
search_url,
|
||||||
|
headers={'user-agent': get_userAgent()},
|
||||||
|
timeout=max_timeout,
|
||||||
|
follow_redirects=True,
|
||||||
|
verify=False
|
||||||
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -23,8 +23,7 @@ from .series import download_thread
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 6
|
indice = 6
|
||||||
_useFor = "serie"
|
_useFor = "serie"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 2
|
|
||||||
_engineDownload = "mp4"
|
_engineDownload = "mp4"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -44,7 +44,12 @@ def title_search(query: str) -> int:
|
|||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
response = httpx.get(
|
||||||
|
search_url,
|
||||||
|
headers={'user-agent': get_userAgent()},
|
||||||
|
timeout=max_timeout,
|
||||||
|
follow_redirects=True
|
||||||
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -22,8 +22,7 @@ from .series import download_series
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 5
|
indice = 5
|
||||||
_useFor = "serie"
|
_useFor = "serie"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 2
|
|
||||||
_engineDownload = "hls"
|
_engineDownload = "hls"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -44,7 +44,13 @@ def title_search(query: str) -> int:
|
|||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
response = httpx.get(
|
||||||
|
search_url,
|
||||||
|
headers={'user-agent': get_userAgent()},
|
||||||
|
timeout=max_timeout,
|
||||||
|
follow_redirects=True,
|
||||||
|
verify=False
|
||||||
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -21,8 +21,7 @@ from .film import download_film
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 8
|
indice = 8
|
||||||
_useFor = "film_serie"
|
_useFor = "film_serie"
|
||||||
_deprecate = False
|
_priority = 1 # NOTE: Site search need the use of tmbd obj
|
||||||
_priority = 3
|
|
||||||
_engineDownload = "hls"
|
_engineDownload = "hls"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# 3.12.23
|
# 21.05.24
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# 3.12.23
|
# 21.05.24
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# 10.12.23
|
# 21.05.24
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
import queue
|
import queue
|
||||||
|
|
||||||
|
|
||||||
# External libraries
|
# External libraries
|
||||||
import httpx
|
import httpx
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
@ -123,7 +124,13 @@ def title_search(query: str) -> int:
|
|||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.post(search_url, headers={'user-agent': get_userAgent()}, json=json_data, timeout=max_timeout, follow_redirects=True)
|
response = httpx.post(
|
||||||
|
search_url,
|
||||||
|
headers={'user-agent': get_userAgent()},
|
||||||
|
json=json_data,
|
||||||
|
timeout=max_timeout,
|
||||||
|
follow_redirects=True
|
||||||
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# 01.03.24
|
# 21.05.24
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -26,8 +26,7 @@ from .series import download_series
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 0
|
indice = 0
|
||||||
_useFor = "film_serie"
|
_useFor = "film_serie"
|
||||||
_deprecate = False
|
_priority = 0
|
||||||
_priority = 1
|
|
||||||
_engineDownload = "hls"
|
_engineDownload = "hls"
|
||||||
|
|
||||||
msg = Prompt()
|
msg = Prompt()
|
||||||
|
@ -45,7 +45,13 @@ def title_search(query: str) -> int:
|
|||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
response = httpx.get(
|
||||||
|
search_url,
|
||||||
|
headers={'user-agent': get_userAgent()},
|
||||||
|
timeout=max_timeout,
|
||||||
|
follow_redirects=True,
|
||||||
|
verify=False
|
||||||
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -23,7 +23,7 @@ from rich.console import Console
|
|||||||
# Internal utilities
|
# Internal utilities
|
||||||
from StreamingCommunity.Util.color import Colors
|
from StreamingCommunity.Util.color import Colors
|
||||||
from StreamingCommunity.Util.headers import get_userAgent
|
from StreamingCommunity.Util.headers import get_userAgent
|
||||||
from StreamingCommunity.Util.config_json import config_manager, get_use_large_bar
|
from StreamingCommunity.Util.config_json import config_manager
|
||||||
|
|
||||||
|
|
||||||
# Logic class
|
# Logic class
|
||||||
@ -407,20 +407,12 @@ class M3U8_Segments:
|
|||||||
"""
|
"""
|
||||||
Generate platform-appropriate progress bar format.
|
Generate platform-appropriate progress bar format.
|
||||||
"""
|
"""
|
||||||
if not get_use_large_bar():
|
return (
|
||||||
return (
|
f"{Colors.YELLOW}[HLS] {Colors.WHITE}({Colors.CYAN}{description}{Colors.WHITE}): "
|
||||||
f"{Colors.YELLOW}Proc{Colors.WHITE}: "
|
f"{Colors.RED}{{percentage:.2f}}% "
|
||||||
f"{Colors.RED}{{percentage:.2f}}% "
|
f"{Colors.MAGENTA}{{bar}} "
|
||||||
f"{Colors.CYAN}{{remaining}}{{postfix}} {Colors.WHITE}]"
|
f"{Colors.YELLOW}{{elapsed}}{Colors.WHITE} < {Colors.CYAN}{{remaining}}{Colors.WHITE}{{postfix}}{Colors.WHITE}"
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
|
||||||
return (
|
|
||||||
f"{Colors.YELLOW}[HLS] {Colors.WHITE}({Colors.CYAN}{description}{Colors.WHITE}): "
|
|
||||||
f"{Colors.RED}{{percentage:.2f}}% "
|
|
||||||
f"{Colors.MAGENTA}{{bar}} "
|
|
||||||
f"{Colors.YELLOW}{{elapsed}}{Colors.WHITE} < {Colors.CYAN}{{remaining}}{Colors.WHITE}{{postfix}}{Colors.WHITE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
def _get_worker_count(self, stream_type: str) -> int:
|
def _get_worker_count(self, stream_type: str) -> int:
|
||||||
"""
|
"""
|
||||||
|
@ -18,7 +18,7 @@ import qbittorrentapi
|
|||||||
# Internal utilities
|
# Internal utilities
|
||||||
from StreamingCommunity.Util.color import Colors
|
from StreamingCommunity.Util.color import Colors
|
||||||
from StreamingCommunity.Util.os import internet_manager
|
from StreamingCommunity.Util.os import internet_manager
|
||||||
from StreamingCommunity.Util.config_json import config_manager, get_use_large_bar
|
from StreamingCommunity.Util.config_json import config_manager
|
||||||
|
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
@ -316,19 +316,12 @@ class TOR_downloader:
|
|||||||
# Ensure the torrent is started
|
# Ensure the torrent is started
|
||||||
self.qb.torrents_resume(torrent_hashes=self.latest_torrent_hash)
|
self.qb.torrents_resume(torrent_hashes=self.latest_torrent_hash)
|
||||||
|
|
||||||
# Configure progress bar display format based on device
|
# Configure progress bar display format
|
||||||
if get_use_large_bar():
|
bar_format = (
|
||||||
bar_format = (
|
f"{Colors.YELLOW}[TOR] {Colors.WHITE}({Colors.CYAN}video{Colors.WHITE}): "
|
||||||
f"{Colors.YELLOW}[TOR] {Colors.WHITE}({Colors.CYAN}video{Colors.WHITE}): "
|
f"{Colors.RED}{{percentage:.2f}}% {Colors.MAGENTA}{{bar}} {Colors.WHITE}[ "
|
||||||
f"{Colors.RED}{{percentage:.2f}}% {Colors.MAGENTA}{{bar}} {Colors.WHITE}[ "
|
f"{Colors.YELLOW}{{elapsed}} {Colors.WHITE}< {Colors.CYAN}{{remaining}}{{postfix}} {Colors.WHITE}]"
|
||||||
f"{Colors.YELLOW}{{elapsed}} {Colors.WHITE}< {Colors.CYAN}{{remaining}}{{postfix}} {Colors.WHITE}]"
|
)
|
||||||
)
|
|
||||||
else:
|
|
||||||
bar_format = (
|
|
||||||
f"{Colors.YELLOW}Proc{Colors.WHITE}: "
|
|
||||||
f"{Colors.RED}{{percentage:.2f}}% {Colors.WHITE}| "
|
|
||||||
f"{Colors.CYAN}{{remaining}}{{postfix}} {Colors.WHITE}]"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Initialize progress bar
|
# Initialize progress bar
|
||||||
with tqdm(
|
with tqdm(
|
||||||
|
@ -36,11 +36,7 @@ def capture_output(process: subprocess.Popen, description: str) -> None:
|
|||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logging.info(f"FFMPEG line: {line}")
|
logging.info(f"CAPTURE ffmpeg line: {line}")
|
||||||
|
|
||||||
# Capture only error
|
|
||||||
if "rror" in str(line):
|
|
||||||
console.log(f"[red]FFMPEG: {str(line).strip()}")
|
|
||||||
|
|
||||||
# Check if termination is requested
|
# Check if termination is requested
|
||||||
if terminate_flag.is_set():
|
if terminate_flag.is_set():
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# 21.04.25
|
# 21.04.25
|
||||||
|
|
||||||
import sys
|
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
@ -14,7 +13,6 @@ from tqdm import tqdm
|
|||||||
|
|
||||||
# Internal utilities
|
# Internal utilities
|
||||||
from StreamingCommunity.Util.color import Colors
|
from StreamingCommunity.Util.color import Colors
|
||||||
from StreamingCommunity.Util.config_json import get_use_large_bar
|
|
||||||
from StreamingCommunity.Util.os import internet_manager
|
from StreamingCommunity.Util.os import internet_manager
|
||||||
|
|
||||||
|
|
||||||
@ -32,14 +30,10 @@ class M3U8_Ts_Estimator:
|
|||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.speed = {"upload": "N/A", "download": "N/A"}
|
self.speed = {"upload": "N/A", "download": "N/A"}
|
||||||
self._running = True
|
self._running = True
|
||||||
|
|
||||||
if get_use_large_bar():
|
self.speed_thread = threading.Thread(target=self.capture_speed)
|
||||||
logging.debug("USE_LARGE_BAR is True, starting speed capture thread")
|
self.speed_thread.daemon = True
|
||||||
self.speed_thread = threading.Thread(target=self.capture_speed)
|
self.speed_thread.start()
|
||||||
self.speed_thread.daemon = True
|
|
||||||
self.speed_thread.start()
|
|
||||||
else:
|
|
||||||
logging.debug("USE_LARGE_BAR is False, speed capture thread not started")
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
"""Ensure thread is properly stopped when the object is destroyed."""
|
"""Ensure thread is properly stopped when the object is destroyed."""
|
||||||
@ -133,29 +127,22 @@ class M3U8_Ts_Estimator:
|
|||||||
with self.segments_instance.active_retries_lock:
|
with self.segments_instance.active_retries_lock:
|
||||||
retry_count = self.segments_instance.active_retries
|
retry_count = self.segments_instance.active_retries
|
||||||
|
|
||||||
if get_use_large_bar():
|
# Get speed data outside of any locks
|
||||||
# Get speed data outside of any locks
|
speed_data = ["N/A", ""]
|
||||||
speed_data = ["N/A", ""]
|
with self.lock:
|
||||||
with self.lock:
|
download_speed = self.speed['download']
|
||||||
download_speed = self.speed['download']
|
|
||||||
|
if download_speed != "N/A":
|
||||||
if download_speed != "N/A":
|
speed_data = download_speed.split(" ")
|
||||||
speed_data = download_speed.split(" ")
|
|
||||||
|
average_internet_speed = speed_data[0] if len(speed_data) >= 1 else "N/A"
|
||||||
average_internet_speed = speed_data[0] if len(speed_data) >= 1 else "N/A"
|
average_internet_unit = speed_data[1] if len(speed_data) >= 2 else ""
|
||||||
average_internet_unit = speed_data[1] if len(speed_data) >= 2 else ""
|
|
||||||
|
progress_str = (
|
||||||
progress_str = (
|
f"{Colors.GREEN}{number_file_total_size} {Colors.RED}{units_file_total_size}"
|
||||||
f"{Colors.GREEN}{number_file_total_size} {Colors.RED}{units_file_total_size}"
|
f"{Colors.WHITE}, {Colors.CYAN}{average_internet_speed} {Colors.RED}{average_internet_unit} "
|
||||||
f"{Colors.WHITE}, {Colors.CYAN}{average_internet_speed} {Colors.RED}{average_internet_unit} "
|
#f"{Colors.WHITE}, {Colors.GREEN}CRR {Colors.RED}{retry_count} "
|
||||||
#f"{Colors.WHITE}, {Colors.GREEN}CRR {Colors.RED}{retry_count} "
|
)
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
|
||||||
progress_str = (
|
|
||||||
f"{Colors.GREEN}{number_file_total_size} {Colors.RED}{units_file_total_size} "
|
|
||||||
#f"{Colors.WHITE}, {Colors.GREEN}CRR {Colors.RED}{retry_count} "
|
|
||||||
)
|
|
||||||
|
|
||||||
progress_counter.set_postfix_str(progress_str)
|
progress_counter.set_postfix_str(progress_str)
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import io
|
|||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
import shutil
|
import shutil
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
@ -13,11 +12,9 @@ import inspect
|
|||||||
import subprocess
|
import subprocess
|
||||||
import contextlib
|
import contextlib
|
||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
# External library
|
# External library
|
||||||
import httpx
|
|
||||||
from unidecode import unidecode
|
from unidecode import unidecode
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
from rich.prompt import Prompt
|
from rich.prompt import Prompt
|
||||||
@ -357,12 +354,15 @@ class OsSummary:
|
|||||||
Exits with a message if not the official version.
|
Exits with a message if not the official version.
|
||||||
"""
|
"""
|
||||||
python_implementation = platform.python_implementation()
|
python_implementation = platform.python_implementation()
|
||||||
|
python_version = platform.python_version()
|
||||||
|
|
||||||
if python_implementation != "CPython":
|
if python_implementation != "CPython":
|
||||||
console.print(f"[bold red]Warning: You are using a non-official Python distribution: {python_implementation}.[/bold red]")
|
console.print(f"[bold red]Warning: You are using a non-official Python distribution: {python_implementation}.[/bold red]")
|
||||||
console.print("Please install the official Python from [bold blue]https://www.python.org[/bold blue] and try again.", style="bold yellow")
|
console.print("Please install the official Python from [bold blue]https://www.python.org[/bold blue] and try again.", style="bold yellow")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
console.print(f"[cyan]Python version: [bold red]{python_version}[/bold red]")
|
||||||
|
|
||||||
def get_system_summary(self):
|
def get_system_summary(self):
|
||||||
self.check_python_version()
|
self.check_python_version()
|
||||||
|
|
||||||
|
@ -57,11 +57,8 @@ def load_search_functions():
|
|||||||
|
|
||||||
# Get 'indice' from the module
|
# Get 'indice' from the module
|
||||||
indice = getattr(mod, 'indice', 0)
|
indice = getattr(mod, 'indice', 0)
|
||||||
is_deprecate = bool(getattr(mod, '_deprecate', True))
|
|
||||||
use_for = getattr(mod, '_useFor', 'other')
|
use_for = getattr(mod, '_useFor', 'other')
|
||||||
|
modules.append((module_name, indice, use_for))
|
||||||
if not is_deprecate:
|
|
||||||
modules.append((module_name, indice, use_for))
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
console.print(f"[red]Failed to import module {module_name}: {str(e)}")
|
console.print(f"[red]Failed to import module {module_name}: {str(e)}")
|
||||||
|
@ -90,11 +90,8 @@ def load_search_functions():
|
|||||||
|
|
||||||
# Get 'indice' from the module
|
# Get 'indice' from the module
|
||||||
indice = getattr(mod, 'indice', 0)
|
indice = getattr(mod, 'indice', 0)
|
||||||
is_deprecate = bool(getattr(mod, '_deprecate', True))
|
|
||||||
use_for = getattr(mod, '_useFor', 'other')
|
use_for = getattr(mod, '_useFor', 'other')
|
||||||
|
modules.append((module_name, indice, use_for))
|
||||||
if not is_deprecate:
|
|
||||||
modules.append((module_name, indice, use_for))
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
console.print(f"[red]Failed to import module {module_name}: {str(e)}")
|
console.print(f"[red]Failed to import module {module_name}: {str(e)}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user