mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 12:05:35 +00:00
Fix bug for pyinstaller
This commit is contained in:
parent
bc94b86fc3
commit
6d06a3421f
@ -9,7 +9,7 @@ from fake_useragent import UserAgent
|
|||||||
|
|
||||||
|
|
||||||
# Variable
|
# Variable
|
||||||
ua = UserAgent()
|
ua = UserAgent(use_external_data=True)
|
||||||
|
|
||||||
|
|
||||||
def extract_versions(user_agent):
|
def extract_versions(user_agent):
|
||||||
|
@ -441,35 +441,36 @@ class OsSummary():
|
|||||||
console.print(f"[cyan]Path[white]: [red]ffmpeg [bold yellow]'{ffmpeg_path}'[/bold yellow][white], [red]ffprobe '[bold yellow]{ffprobe_path}'[/bold yellow]")
|
console.print(f"[cyan]Path[white]: [red]ffmpeg [bold yellow]'{ffmpeg_path}'[/bold yellow][white], [red]ffprobe '[bold yellow]{ffprobe_path}'[/bold yellow]")
|
||||||
console.print(f"[cyan]Exe versions[white]: [bold red]ffmpeg {ffmpeg_version}, ffprobe {ffprobe_version}[/bold red]")
|
console.print(f"[cyan]Exe versions[white]: [bold red]ffmpeg {ffmpeg_version}, ffprobe {ffprobe_version}[/bold red]")
|
||||||
|
|
||||||
# Check if requirements.txt exists, if not download it
|
# Check if requirements.txt exists, if not on pyinstaller
|
||||||
requirements_file = 'requirements.txt'
|
if not getattr(sys, 'frozen', False):
|
||||||
if not os.path.exists(requirements_file):
|
requirements_file = 'requirements.txt'
|
||||||
await self.download_requirements(
|
if not os.path.exists(requirements_file):
|
||||||
'https://raw.githubusercontent.com/Lovi-0/StreamingCommunity/refs/heads/main/requirements.txt',
|
await self.download_requirements(
|
||||||
requirements_file
|
'https://raw.githubusercontent.com/Lovi-0/StreamingCommunity/refs/heads/main/requirements.txt',
|
||||||
)
|
requirements_file
|
||||||
|
)
|
||||||
|
|
||||||
# Read the optional libraries from the requirements file
|
# Read the optional libraries from the requirements file
|
||||||
optional_libraries = [line.strip() for line in open(requirements_file, 'r', encoding='utf-8-sig')]
|
optional_libraries = [line.strip() for line in open(requirements_file, 'r', encoding='utf-8-sig')]
|
||||||
|
|
||||||
# Check if libraries are installed and prompt to install missing ones
|
# Check if libraries are installed and prompt to install missing ones
|
||||||
for lib in optional_libraries:
|
for lib in optional_libraries:
|
||||||
installed_version = self.get_library_version(lib)
|
installed_version = self.get_library_version(lib)
|
||||||
|
|
||||||
if 'not installed' in installed_version:
|
if 'not installed' in installed_version:
|
||||||
|
|
||||||
# Prompt user to install missing library using Prompt.ask()
|
# Prompt user to install missing library using Prompt.ask()
|
||||||
user_response = msg.ask(f"{lib} is not installed. Do you want to install it? (yes/no)", default="y")
|
user_response = msg.ask(f"{lib} is not installed. Do you want to install it? (yes/no)", default="y")
|
||||||
|
|
||||||
if user_response.lower().strip() in ["yes", "y"]:
|
if user_response.lower().strip() in ["yes", "y"]:
|
||||||
self.install_library(lib)
|
self.install_library(lib)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
#console.print(f"[cyan]Library[white]: [bold red]{installed_version}[/bold red]")
|
#console.print(f"[cyan]Library[white]: [bold red]{installed_version}[/bold red]")
|
||||||
logging.info(f"Library: {installed_version}")
|
logging.info(f"Library: {installed_version}")
|
||||||
|
|
||||||
console.print(f"[cyan]Libraries[white]: [bold red]{', '.join([self.get_library_version(lib) for lib in optional_libraries])}[/bold red]\n")
|
console.print(f"[cyan]Libraries[white]: [bold red]{', '.join([self.get_library_version(lib) for lib in optional_libraries])}[/bold red]\n")
|
||||||
logging.info(f"Libraries: {', '.join([self.get_library_version(lib) for lib in optional_libraries])}")
|
logging.info(f"Libraries: {', '.join([self.get_library_version(lib) for lib in optional_libraries])}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ psutil
|
|||||||
unidecode
|
unidecode
|
||||||
jsbeautifier
|
jsbeautifier
|
||||||
pathvalidate
|
pathvalidate
|
||||||
fake-useragent
|
fake-useragent=1.1.3
|
||||||
qbittorrent-api
|
qbittorrent-api
|
||||||
python-qbittorrent
|
python-qbittorrent
|
||||||
googlesearch-python
|
googlesearch-python
|
Loading…
x
Reference in New Issue
Block a user