mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 03:55:24 +00:00
Dev (#318)
* 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:
parent
e75d8185f9
commit
8e323e83f9
@ -35,7 +35,7 @@
|
|||||||
<summary>📦 Installation</summary>
|
<summary>📦 Installation</summary>
|
||||||
|
|
||||||
- 🔄 [Update Domains](#update-domains)
|
- 🔄 [Update Domains](#update-domains)
|
||||||
- 🌐 [Available Sites](https://arrowar.github.io/StreamingDirectory/)
|
- 🌐 [Available Sites](https://arrowar.github.io/StreamingCommunity/)
|
||||||
- 🛠️ [Installation](#installation)
|
- 🛠️ [Installation](#installation)
|
||||||
- 📦 [PyPI Installation](#1-pypi-installation)
|
- 📦 [PyPI Installation](#1-pypi-installation)
|
||||||
- 🔄 [Automatic Installation](#2-automatic-installation)
|
- 🔄 [Automatic Installation](#2-automatic-installation)
|
||||||
|
@ -97,7 +97,21 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
|
|||||||
return
|
return
|
||||||
|
|
||||||
if string_to_search is None:
|
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
|
# Search on database
|
||||||
len_database = title_search(string_to_search)
|
len_database = title_search(string_to_search)
|
||||||
|
@ -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")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
|
||||||
|
|
||||||
# Init class
|
# 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
|
# Retrieve scws and if available master playlist
|
||||||
video_source.get_iframe(select_title.id)
|
video_source.get_iframe(select_title.id)
|
||||||
|
@ -154,8 +154,8 @@ def download_series(select_season: MediaItem, season_selection: str = None, epis
|
|||||||
start_message()
|
start_message()
|
||||||
|
|
||||||
# Init class
|
# Init class
|
||||||
video_source = VideoSource(site_constant.FULL_URL, True, select_season.id)
|
video_source = VideoSource(f"{site_constant.FULL_URL}/it", True, select_season.id)
|
||||||
scrape_serie = GetSerieInfo(site_constant.FULL_URL, select_season.id, select_season.slug)
|
scrape_serie = GetSerieInfo(f"{site_constant.FULL_URL}/it", select_season.id, select_season.slug)
|
||||||
|
|
||||||
# Collect information about season
|
# Collect information about season
|
||||||
scrape_serie.getNumberSeason()
|
scrape_serie.getNumberSeason()
|
||||||
|
@ -46,7 +46,7 @@ def title_search(query: str) -> int:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
response = httpx.get(
|
response = httpx.get(
|
||||||
site_constant.FULL_URL,
|
f"{site_constant.FULL_URL}/it",
|
||||||
headers={'user-agent': get_userAgent()},
|
headers={'user-agent': get_userAgent()},
|
||||||
timeout=max_timeout
|
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}")
|
console.print(f"[red]Site: {site_constant.SITE_NAME} version, request error: {e}")
|
||||||
return 0
|
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}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -36,8 +36,13 @@ class ConfigManager:
|
|||||||
base_path = os.path.dirname(sys.executable)
|
base_path = os.path.dirname(sys.executable)
|
||||||
|
|
||||||
else:
|
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
|
# Initialize file paths
|
||||||
self.file_path = os.path.join(base_path, file_name)
|
self.file_path = os.path.join(base_path, file_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user