StreamingCommunity 2.4.0__py3-none-any.whl → 2.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of StreamingCommunity might be problematic. Click here for more details.
- {StreamingCommunity-2.4.0.dist-info → StreamingCommunity-2.5.0.dist-info}/METADATA +9 -6
- StreamingCommunity-2.5.0.dist-info/RECORD +8 -0
- StreamingCommunity/Api/Player/Helper/Vixcloud/js_parser.py +0 -143
- StreamingCommunity/Api/Player/Helper/Vixcloud/util.py +0 -136
- StreamingCommunity/Api/Player/ddl.py +0 -89
- StreamingCommunity/Api/Player/maxstream.py +0 -151
- StreamingCommunity/Api/Player/supervideo.py +0 -194
- StreamingCommunity/Api/Player/vixcloud.py +0 -273
- StreamingCommunity/Api/Site/1337xx/__init__.py +0 -51
- StreamingCommunity/Api/Site/1337xx/costant.py +0 -15
- StreamingCommunity/Api/Site/1337xx/site.py +0 -89
- StreamingCommunity/Api/Site/1337xx/title.py +0 -66
- StreamingCommunity/Api/Site/altadefinizionegratis/__init__.py +0 -51
- StreamingCommunity/Api/Site/altadefinizionegratis/costant.py +0 -19
- StreamingCommunity/Api/Site/altadefinizionegratis/film.py +0 -74
- StreamingCommunity/Api/Site/altadefinizionegratis/site.py +0 -95
- StreamingCommunity/Api/Site/animeunity/__init__.py +0 -51
- StreamingCommunity/Api/Site/animeunity/costant.py +0 -19
- StreamingCommunity/Api/Site/animeunity/film_serie.py +0 -135
- StreamingCommunity/Api/Site/animeunity/site.py +0 -175
- StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +0 -97
- StreamingCommunity/Api/Site/cb01new/__init__.py +0 -52
- StreamingCommunity/Api/Site/cb01new/costant.py +0 -19
- StreamingCommunity/Api/Site/cb01new/film.py +0 -73
- StreamingCommunity/Api/Site/cb01new/site.py +0 -83
- StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +0 -56
- StreamingCommunity/Api/Site/ddlstreamitaly/costant.py +0 -20
- StreamingCommunity/Api/Site/ddlstreamitaly/series.py +0 -146
- StreamingCommunity/Api/Site/ddlstreamitaly/site.py +0 -99
- StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +0 -85
- StreamingCommunity/Api/Site/guardaserie/__init__.py +0 -51
- StreamingCommunity/Api/Site/guardaserie/costant.py +0 -19
- StreamingCommunity/Api/Site/guardaserie/series.py +0 -198
- StreamingCommunity/Api/Site/guardaserie/site.py +0 -90
- StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +0 -110
- StreamingCommunity/Api/Site/ilcorsaronero/__init__.py +0 -52
- StreamingCommunity/Api/Site/ilcorsaronero/costant.py +0 -19
- StreamingCommunity/Api/Site/ilcorsaronero/site.py +0 -72
- StreamingCommunity/Api/Site/ilcorsaronero/title.py +0 -46
- StreamingCommunity/Api/Site/ilcorsaronero/util/ilCorsarScraper.py +0 -149
- StreamingCommunity/Api/Site/mostraguarda/__init__.py +0 -49
- StreamingCommunity/Api/Site/mostraguarda/costant.py +0 -19
- StreamingCommunity/Api/Site/mostraguarda/film.py +0 -101
- StreamingCommunity/Api/Site/streamingcommunity/__init__.py +0 -56
- StreamingCommunity/Api/Site/streamingcommunity/costant.py +0 -19
- StreamingCommunity/Api/Site/streamingcommunity/film.py +0 -75
- StreamingCommunity/Api/Site/streamingcommunity/series.py +0 -206
- StreamingCommunity/Api/Site/streamingcommunity/site.py +0 -142
- StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +0 -123
- StreamingCommunity/Api/Template/Class/SearchType.py +0 -101
- StreamingCommunity/Api/Template/Util/__init__.py +0 -5
- StreamingCommunity/Api/Template/Util/get_domain.py +0 -203
- StreamingCommunity/Api/Template/Util/manage_ep.py +0 -179
- StreamingCommunity/Api/Template/Util/recall_search.py +0 -37
- StreamingCommunity/Api/Template/__init__.py +0 -3
- StreamingCommunity/Api/Template/site.py +0 -87
- StreamingCommunity/Lib/Downloader/HLS/downloader.py +0 -965
- StreamingCommunity/Lib/Downloader/HLS/proxyes.py +0 -110
- StreamingCommunity/Lib/Downloader/HLS/segments.py +0 -573
- StreamingCommunity/Lib/Downloader/MP4/downloader.py +0 -155
- StreamingCommunity/Lib/Downloader/TOR/downloader.py +0 -296
- StreamingCommunity/Lib/Downloader/__init__.py +0 -5
- StreamingCommunity/Lib/FFmpeg/__init__.py +0 -4
- StreamingCommunity/Lib/FFmpeg/capture.py +0 -170
- StreamingCommunity/Lib/FFmpeg/command.py +0 -296
- StreamingCommunity/Lib/FFmpeg/util.py +0 -249
- StreamingCommunity/Lib/M3U8/__init__.py +0 -6
- StreamingCommunity/Lib/M3U8/decryptor.py +0 -165
- StreamingCommunity/Lib/M3U8/estimator.py +0 -229
- StreamingCommunity/Lib/M3U8/parser.py +0 -666
- StreamingCommunity/Lib/M3U8/url_fixer.py +0 -58
- StreamingCommunity/Lib/TMBD/__init__.py +0 -2
- StreamingCommunity/Lib/TMBD/obj_tmbd.py +0 -39
- StreamingCommunity/Lib/TMBD/tmdb.py +0 -346
- StreamingCommunity/Upload/update.py +0 -67
- StreamingCommunity/Upload/version.py +0 -5
- StreamingCommunity/Util/_jsonConfig.py +0 -228
- StreamingCommunity/Util/call_stack.py +0 -42
- StreamingCommunity/Util/color.py +0 -20
- StreamingCommunity/Util/console.py +0 -12
- StreamingCommunity/Util/ffmpeg_installer.py +0 -368
- StreamingCommunity/Util/headers.py +0 -160
- StreamingCommunity/Util/logger.py +0 -62
- StreamingCommunity/Util/message.py +0 -64
- StreamingCommunity/Util/os.py +0 -507
- StreamingCommunity/Util/table.py +0 -229
- StreamingCommunity-2.4.0.dist-info/RECORD +0 -92
- {StreamingCommunity-2.4.0.dist-info → StreamingCommunity-2.5.0.dist-info}/LICENSE +0 -0
- {StreamingCommunity-2.4.0.dist-info → StreamingCommunity-2.5.0.dist-info}/WHEEL +0 -0
- {StreamingCommunity-2.4.0.dist-info → StreamingCommunity-2.5.0.dist-info}/entry_points.txt +0 -0
- {StreamingCommunity-2.4.0.dist-info → StreamingCommunity-2.5.0.dist-info}/top_level.txt +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# 13.06.24
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
import logging
|
|
5
|
-
from typing import List, Dict
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# External libraries
|
|
9
|
-
import httpx
|
|
10
|
-
from bs4 import BeautifulSoup
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# Internal utilities
|
|
14
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
15
|
-
from StreamingCommunity.Util.headers import get_headers
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# Logic class
|
|
19
|
-
from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# Variable
|
|
23
|
-
from ..costant import COOKIE
|
|
24
|
-
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class GetSerieInfo:
|
|
28
|
-
def __init__(self, dict_serie: MediaItem) -> None:
|
|
29
|
-
"""
|
|
30
|
-
Initializes the GetSerieInfo object with default values.
|
|
31
|
-
|
|
32
|
-
Parameters:
|
|
33
|
-
- dict_serie (MediaItem): Dictionary containing series information (optional).
|
|
34
|
-
"""
|
|
35
|
-
self.headers = {'user-agent': get_headers()}
|
|
36
|
-
self.cookies = COOKIE
|
|
37
|
-
self.url = dict_serie.url
|
|
38
|
-
self.tv_name = None
|
|
39
|
-
self.list_episodes = None
|
|
40
|
-
|
|
41
|
-
def get_episode_number(self) -> List[Dict[str, str]]:
|
|
42
|
-
"""
|
|
43
|
-
Retrieves the number of episodes for a specific season.
|
|
44
|
-
|
|
45
|
-
Parameters:
|
|
46
|
-
n_season (int): The season number.
|
|
47
|
-
|
|
48
|
-
Returns:
|
|
49
|
-
List[Dict[str, str]]: List of dictionaries containing episode information.
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
try:
|
|
53
|
-
response = httpx.get(f"{self.url}?area=online", cookies=self.cookies, headers=self.headers, timeout=max_timeout)
|
|
54
|
-
response.raise_for_status()
|
|
55
|
-
|
|
56
|
-
except Exception as e:
|
|
57
|
-
logging.error(f"Insert value for [ips4_device_key, ips4_member_id, ips4_login_key] in config.json file SITE \\ ddlstreamitaly \\ cookie. Use browser debug and cookie request with a valid account, filter by DOC. Error: {e}")
|
|
58
|
-
sys.exit(0)
|
|
59
|
-
|
|
60
|
-
# Parse HTML content of the page
|
|
61
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
62
|
-
|
|
63
|
-
# Get tv name
|
|
64
|
-
self.tv_name = soup.find("span", class_= "ipsType_break").get_text(strip=True)
|
|
65
|
-
|
|
66
|
-
# Find the container of episodes for the specified season
|
|
67
|
-
table_content = soup.find('div', class_='ipsMargin_bottom:half')
|
|
68
|
-
list_dict_episode = []
|
|
69
|
-
|
|
70
|
-
for episode_div in table_content.find_all('a', href=True):
|
|
71
|
-
|
|
72
|
-
# Get text of episode
|
|
73
|
-
part_name = episode_div.get_text(strip=True)
|
|
74
|
-
|
|
75
|
-
if part_name:
|
|
76
|
-
obj_episode = {
|
|
77
|
-
'name': part_name,
|
|
78
|
-
'url': episode_div['href']
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
list_dict_episode.append(obj_episode)
|
|
82
|
-
|
|
83
|
-
self.list_episodes = list_dict_episode
|
|
84
|
-
return list_dict_episode
|
|
85
|
-
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# 09.06.24
|
|
2
|
-
|
|
3
|
-
from urllib.parse import quote_plus
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util.console import console, msg
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# Logic class
|
|
11
|
-
from .site import title_search, run_get_select_title, media_search_manager
|
|
12
|
-
from .series import download_series
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# Variable
|
|
16
|
-
indice = 4
|
|
17
|
-
_useFor = "serie"
|
|
18
|
-
_deprecate = False
|
|
19
|
-
_priority = 2
|
|
20
|
-
_engineDownload = "hls"
|
|
21
|
-
from .costant import SITE_NAME
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
25
|
-
"""
|
|
26
|
-
Main function of the application for film and series.
|
|
27
|
-
"""
|
|
28
|
-
|
|
29
|
-
if string_to_search is None:
|
|
30
|
-
string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{SITE_NAME}").strip()
|
|
31
|
-
|
|
32
|
-
# Search on database
|
|
33
|
-
len_database = title_search(quote_plus(string_to_search))
|
|
34
|
-
|
|
35
|
-
# Return list of elements
|
|
36
|
-
if get_onylDatabase:
|
|
37
|
-
return media_search_manager
|
|
38
|
-
|
|
39
|
-
if len_database > 0:
|
|
40
|
-
|
|
41
|
-
# Select title from list
|
|
42
|
-
select_title = run_get_select_title()
|
|
43
|
-
|
|
44
|
-
# Download only film
|
|
45
|
-
download_series(select_title)
|
|
46
|
-
|
|
47
|
-
else:
|
|
48
|
-
console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
|
|
49
|
-
|
|
50
|
-
# Retry
|
|
51
|
-
search()
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 09.06.24
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
|
11
|
-
ROOT_PATH = config_manager.get('DEFAULT', 'root_path')
|
|
12
|
-
DOMAIN_NOW = config_manager.get_dict('SITE', SITE_NAME)['domain']
|
|
13
|
-
|
|
14
|
-
SERIES_FOLDER = os.path.join(ROOT_PATH, config_manager.get('DEFAULT', 'serie_folder_name'))
|
|
15
|
-
MOVIE_FOLDER = os.path.join(ROOT_PATH, config_manager.get('DEFAULT', 'movie_folder_name'))
|
|
16
|
-
|
|
17
|
-
if config_manager.get_bool("DEFAULT", "add_siteName"):
|
|
18
|
-
SERIES_FOLDER = os.path.join(ROOT_PATH, SITE_NAME, config_manager.get('DEFAULT', 'serie_folder_name'))
|
|
19
|
-
MOVIE_FOLDER = os.path.join(ROOT_PATH, SITE_NAME, config_manager.get('DEFAULT', 'movie_folder_name'))
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
# 13.06.24
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import sys
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Internal utilities
|
|
8
|
-
from StreamingCommunity.Util.console import console, msg
|
|
9
|
-
from StreamingCommunity.Util.message import start_message
|
|
10
|
-
from StreamingCommunity.Util.call_stack import get_call_stack
|
|
11
|
-
from StreamingCommunity.Util.table import TVShowManager
|
|
12
|
-
from StreamingCommunity.Lib.Downloader import HLS_Downloader
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# Logic class
|
|
16
|
-
from StreamingCommunity.Api.Template.Util import manage_selection, map_episode_title, validate_selection, validate_episode_selection, execute_search
|
|
17
|
-
from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# Player
|
|
21
|
-
from .util.ScrapeSerie import GetSerieInfo
|
|
22
|
-
from StreamingCommunity.Api.Player.supervideo import VideoSource
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# Variable
|
|
26
|
-
from .costant import SERIES_FOLDER
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def download_video(index_season_selected: int, index_episode_selected: int, scape_info_serie: GetSerieInfo) -> str:
|
|
31
|
-
"""
|
|
32
|
-
Download a single episode video.
|
|
33
|
-
|
|
34
|
-
Parameters:
|
|
35
|
-
- tv_name (str): Name of the TV series.
|
|
36
|
-
- index_season_selected (int): Index of the selected season.
|
|
37
|
-
- index_episode_selected (int): Index of the selected episode.
|
|
38
|
-
|
|
39
|
-
Return:
|
|
40
|
-
- str: output path
|
|
41
|
-
"""
|
|
42
|
-
|
|
43
|
-
start_message()
|
|
44
|
-
|
|
45
|
-
# Get info about episode
|
|
46
|
-
obj_episode = scape_info_serie.list_episodes[index_episode_selected - 1]
|
|
47
|
-
console.print(f"[yellow]Download: [red]{index_season_selected}:{index_episode_selected} {obj_episode.get('name')}")
|
|
48
|
-
print()
|
|
49
|
-
|
|
50
|
-
# Define filename and path for the downloaded video
|
|
51
|
-
mp4_name = f"{map_episode_title(scape_info_serie.tv_name, index_season_selected, index_episode_selected, obj_episode.get('name'))}.mp4"
|
|
52
|
-
mp4_path = os.path.join(SERIES_FOLDER, scape_info_serie.tv_name, f"S{index_season_selected}")
|
|
53
|
-
|
|
54
|
-
# Setup video source
|
|
55
|
-
video_source = VideoSource(obj_episode.get('url'))
|
|
56
|
-
|
|
57
|
-
# Get m3u8 master playlist
|
|
58
|
-
master_playlist = video_source.get_playlist()
|
|
59
|
-
|
|
60
|
-
# Download the film using the m3u8 playlist, and output filename
|
|
61
|
-
r_proc = HLS_Downloader(
|
|
62
|
-
m3u8_playlist=master_playlist,
|
|
63
|
-
output_filename=os.path.join(mp4_path, mp4_name)
|
|
64
|
-
).start()
|
|
65
|
-
|
|
66
|
-
"""if r_proc == 404:
|
|
67
|
-
time.sleep(2)
|
|
68
|
-
|
|
69
|
-
# Re call search function
|
|
70
|
-
if msg.ask("[green]Do you want to continue [white]([red]y[white])[green] or return at home[white]([red]n[white]) ", choices=['y', 'n'], default='y', show_choices=True) == "n":
|
|
71
|
-
frames = get_call_stack()
|
|
72
|
-
execute_search(frames[-4])"""
|
|
73
|
-
|
|
74
|
-
if r_proc != None:
|
|
75
|
-
console.print("[green]Result: ")
|
|
76
|
-
console.print(r_proc)
|
|
77
|
-
|
|
78
|
-
return os.path.join(mp4_path, mp4_name)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def download_episode(scape_info_serie: GetSerieInfo, index_season_selected: int, download_all: bool = False) -> None:
|
|
82
|
-
"""
|
|
83
|
-
Download all episodes of a season.
|
|
84
|
-
|
|
85
|
-
Parameters:
|
|
86
|
-
- tv_name (str): Name of the TV series.
|
|
87
|
-
- index_season_selected (int): Index of the selected season.
|
|
88
|
-
- download_all (bool): Download all seasons episodes
|
|
89
|
-
"""
|
|
90
|
-
|
|
91
|
-
# Start message and collect information about episodes
|
|
92
|
-
start_message()
|
|
93
|
-
list_dict_episode = scape_info_serie.get_episode_number(index_season_selected)
|
|
94
|
-
episodes_count = len(list_dict_episode)
|
|
95
|
-
|
|
96
|
-
if download_all:
|
|
97
|
-
|
|
98
|
-
# Download all episodes without asking
|
|
99
|
-
for i_episode in range(1, episodes_count + 1):
|
|
100
|
-
download_video(index_season_selected, i_episode, scape_info_serie)
|
|
101
|
-
console.print(f"\n[red]End downloaded [yellow]season: [red]{index_season_selected}.")
|
|
102
|
-
|
|
103
|
-
else:
|
|
104
|
-
|
|
105
|
-
# Display episodes list and manage user selection
|
|
106
|
-
last_command = display_episodes_list(scape_info_serie.list_episodes)
|
|
107
|
-
list_episode_select = manage_selection(last_command, episodes_count)
|
|
108
|
-
|
|
109
|
-
try:
|
|
110
|
-
list_episode_select = validate_episode_selection(list_episode_select, episodes_count)
|
|
111
|
-
except ValueError as e:
|
|
112
|
-
console.print(f"[red]{str(e)}")
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
# Download selected episodes
|
|
116
|
-
for i_episode in list_episode_select:
|
|
117
|
-
download_video(index_season_selected, i_episode, scape_info_serie)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
def download_series(dict_serie: MediaItem) -> None:
|
|
121
|
-
"""
|
|
122
|
-
Download all episodes of a TV series.
|
|
123
|
-
|
|
124
|
-
Parameters:
|
|
125
|
-
- dict_serie (MediaItem): obj with url name type and score
|
|
126
|
-
"""
|
|
127
|
-
|
|
128
|
-
# Start message and set up video source
|
|
129
|
-
start_message()
|
|
130
|
-
|
|
131
|
-
# Init class
|
|
132
|
-
scape_info_serie = GetSerieInfo(dict_serie)
|
|
133
|
-
|
|
134
|
-
# Collect information about seasons
|
|
135
|
-
seasons_count = scape_info_serie.get_seasons_number()
|
|
136
|
-
|
|
137
|
-
# Prompt user for season selection and download episodes
|
|
138
|
-
console.print(f"\n[green]Seasons found: [red]{seasons_count}")
|
|
139
|
-
index_season_selected = msg.ask(
|
|
140
|
-
"\n[cyan]Insert season number [yellow](e.g., 1), [red]* [cyan]to download all seasons, "
|
|
141
|
-
"[yellow](e.g., 1-2) [cyan]for a range of seasons, or [yellow](e.g., 3-*) [cyan]to download from a specific season to the end"
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
# Manage and validate the selection
|
|
145
|
-
list_season_select = manage_selection(index_season_selected, seasons_count)
|
|
146
|
-
|
|
147
|
-
try:
|
|
148
|
-
list_season_select = validate_selection(list_season_select, seasons_count)
|
|
149
|
-
except ValueError as e:
|
|
150
|
-
console.print(f"[red]{str(e)}")
|
|
151
|
-
return
|
|
152
|
-
|
|
153
|
-
# Loop through the selected seasons and download episodes
|
|
154
|
-
for i_season in list_season_select:
|
|
155
|
-
if len(list_season_select) > 1 or index_season_selected == "*":
|
|
156
|
-
|
|
157
|
-
# Download all episodes if multiple seasons are selected or if '*' is used
|
|
158
|
-
download_episode(scape_info_serie, i_season, download_all=True)
|
|
159
|
-
else:
|
|
160
|
-
|
|
161
|
-
# Otherwise, let the user select specific episodes for the single season
|
|
162
|
-
download_episode(scape_info_serie, i_season, download_all=False)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
def display_episodes_list(obj_episode_manager) -> str:
|
|
166
|
-
"""
|
|
167
|
-
Display episodes list and handle user input.
|
|
168
|
-
|
|
169
|
-
Returns:
|
|
170
|
-
last_command (str): Last command entered by the user.
|
|
171
|
-
"""
|
|
172
|
-
|
|
173
|
-
# Set up table for displaying episodes
|
|
174
|
-
table_show_manager = TVShowManager()
|
|
175
|
-
table_show_manager.set_slice_end(10)
|
|
176
|
-
|
|
177
|
-
# Add columns to the table
|
|
178
|
-
column_info = {
|
|
179
|
-
"Index": {'color': 'red'},
|
|
180
|
-
"Name": {'color': 'magenta'},
|
|
181
|
-
}
|
|
182
|
-
table_show_manager.add_column(column_info)
|
|
183
|
-
|
|
184
|
-
# Populate the table with episodes information
|
|
185
|
-
for media in obj_episode_manager:
|
|
186
|
-
table_show_manager.add_tv_show({
|
|
187
|
-
'Index': str(media.get('number')),
|
|
188
|
-
'Name': media.get('name'),
|
|
189
|
-
})
|
|
190
|
-
|
|
191
|
-
# Run the table and handle user input
|
|
192
|
-
last_command = table_show_manager.run()
|
|
193
|
-
|
|
194
|
-
if last_command == "q":
|
|
195
|
-
console.print("\n[red]Quit [white]...")
|
|
196
|
-
sys.exit(0)
|
|
197
|
-
|
|
198
|
-
return last_command
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# 09.06.24
|
|
2
|
-
|
|
3
|
-
# External libraries
|
|
4
|
-
import httpx
|
|
5
|
-
from bs4 import BeautifulSoup
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# Internal utilities
|
|
9
|
-
from StreamingCommunity.Util.console import console
|
|
10
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
11
|
-
from StreamingCommunity.Util.headers import get_headers
|
|
12
|
-
from StreamingCommunity.Util.table import TVShowManager
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# Logic class
|
|
16
|
-
from StreamingCommunity.Api.Template import get_select_title
|
|
17
|
-
from StreamingCommunity.Api.Template.Util import search_domain
|
|
18
|
-
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# Variable
|
|
22
|
-
from .costant import SITE_NAME, DOMAIN_NOW
|
|
23
|
-
media_search_manager = MediaManager()
|
|
24
|
-
table_show_manager = TVShowManager()
|
|
25
|
-
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
26
|
-
disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def title_search(word_to_search: str) -> int:
|
|
30
|
-
"""
|
|
31
|
-
Search for titles based on a search query.
|
|
32
|
-
|
|
33
|
-
Parameters:
|
|
34
|
-
- title_search (str): The title to search for.
|
|
35
|
-
|
|
36
|
-
Returns:
|
|
37
|
-
- int: The number of titles found.
|
|
38
|
-
"""
|
|
39
|
-
media_search_manager.clear()
|
|
40
|
-
table_show_manager.clear()
|
|
41
|
-
|
|
42
|
-
# Find new domain if prev dont work
|
|
43
|
-
domain_to_use = DOMAIN_NOW
|
|
44
|
-
|
|
45
|
-
if not disable_searchDomain:
|
|
46
|
-
domain_to_use, base_url = search_domain(SITE_NAME, f"https://{SITE_NAME}.{DOMAIN_NOW}")
|
|
47
|
-
|
|
48
|
-
# Send request to search for titles
|
|
49
|
-
try:
|
|
50
|
-
response = httpx.get(
|
|
51
|
-
url=f"https://guardaserie.{domain_to_use}/?story={word_to_search}&do=search&subaction=search",
|
|
52
|
-
headers={'user-agent': get_headers()},
|
|
53
|
-
timeout=max_timeout
|
|
54
|
-
)
|
|
55
|
-
response.raise_for_status()
|
|
56
|
-
|
|
57
|
-
except Exception as e:
|
|
58
|
-
console.print(f"Site: {SITE_NAME}, request search error: {e}")
|
|
59
|
-
|
|
60
|
-
# Create soup and find table
|
|
61
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
62
|
-
table_content = soup.find('div', class_="mlnew-list")
|
|
63
|
-
|
|
64
|
-
for serie_div in table_content.find_all('div', class_='mlnew'):
|
|
65
|
-
try:
|
|
66
|
-
|
|
67
|
-
title = serie_div.find('div', class_='mlnh-2').find("h2").get_text(strip=True)
|
|
68
|
-
link = serie_div.find('div', class_='mlnh-2').find('a')['href']
|
|
69
|
-
imdb_rating = serie_div.find('span', class_='mlnh-imdb').get_text(strip=True)
|
|
70
|
-
|
|
71
|
-
serie_info = {
|
|
72
|
-
'name': title,
|
|
73
|
-
'url': link,
|
|
74
|
-
'score': imdb_rating
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
media_search_manager.add_media(serie_info)
|
|
78
|
-
|
|
79
|
-
except Exception as e:
|
|
80
|
-
print(f"Error parsing a film entry: {e}")
|
|
81
|
-
|
|
82
|
-
# Return the number of titles found
|
|
83
|
-
return media_search_manager.get_length()
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
def run_get_select_title():
|
|
87
|
-
"""
|
|
88
|
-
Display a selection of titles and prompt the user to choose one.
|
|
89
|
-
"""
|
|
90
|
-
return get_select_title(table_show_manager, media_search_manager)
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# 13.06.24
|
|
2
|
-
|
|
3
|
-
import logging
|
|
4
|
-
from typing import List, Dict
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# External libraries
|
|
8
|
-
import httpx
|
|
9
|
-
from bs4 import BeautifulSoup
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Internal utilities
|
|
13
|
-
from StreamingCommunity.Util.headers import get_headers
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# Logic class
|
|
17
|
-
from StreamingCommunity.Api.Template .Class.SearchType import MediaItem
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class GetSerieInfo:
|
|
21
|
-
def __init__(self, dict_serie: MediaItem) -> None:
|
|
22
|
-
"""
|
|
23
|
-
Initializes the GetSerieInfo object with default values.
|
|
24
|
-
|
|
25
|
-
Parameters:
|
|
26
|
-
dict_serie (MediaItem): Dictionary containing series information (optional).
|
|
27
|
-
"""
|
|
28
|
-
self.headers = {'user-agent': get_headers()}
|
|
29
|
-
self.url = dict_serie.url
|
|
30
|
-
self.tv_name = None
|
|
31
|
-
self.list_episodes = None
|
|
32
|
-
|
|
33
|
-
def get_seasons_number(self) -> int:
|
|
34
|
-
"""
|
|
35
|
-
Retrieves the number of seasons of a TV series.
|
|
36
|
-
|
|
37
|
-
Returns:
|
|
38
|
-
int: Number of seasons of the TV series.
|
|
39
|
-
"""
|
|
40
|
-
try:
|
|
41
|
-
|
|
42
|
-
# Make an HTTP request to the series URL
|
|
43
|
-
response = httpx.get(self.url, headers=self.headers, timeout=15)
|
|
44
|
-
response.raise_for_status()
|
|
45
|
-
|
|
46
|
-
# Parse HTML content of the page
|
|
47
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
48
|
-
|
|
49
|
-
# Find the container of seasons
|
|
50
|
-
table_content = soup.find('div', class_="tt_season")
|
|
51
|
-
|
|
52
|
-
# Count the number of seasons
|
|
53
|
-
seasons_number = len(table_content.find_all("li"))
|
|
54
|
-
|
|
55
|
-
# Extract the name of the series
|
|
56
|
-
self.tv_name = soup.find("h1", class_="front_title").get_text(strip=True)
|
|
57
|
-
|
|
58
|
-
return seasons_number
|
|
59
|
-
|
|
60
|
-
except Exception as e:
|
|
61
|
-
logging.error(f"Error parsing HTML page: {e}")
|
|
62
|
-
|
|
63
|
-
return -999
|
|
64
|
-
|
|
65
|
-
def get_episode_number(self, n_season: int) -> List[Dict[str, str]]:
|
|
66
|
-
"""
|
|
67
|
-
Retrieves the number of episodes for a specific season.
|
|
68
|
-
|
|
69
|
-
Parameters:
|
|
70
|
-
n_season (int): The season number.
|
|
71
|
-
|
|
72
|
-
Returns:
|
|
73
|
-
List[Dict[str, str]]: List of dictionaries containing episode information.
|
|
74
|
-
"""
|
|
75
|
-
try:
|
|
76
|
-
|
|
77
|
-
# Make an HTTP request to the series URL
|
|
78
|
-
response = httpx.get(self.url, headers=self.headers, timeout=15)
|
|
79
|
-
response.raise_for_status()
|
|
80
|
-
|
|
81
|
-
# Parse HTML content of the page
|
|
82
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
83
|
-
|
|
84
|
-
# Find the container of episodes for the specified season
|
|
85
|
-
table_content = soup.find('div', class_="tab-pane", id=f"season-{n_season}")
|
|
86
|
-
|
|
87
|
-
# Extract episode information
|
|
88
|
-
episode_content = table_content.find_all("li")
|
|
89
|
-
list_dict_episode = []
|
|
90
|
-
|
|
91
|
-
for episode_div in episode_content:
|
|
92
|
-
index = episode_div.find("a").get("data-num")
|
|
93
|
-
link = episode_div.find("a").get("data-link")
|
|
94
|
-
name = episode_div.find("a").get("data-title")
|
|
95
|
-
|
|
96
|
-
obj_episode = {
|
|
97
|
-
'number': index,
|
|
98
|
-
'name': name,
|
|
99
|
-
'url': link
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
list_dict_episode.append(obj_episode)
|
|
103
|
-
|
|
104
|
-
self.list_episodes = list_dict_episode
|
|
105
|
-
return list_dict_episode
|
|
106
|
-
|
|
107
|
-
except Exception as e:
|
|
108
|
-
logging.error(f"Error parsing HTML page: {e}")
|
|
109
|
-
|
|
110
|
-
return []
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# 02.07.24
|
|
2
|
-
|
|
3
|
-
import asyncio
|
|
4
|
-
from urllib.parse import quote_plus
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Internal utilities
|
|
8
|
-
from StreamingCommunity.Util.console import console, msg
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Logic class
|
|
12
|
-
from .site import title_search, run_get_select_title, media_search_manager
|
|
13
|
-
from .title import download_title
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# Variable
|
|
17
|
-
indice = 9
|
|
18
|
-
_useFor = "film_serie"
|
|
19
|
-
_deprecate = False
|
|
20
|
-
_priority = 2
|
|
21
|
-
_engineDownload = "tor"
|
|
22
|
-
from .costant import SITE_NAME
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
26
|
-
"""
|
|
27
|
-
Main function of the application for film and series.
|
|
28
|
-
"""
|
|
29
|
-
|
|
30
|
-
if string_to_search is None:
|
|
31
|
-
string_to_search = msg.ask(f"\n[purple]Insert word to search in [green]{SITE_NAME}").strip()
|
|
32
|
-
|
|
33
|
-
# Search on database
|
|
34
|
-
len_database = asyncio.run(title_search(quote_plus(string_to_search)))
|
|
35
|
-
|
|
36
|
-
# Return list of elements
|
|
37
|
-
if get_onylDatabase:
|
|
38
|
-
return media_search_manager
|
|
39
|
-
|
|
40
|
-
if len_database > 0:
|
|
41
|
-
|
|
42
|
-
# Select title from list
|
|
43
|
-
select_title = run_get_select_title()
|
|
44
|
-
|
|
45
|
-
# Download title
|
|
46
|
-
download_title(select_title)
|
|
47
|
-
|
|
48
|
-
else:
|
|
49
|
-
console.print(f"\n[red]Nothing matching was found for[white]: [purple]{string_to_search}")
|
|
50
|
-
|
|
51
|
-
# Retry
|
|
52
|
-
search()
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 09.06.24
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
SITE_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
|
11
|
-
ROOT_PATH = config_manager.get('DEFAULT', 'root_path')
|
|
12
|
-
DOMAIN_NOW = config_manager.get_dict('SITE', SITE_NAME)['domain']
|
|
13
|
-
|
|
14
|
-
SERIES_FOLDER = os.path.join(ROOT_PATH, config_manager.get('DEFAULT', 'serie_folder_name'))
|
|
15
|
-
MOVIE_FOLDER = os.path.join(ROOT_PATH, config_manager.get('DEFAULT', 'movie_folder_name'))
|
|
16
|
-
|
|
17
|
-
if config_manager.get_bool("DEFAULT", "add_siteName"):
|
|
18
|
-
SERIES_FOLDER = os.path.join(ROOT_PATH, SITE_NAME, config_manager.get('DEFAULT', 'serie_folder_name'))
|
|
19
|
-
MOVIE_FOLDER = os.path.join(ROOT_PATH, SITE_NAME, config_manager.get('DEFAULT', 'movie_folder_name'))
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# 02.07.24
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Internal utilities
|
|
5
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
6
|
-
from StreamingCommunity.Util.table import TVShowManager
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# Logic class
|
|
10
|
-
from StreamingCommunity.Api.Template import get_select_title
|
|
11
|
-
from StreamingCommunity.Api.Template.Util import search_domain
|
|
12
|
-
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
13
|
-
from .util.ilCorsarScraper import IlCorsaroNeroScraper
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# Variable
|
|
17
|
-
from .costant import SITE_NAME, DOMAIN_NOW
|
|
18
|
-
media_search_manager = MediaManager()
|
|
19
|
-
table_show_manager = TVShowManager()
|
|
20
|
-
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
21
|
-
disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
async def title_search(word_to_search: str) -> int:
|
|
25
|
-
"""
|
|
26
|
-
Search for titles based on a search query.
|
|
27
|
-
|
|
28
|
-
Parameters:
|
|
29
|
-
- title_search (str): The title to search for.
|
|
30
|
-
|
|
31
|
-
Returns:
|
|
32
|
-
- int: The number of titles found.
|
|
33
|
-
"""
|
|
34
|
-
media_search_manager.clear()
|
|
35
|
-
table_show_manager.clear()
|
|
36
|
-
|
|
37
|
-
# Find new domain if prev dont work
|
|
38
|
-
domain_to_use = DOMAIN_NOW
|
|
39
|
-
|
|
40
|
-
if not disable_searchDomain:
|
|
41
|
-
domain_to_use, base_url = search_domain(SITE_NAME, f"https://{SITE_NAME}.{DOMAIN_NOW}")
|
|
42
|
-
|
|
43
|
-
# Create scraper and collect result
|
|
44
|
-
print("\n")
|
|
45
|
-
scraper = IlCorsaroNeroScraper(f"https://{SITE_NAME}.{domain_to_use}/", 1)
|
|
46
|
-
results = await scraper.search(word_to_search)
|
|
47
|
-
|
|
48
|
-
for i, torrent in enumerate(results):
|
|
49
|
-
try:
|
|
50
|
-
|
|
51
|
-
media_search_manager.add_media({
|
|
52
|
-
'name': torrent['name'],
|
|
53
|
-
'type': torrent['type'],
|
|
54
|
-
'seed': torrent['seed'],
|
|
55
|
-
'leech': torrent['leech'],
|
|
56
|
-
'size': torrent['size'],
|
|
57
|
-
'date': torrent['date'],
|
|
58
|
-
'url': torrent['url']
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
except Exception as e:
|
|
62
|
-
print(f"Error parsing a film entry: {e}")
|
|
63
|
-
|
|
64
|
-
# Return the number of titles found
|
|
65
|
-
return media_search_manager.get_length()
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def run_get_select_title():
|
|
69
|
-
"""
|
|
70
|
-
Display a selection of titles and prompt the user to choose one.
|
|
71
|
-
"""
|
|
72
|
-
return get_select_title(table_show_manager, media_search_manager)
|