* Fix telegram bot (issues #305 bug) (#316)

* fix create config.json

* fix messagge telegram_bot option 0 (Streamingcommunity)

* Update README.md

* Update domain

---------

Co-authored-by: GiuPic <47813665+GiuPic@users.noreply.github.com>
This commit is contained in:
None 2025-05-14 09:34:30 +02:00 committed by GitHub
parent e75d8185f9
commit 8e323e83f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 29 additions and 10 deletions

View File

@ -35,7 +35,7 @@
<summary>📦 Installation</summary>
- 🔄 [Update Domains](#update-domains)
- 🌐 [Available Sites](https://arrowar.github.io/StreamingDirectory/)
- 🌐 [Available Sites](https://arrowar.github.io/StreamingCommunity/)
- 🛠️ [Installation](#installation)
- 📦 [PyPI Installation](#1-pypi-installation)
- 🔄 [Automatic Installation](#2-automatic-installation)

View File

@ -97,7 +97,21 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
return
if string_to_search is None:
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
if site_constant.TELEGRAM_BOT:
bot = get_bot_instance()
string_to_search = bot.ask(
"key_search",
f"Enter the search term\nor type 'back' to return to the menu: ",
None
)
if string_to_search == 'back':
# Restart the script
subprocess.Popen([sys.executable] + sys.argv)
sys.exit()
else:
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
# Search on database
len_database = title_search(string_to_search)

View File

@ -55,7 +55,7 @@ def download_film(select_title: MediaItem) -> str:
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
# Init class
video_source = VideoSource(site_constant.FULL_URL, False, select_title.id)
video_source = VideoSource(f"{site_constant.FULL_URL}/it", False, select_title.id)
# Retrieve scws and if available master playlist
video_source.get_iframe(select_title.id)

View File

@ -154,8 +154,8 @@ def download_series(select_season: MediaItem, season_selection: str = None, epis
start_message()
# Init class
video_source = VideoSource(site_constant.FULL_URL, True, select_season.id)
scrape_serie = GetSerieInfo(site_constant.FULL_URL, select_season.id, select_season.slug)
video_source = VideoSource(f"{site_constant.FULL_URL}/it", True, select_season.id)
scrape_serie = GetSerieInfo(f"{site_constant.FULL_URL}/it", select_season.id, select_season.slug)
# Collect information about season
scrape_serie.getNumberSeason()

View File

@ -46,7 +46,7 @@ def title_search(query: str) -> int:
try:
response = httpx.get(
site_constant.FULL_URL,
f"{site_constant.FULL_URL}/it",
headers={'user-agent': get_userAgent()},
timeout=max_timeout
)
@ -59,7 +59,7 @@ def title_search(query: str) -> int:
console.print(f"[red]Site: {site_constant.SITE_NAME} version, request error: {e}")
return 0
search_url = f"{site_constant.FULL_URL}/search?q={query}"
search_url = f"{site_constant.FULL_URL}/it/search?q={query}"
console.print(f"[cyan]Search url: [yellow]{search_url}")
try:

View File

@ -36,8 +36,13 @@ class ConfigManager:
base_path = os.path.dirname(sys.executable)
else:
# Use the current directory where the script is executed
base_path = os.getcwd()
# Get the actual path of the module file
current_file_path = os.path.abspath(__file__)
# Navigate upwards to find the project root
# Assuming this file is in a package structure like StreamingCommunity/Util/config_json.py
# We need to go up 2 levels to reach the project root
base_path = os.path.dirname(os.path.dirname(os.path.dirname(current_file_path)))
# Initialize file paths
self.file_path = os.path.join(base_path, file_name)