mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
Bump v2.9.6
This commit is contained in:
parent
d0bdd8c6a3
commit
e864855dd5
@ -26,12 +26,12 @@ table_show_manager = TVShowManager()
|
|||||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||||
|
|
||||||
|
|
||||||
def title_search(word_to_search: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Search for titles based on a search query.
|
Search for titles based on a search query.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
- int: The number of titles found.
|
- int: The number of titles found.
|
||||||
@ -39,7 +39,7 @@ def title_search(word_to_search: str) -> int:
|
|||||||
media_search_manager.clear()
|
media_search_manager.clear()
|
||||||
table_show_manager.clear()
|
table_show_manager.clear()
|
||||||
|
|
||||||
search_url = f"{site_constant.FULL_URL}/search/{word_to_search}/1/"
|
search_url = f"{site_constant.FULL_URL}/search/{query}/1/"
|
||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -33,9 +33,8 @@ def download_title(select_title: MediaItem):
|
|||||||
- select_title (MediaItem): The media item to be downloaded. This should be an instance of the MediaItem class, containing attributes like `name` and `url`.
|
- select_title (MediaItem): The media item to be downloaded. This should be an instance of the MediaItem class, containing attributes like `name` and `url`.
|
||||||
"""
|
"""
|
||||||
start_message()
|
start_message()
|
||||||
console.print(f"[yellow]Download: [red]{select_title.name} \n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
|
||||||
print()
|
|
||||||
|
|
||||||
# Define output path
|
# Define output path
|
||||||
title_name = os_manager.get_sanitize_file(select_title.name)
|
title_name = os_manager.get_sanitize_file(select_title.name)
|
||||||
mp4_path = os.path.join(site_constant.MOVIE_FOLDER, title_name.replace(".mp4", ""))
|
mp4_path = os.path.join(site_constant.MOVIE_FOLDER, title_name.replace(".mp4", ""))
|
||||||
|
@ -56,7 +56,7 @@ def download_film(select_title: MediaItem) -> str:
|
|||||||
TelegramSession.updateScriptId(script_id, select_title.name)
|
TelegramSession.updateScriptId(script_id, select_title.name)
|
||||||
|
|
||||||
start_message()
|
start_message()
|
||||||
console.print(f"[yellow]Download: [red]{select_title.name} \n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
|
||||||
|
|
||||||
# Extract mostraguarda link
|
# Extract mostraguarda link
|
||||||
try:
|
try:
|
||||||
|
@ -55,8 +55,7 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
|
|||||||
|
|
||||||
# Get info about episode
|
# Get info about episode
|
||||||
obj_episode = scrape_serie.seasons_manager.get_season_by_number(int(index_season_selected)).episodes.get(index_episode_selected-1)
|
obj_episode = scrape_serie.seasons_manager.get_season_by_number(int(index_season_selected)).episodes.get(index_episode_selected-1)
|
||||||
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.name}")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [bold magenta]{obj_episode.name}[/bold magenta] ([cyan]S{index_season_selected}E{index_episode_selected}[/cyan]) \n")
|
||||||
print()
|
|
||||||
|
|
||||||
if site_constant.TELEGRAM_BOT:
|
if site_constant.TELEGRAM_BOT:
|
||||||
bot = get_bot_instance()
|
bot = get_bot_instance()
|
||||||
|
@ -26,12 +26,12 @@ table_show_manager = TVShowManager()
|
|||||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||||
|
|
||||||
|
|
||||||
def title_search(title_search: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Search for titles based on a search query.
|
Search for titles based on a search query.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
int: The number of titles found.
|
int: The number of titles found.
|
||||||
@ -42,7 +42,7 @@ def title_search(title_search: str) -> int:
|
|||||||
media_search_manager.clear()
|
media_search_manager.clear()
|
||||||
table_show_manager.clear()
|
table_show_manager.clear()
|
||||||
|
|
||||||
search_url = f"{site_constant.FULL_URL}/?story={title_search}&do=search&subaction=search"
|
search_url = f"{site_constant.FULL_URL}/?story={query}&do=search&subaction=search"
|
||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -55,8 +55,7 @@ def download_episode(index_select: int, scrape_serie: ScrapeSerieAnime, video_so
|
|||||||
if obj_episode is not None:
|
if obj_episode is not None:
|
||||||
|
|
||||||
start_message()
|
start_message()
|
||||||
console.print(f"[yellow]Download: [red]EP_{obj_episode.number} \n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] ([cyan]E{obj_episode.number}[/cyan]) \n")
|
||||||
console.print("[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
|
|
||||||
|
|
||||||
if site_constant.TELEGRAM_BOT:
|
if site_constant.TELEGRAM_BOT:
|
||||||
bot.send_message(f"Download in corso:\nTitolo:{scrape_serie.series_name}\nEpisodio: {obj_episode.number}", None)
|
bot.send_message(f"Download in corso:\nTitolo:{scrape_serie.series_name}\nEpisodio: {obj_episode.number}", None)
|
||||||
@ -70,7 +69,7 @@ def download_episode(index_select: int, scrape_serie: ScrapeSerieAnime, video_so
|
|||||||
video_source.get_embed(obj_episode.id)
|
video_source.get_embed(obj_episode.id)
|
||||||
|
|
||||||
# Create output path
|
# Create output path
|
||||||
title_name = f"{scrape_serie.series_name}_EP_{dynamic_format_number(str(obj_episode.number))}.mp4"
|
mp4_name = f"{scrape_serie.series_name}_EP_{dynamic_format_number(str(obj_episode.number))}.mp4"
|
||||||
|
|
||||||
if scrape_serie.is_series:
|
if scrape_serie.is_series:
|
||||||
mp4_path = os_manager.get_sanitize_path(os.path.join(site_constant.ANIME_FOLDER, scrape_serie.series_name))
|
mp4_path = os_manager.get_sanitize_path(os.path.join(site_constant.ANIME_FOLDER, scrape_serie.series_name))
|
||||||
@ -84,7 +83,7 @@ def download_episode(index_select: int, scrape_serie: ScrapeSerieAnime, video_so
|
|||||||
# Start downloading
|
# Start downloading
|
||||||
path, kill_handler = MP4_downloader(
|
path, kill_handler = MP4_downloader(
|
||||||
url=str(video_source.src_mp4).strip(),
|
url=str(video_source.src_mp4).strip(),
|
||||||
path=os.path.join(mp4_path, title_name)
|
path=os.path.join(mp4_path, mp4_name)
|
||||||
)
|
)
|
||||||
|
|
||||||
return path, kill_handler
|
return path, kill_handler
|
||||||
|
@ -83,12 +83,12 @@ def get_real_title(record):
|
|||||||
return record['title_it']
|
return record['title_it']
|
||||||
|
|
||||||
|
|
||||||
def title_search(title: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Function to perform an anime search using a provided title.
|
Function to perform an anime search using a provided query.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
- int: A number containing the length of media search manager.
|
- int: A number containing the length of media search manager.
|
||||||
@ -106,7 +106,7 @@ def title_search(title: str) -> int:
|
|||||||
'user-agent': get_userAgent(),
|
'user-agent': get_userAgent(),
|
||||||
'x-csrf-token': data.get('csrf_token')
|
'x-csrf-token': data.get('csrf_token')
|
||||||
}
|
}
|
||||||
json_data = {'title': title}
|
json_data = {'title': query}
|
||||||
|
|
||||||
# Send a POST request to the API endpoint for live search
|
# Send a POST request to the API endpoint for live search
|
||||||
try:
|
try:
|
||||||
|
@ -19,7 +19,7 @@ from .serie import download_series
|
|||||||
# Variable
|
# Variable
|
||||||
indice = 8
|
indice = 8
|
||||||
_useFor = "anime"
|
_useFor = "anime"
|
||||||
_deprecate = True
|
_deprecate = False
|
||||||
_priority = 2
|
_priority = 2
|
||||||
_engineDownload = "mp4"
|
_engineDownload = "mp4"
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ from StreamingCommunity.Lib.Downloader import MP4_downloader
|
|||||||
# Logic class
|
# Logic class
|
||||||
from .util.ScrapeSerie import ScrapSerie
|
from .util.ScrapeSerie import ScrapSerie
|
||||||
from StreamingCommunity.Api.Template.config_loader import site_constant
|
from StreamingCommunity.Api.Template.config_loader import site_constant
|
||||||
from StreamingCommunity.Api.Template.Util import manage_selection, dynamic_format_number
|
from StreamingCommunity.Api.Template.Util import manage_selection, dynamic_format_number, map_episode_title
|
||||||
from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
||||||
|
|
||||||
|
|
||||||
@ -48,12 +48,11 @@ def download_episode(index_select: int, scrape_serie: ScrapSerie, episodes) -> T
|
|||||||
start_message()
|
start_message()
|
||||||
|
|
||||||
# Get information about the selected episode
|
# Get information about the selected episode
|
||||||
console.print(f"[yellow]Download: [red]EP_{index_select} \n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] ([cyan]E{index_select+1}[/cyan]) \n")
|
||||||
console.print("[cyan]You can safely stop the download with [bold]Ctrl+c[bold] [cyan] \n")
|
|
||||||
|
|
||||||
# Create output path
|
# Define filename and path for the downloaded video
|
||||||
title_name = f"{scrape_serie.get_name()}_EP_{dynamic_format_number(str(index_select))}.mp4"
|
mp4_name = f"{scrape_serie.get_name()}_EP_{dynamic_format_number(str(index_select+1))}.mp4"
|
||||||
mp4_path = os_manager.get_sanitize_path(os.path.join(site_constant.ANIME_FOLDER, scrape_serie.get_name()))
|
mp4_path = os.path.join(site_constant.ANIME_FOLDER, scrape_serie.get_name())
|
||||||
|
|
||||||
# Create output folder
|
# Create output folder
|
||||||
os_manager.create_path(mp4_path)
|
os_manager.create_path(mp4_path)
|
||||||
@ -65,7 +64,7 @@ def download_episode(index_select: int, scrape_serie: ScrapSerie, episodes) -> T
|
|||||||
# Start downloading
|
# Start downloading
|
||||||
path, kill_handler = MP4_downloader(
|
path, kill_handler = MP4_downloader(
|
||||||
url=str(mp4_link).strip(),
|
url=str(mp4_link).strip(),
|
||||||
path=os.path.join(mp4_path, title_name)
|
path=os.path.join(mp4_path, mp4_name)
|
||||||
)
|
)
|
||||||
|
|
||||||
return path, kill_handler
|
return path, kill_handler
|
||||||
|
@ -55,45 +55,54 @@ def get_session_and_csrf() -> dict:
|
|||||||
logging.info(f"CSRF Token: {csrf_token}")
|
logging.info(f"CSRF Token: {csrf_token}")
|
||||||
return session_id, csrf_token
|
return session_id, csrf_token
|
||||||
|
|
||||||
def title_search(title: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Function to perform an anime search using a provided title.
|
Function to perform an anime search using a provided title.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
- int: A number containing the length of media search manager.
|
- int: A number containing the length of media search manager.
|
||||||
"""
|
"""
|
||||||
session_id, csrf_token = get_session_and_csrf()
|
search_url = f"{site_constant.FULL_URL}/search?keyword={query}"
|
||||||
url = f"{site_constant.FULL_URL}/api/search/v2"
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
# Set up the headers, params for the request
|
# Make the GET request
|
||||||
headers = {
|
try:
|
||||||
'User-Agent': get_userAgent(),
|
response = httpx.get(search_url, headers={'User-Agent': get_userAgent()})
|
||||||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
|
||||||
'CSRF-Token': csrf_token,
|
|
||||||
'X-Requested-With': 'XMLHttpRequest'
|
|
||||||
}
|
|
||||||
params = {
|
|
||||||
'keyword': title,
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make the POST request
|
except Exception as e:
|
||||||
response = httpx.post(url, params=params, cookies={'sessionId': session_id}, headers=headers)
|
console.print(f"Site: {site_constant.SITE_NAME}, request search error: {e}")
|
||||||
|
return 0
|
||||||
for dict_title in response.json()['animes']:
|
|
||||||
|
# Create soup istance
|
||||||
|
soup = BeautifulSoup(response.text, 'html.parser')
|
||||||
|
|
||||||
|
# Collect data from soup
|
||||||
|
for element in soup.find_all('a', class_='poster'):
|
||||||
try:
|
try:
|
||||||
|
title = element.find('img').get('alt')
|
||||||
|
url = f"{site_constant.FULL_URL}{element.get('href')}"
|
||||||
|
status_div = element.find('div', class_='status')
|
||||||
|
is_dubbed = False
|
||||||
|
anime_type = 'TV'
|
||||||
|
|
||||||
media_search_manager.add_media({
|
if status_div:
|
||||||
'id': dict_title.get('id'),
|
if status_div.find('div', class_='dub'):
|
||||||
'name': dict_title.get('name'),
|
is_dubbed = True
|
||||||
'type': 'TV',
|
|
||||||
'status': dict_title.get('stateName'),
|
if status_div.find('div', class_='movie'):
|
||||||
'episodes_count': dict_title.get('episodes'),
|
anime_type = 'Movie'
|
||||||
'plot': ' '.join((words := str(dict_title.get('story', '')).split())[:10]) + ('...' if len(words) > 10 else ''),
|
elif status_div.find('div', class_='ona'):
|
||||||
'url': f"{site_constant.FULL_URL}/play/{dict_title.get('link')}.{dict_title.get('identifier')}"
|
anime_type = 'ONA'
|
||||||
})
|
|
||||||
|
media_search_manager.add_media({
|
||||||
|
'name': title,
|
||||||
|
'type': anime_type,
|
||||||
|
'DUB': is_dubbed,
|
||||||
|
'url': url
|
||||||
|
})
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error parsing a film entry: {e}")
|
print(f"Error parsing a film entry: {e}")
|
||||||
|
@ -5,9 +5,11 @@
|
|||||||
import httpx
|
import httpx
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
|
||||||
# Internal utilities
|
# Internal utilities
|
||||||
from StreamingCommunity.Util.headers import get_userAgent
|
from StreamingCommunity.Util.headers import get_userAgent
|
||||||
from StreamingCommunity.Util.config_json import config_manager
|
from StreamingCommunity.Util.config_json import config_manager
|
||||||
|
from StreamingCommunity.Util.os import os_manager
|
||||||
|
|
||||||
|
|
||||||
# Player
|
# Player
|
||||||
@ -19,7 +21,6 @@ from StreamingCommunity.Api.Player.sweetpixel import AnimeWorldPlayer
|
|||||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ScrapSerie:
|
class ScrapSerie:
|
||||||
def __init__(self, url, full_url):
|
def __init__(self, url, full_url):
|
||||||
"""Initialize the ScrapSerie object with the provided URL and setup the HTTP client."""
|
"""Initialize the ScrapSerie object with the provided URL and setup the HTTP client."""
|
||||||
@ -32,22 +33,22 @@ class ScrapSerie:
|
|||||||
base_url=full_url
|
base_url=full_url
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.response = self.client.get(self.link, timeout=max_timeout, follow_redirects=True)
|
||||||
|
self.response.raise_for_status()
|
||||||
|
|
||||||
|
except:
|
||||||
|
raise Exception(f"Failed to retrieve anime page.")
|
||||||
|
|
||||||
|
|
||||||
def get_name(self):
|
def get_name(self):
|
||||||
"""Extract and return the name of the anime series."""
|
"""Extract and return the name of the anime series."""
|
||||||
response = self.client.get(self.link, follow_redirects=True)
|
soup = BeautifulSoup(self.response.content, "html.parser")
|
||||||
if response.status_code == 200:
|
return os_manager.get_sanitize_file(soup.find("h1", {"id": "anime-title"}).get_text(strip=True))
|
||||||
soup = BeautifulSoup(response.content, "html.parser")
|
|
||||||
return soup.find("h1", {"id": "anime-title"}).get_text()
|
|
||||||
else:
|
|
||||||
raise Exception(f"Failed to retrieve anime name. Status code: {response.status_code}")
|
|
||||||
|
|
||||||
def get_episodes(self, nums=None):
|
def get_episodes(self, nums=None):
|
||||||
"""Fetch and return the list of episodes, optionally filtering by specific episode numbers."""
|
"""Fetch and return the list of episodes, optionally filtering by specific episode numbers."""
|
||||||
response = self.client.get(self.link, follow_redirects=True)
|
soup = BeautifulSoup(self.response.content, "html.parser")
|
||||||
if response.status_code != 200:
|
|
||||||
raise Exception(f"Failed to retrieve episodes. Status code: {response.status_code}")
|
|
||||||
|
|
||||||
soup = BeautifulSoup(response.content.decode('utf-8', 'ignore'), "html.parser")
|
|
||||||
|
|
||||||
raw_eps = {}
|
raw_eps = {}
|
||||||
for data in soup.select('li.episode > a'):
|
for data in soup.select('li.episode > a'):
|
||||||
@ -75,4 +76,4 @@ class ScrapSerie:
|
|||||||
return AnimeWorldPlayer(episode_data, self.session_id, self.csrf_token)
|
return AnimeWorldPlayer(episode_data, self.session_id, self.csrf_token)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise IndexError("Episode index out of range")
|
raise IndexError("Episode index out of range")
|
@ -37,7 +37,7 @@ def download_film(select_title: MediaItem) -> str:
|
|||||||
- str: output path
|
- str: output path
|
||||||
"""
|
"""
|
||||||
start_message()
|
start_message()
|
||||||
console.print(f"[yellow]Download: [red]{select_title.name} \n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{select_title.name}[/cyan] \n")
|
||||||
|
|
||||||
# Setup api manger
|
# Setup api manger
|
||||||
video_source = VideoSource(select_title.url)
|
video_source = VideoSource(select_title.url)
|
||||||
|
@ -27,12 +27,12 @@ table_show_manager = TVShowManager()
|
|||||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||||
|
|
||||||
|
|
||||||
def title_search(word_to_search: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Search for titles based on a search query.
|
Search for titles based on a search query.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
- int: The number of titles found.
|
- int: The number of titles found.
|
||||||
@ -40,7 +40,7 @@ def title_search(word_to_search: str) -> int:
|
|||||||
media_search_manager.clear()
|
media_search_manager.clear()
|
||||||
table_show_manager.clear()
|
table_show_manager.clear()
|
||||||
|
|
||||||
search_url = f"{site_constant.FULL_URL}/?s={word_to_search}"
|
search_url = f"{site_constant.FULL_URL}/?s={query}"
|
||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -51,8 +51,8 @@ def download_video(index_episode_selected: int, scape_info_serie: GetSerieInfo,
|
|||||||
|
|
||||||
# Get info about episode
|
# Get info about episode
|
||||||
obj_episode = scape_info_serie.list_episodes[index_episode_selected - 1]
|
obj_episode = scape_info_serie.list_episodes[index_episode_selected - 1]
|
||||||
console.print(f"[yellow]Download: [red]{obj_episode.get('name')}\n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [bold magenta]{obj_episode.get('name')}[/bold magenta] ([cyan]E{index_episode_selected}[/cyan]) \n")
|
||||||
|
|
||||||
# Define filename and path for the downloaded video
|
# Define filename and path for the downloaded video
|
||||||
title_name = os_manager.get_sanitize_file(
|
title_name = os_manager.get_sanitize_file(
|
||||||
f"{map_episode_title(scape_info_serie.tv_name, None, index_episode_selected, obj_episode.get('name'))}.mp4"
|
f"{map_episode_title(scape_info_serie.tv_name, None, index_episode_selected, obj_episode.get('name'))}.mp4"
|
||||||
|
@ -28,12 +28,12 @@ table_show_manager = TVShowManager()
|
|||||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||||
|
|
||||||
|
|
||||||
def title_search(word_to_search: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Search for titles based on a search query.
|
Search for titles based on a search query.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
- int: The number of titles found.
|
- int: The number of titles found.
|
||||||
@ -41,7 +41,7 @@ def title_search(word_to_search: str) -> int:
|
|||||||
media_search_manager.clear()
|
media_search_manager.clear()
|
||||||
table_show_manager.clear()
|
table_show_manager.clear()
|
||||||
|
|
||||||
search_url = f"{site_constant.FULL_URL}/search/?&q={word_to_search}&quick=1&type=videobox_video&nodes=11"
|
search_url = f"{site_constant.FULL_URL}/search/?&q={query}&quick=1&type=videobox_video&nodes=11"
|
||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -55,7 +55,7 @@ def download_video(index_season_selected: int, index_episode_selected: int, scap
|
|||||||
|
|
||||||
# Get info about episode
|
# Get info about episode
|
||||||
obj_episode = scape_info_serie.list_episodes[index_episode_selected - 1]
|
obj_episode = scape_info_serie.list_episodes[index_episode_selected - 1]
|
||||||
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.get('name')}\n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [bold magenta]{obj_episode.get('name')}[/bold magenta] ([cyan]S{index_season_selected}E{index_episode_selected}[/cyan]) \n")
|
||||||
|
|
||||||
# Define filename and path for the downloaded video
|
# Define filename and path for the downloaded video
|
||||||
mp4_name = f"{map_episode_title(scape_info_serie.tv_name, index_season_selected, index_episode_selected, obj_episode.get('name'))}.mp4"
|
mp4_name = f"{map_episode_title(scape_info_serie.tv_name, index_season_selected, index_episode_selected, obj_episode.get('name'))}.mp4"
|
||||||
|
@ -27,12 +27,12 @@ max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def title_search(word_to_search: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Search for titles based on a search query.
|
Search for titles based on a search query.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
- int: The number of titles found.
|
- int: The number of titles found.
|
||||||
@ -40,7 +40,7 @@ def title_search(word_to_search: str) -> int:
|
|||||||
media_search_manager.clear()
|
media_search_manager.clear()
|
||||||
table_show_manager.clear()
|
table_show_manager.clear()
|
||||||
|
|
||||||
search_url = f"{site_constant.FULL_URL}/?story={word_to_search}&do=search&subaction=search"
|
search_url = f"{site_constant.FULL_URL}/?story={query}&do=search&subaction=search"
|
||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -44,7 +44,7 @@ def download_film(movie_details: Json_film) -> str:
|
|||||||
|
|
||||||
# Start message and display film information
|
# Start message and display film information
|
||||||
start_message()
|
start_message()
|
||||||
console.print(f"[yellow]Download: [red]{movie_details.title} \n")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [cyan]{movie_details.title}[/cyan] \n")
|
||||||
|
|
||||||
# Make request to main site
|
# Make request to main site
|
||||||
try:
|
try:
|
||||||
|
@ -52,7 +52,7 @@ def download_film(select_title: MediaItem) -> str:
|
|||||||
|
|
||||||
# Start message and display film information
|
# Start message and display film information
|
||||||
start_message()
|
start_message()
|
||||||
console.print(f"[yellow]Download: [red]{select_title.name} \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)
|
video_source = VideoSource(site_constant.FULL_URL, False)
|
||||||
|
@ -61,8 +61,7 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
|
|||||||
|
|
||||||
# Get info about episode
|
# Get info about episode
|
||||||
obj_episode = season.episodes.get(index_episode_selected - 1)
|
obj_episode = season.episodes.get(index_episode_selected - 1)
|
||||||
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.name}")
|
console.print(f"[bold yellow]Download:[/bold yellow] [red]{site_constant.SITE_NAME}[/red] → [bold magenta]{obj_episode.name}[/bold magenta] ([cyan]S{index_season_selected}E{index_episode_selected}[/cyan]) \n")
|
||||||
print()
|
|
||||||
|
|
||||||
if site_constant.TELEGRAM_BOT:
|
if site_constant.TELEGRAM_BOT:
|
||||||
bot = get_bot_instance()
|
bot = get_bot_instance()
|
||||||
|
@ -27,12 +27,12 @@ table_show_manager = TVShowManager()
|
|||||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||||
|
|
||||||
|
|
||||||
def title_search(title_search: str) -> int:
|
def title_search(query: str) -> int:
|
||||||
"""
|
"""
|
||||||
Search for titles based on a search query.
|
Search for titles based on a search query.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- title_search (str): The title to search for.
|
- query (str): The query to search for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
int: The number of titles found.
|
int: The number of titles found.
|
||||||
@ -43,7 +43,7 @@ def title_search(title_search: str) -> int:
|
|||||||
media_search_manager.clear()
|
media_search_manager.clear()
|
||||||
table_show_manager.clear()
|
table_show_manager.clear()
|
||||||
|
|
||||||
search_url = f"{site_constant.FULL_URL}/api/search?q={title_search}"
|
search_url = f"{site_constant.FULL_URL}/api/search?q={query}"
|
||||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
__title__ = 'StreamingCommunity'
|
__title__ = 'StreamingCommunity'
|
||||||
__version__ = '2.9.5'
|
__version__ = '2.9.6'
|
||||||
__author__ = 'Arrowar'
|
__author__ = 'Arrowar'
|
||||||
__description__ = 'A command-line program to download film'
|
__description__ = 'A command-line program to download film'
|
||||||
__copyright__ = 'Copyright 2024'
|
__copyright__ = 'Copyright 2024'
|
||||||
|
@ -143,7 +143,7 @@ def initialize():
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# Trending tmbd
|
# Trending tmbd
|
||||||
if SHOW_TRENDING:
|
"""if SHOW_TRENDING:
|
||||||
print()
|
print()
|
||||||
tmdb.display_trending_films()
|
tmdb.display_trending_films()
|
||||||
tmdb.display_trending_tv_shows()
|
tmdb.display_trending_tv_shows()
|
||||||
@ -152,7 +152,7 @@ def initialize():
|
|||||||
try:
|
try:
|
||||||
git_update()
|
git_update()
|
||||||
except:
|
except:
|
||||||
console.log("[red]Error with loading github.")
|
console.log("[red]Error with loading github.")"""
|
||||||
|
|
||||||
def restart_script():
|
def restart_script():
|
||||||
"""Riavvia lo script con gli stessi argomenti della riga di comando."""
|
"""Riavvia lo script con gli stessi argomenti della riga di comando."""
|
||||||
|
2
setup.py
2
setup.py
@ -10,7 +10,7 @@ with open(os.path.join(os.path.dirname(__file__), "requirements.txt"), "r", enco
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="StreamingCommunity",
|
name="StreamingCommunity",
|
||||||
version="2.9.5",
|
version="2.9.6",
|
||||||
long_description=read_readme(),
|
long_description=read_readme(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
author="Lovi-0",
|
author="Lovi-0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user