StreamingCommunity 2.7.0__py3-none-any.whl → 2.9.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/Api/Player/ddl.py +2 -2
- StreamingCommunity/Api/Player/maxstream.py +7 -13
- StreamingCommunity/Api/Player/supervideo.py +7 -33
- StreamingCommunity/Api/Player/vixcloud.py +8 -80
- StreamingCommunity/Api/Site/1337xx/__init__.py +8 -1
- StreamingCommunity/Api/Site/1337xx/site.py +10 -16
- StreamingCommunity/Api/Site/1337xx/title.py +4 -1
- StreamingCommunity/Api/Site/animeunity/__init__.py +9 -2
- StreamingCommunity/Api/Site/animeunity/film_serie.py +7 -1
- StreamingCommunity/Api/Site/animeunity/site.py +8 -10
- StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +1 -1
- StreamingCommunity/Api/Site/cb01new/__init__.py +8 -1
- StreamingCommunity/Api/Site/cb01new/film.py +10 -6
- StreamingCommunity/Api/Site/cb01new/site.py +16 -15
- StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +9 -2
- StreamingCommunity/Api/Site/ddlstreamitaly/series.py +7 -1
- StreamingCommunity/Api/Site/ddlstreamitaly/site.py +10 -15
- StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +1 -1
- StreamingCommunity/Api/Site/guardaserie/__init__.py +9 -2
- StreamingCommunity/Api/Site/guardaserie/series.py +13 -8
- StreamingCommunity/Api/Site/guardaserie/site.py +12 -17
- StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +1 -1
- StreamingCommunity/Api/Site/mostraguarda/__init__.py +6 -2
- StreamingCommunity/Api/Site/mostraguarda/film.py +10 -8
- StreamingCommunity/Api/Site/streamingcommunity/__init__.py +9 -2
- StreamingCommunity/Api/Site/streamingcommunity/film.py +11 -6
- StreamingCommunity/Api/Site/streamingcommunity/series.py +17 -10
- StreamingCommunity/Api/Site/streamingcommunity/site.py +10 -15
- StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +2 -2
- StreamingCommunity/Api/Template/Util/__init__.py +0 -1
- StreamingCommunity/Api/Template/Util/get_domain.py +24 -66
- StreamingCommunity/Api/Template/Util/manage_ep.py +10 -5
- StreamingCommunity/Api/Template/config_loader.py +8 -8
- StreamingCommunity/Api/Template/site.py +3 -6
- StreamingCommunity/Lib/Downloader/HLS/downloader.py +15 -14
- StreamingCommunity/Lib/Downloader/HLS/segments.py +11 -31
- StreamingCommunity/Lib/Downloader/MP4/downloader.py +12 -9
- StreamingCommunity/Lib/Downloader/TOR/downloader.py +109 -101
- StreamingCommunity/Lib/FFmpeg/__init__.py +1 -1
- StreamingCommunity/Lib/FFmpeg/capture.py +10 -12
- StreamingCommunity/Lib/FFmpeg/command.py +15 -14
- StreamingCommunity/Lib/FFmpeg/util.py +9 -38
- StreamingCommunity/Lib/M3U8/decryptor.py +72 -146
- StreamingCommunity/Lib/M3U8/estimator.py +8 -16
- StreamingCommunity/Lib/M3U8/parser.py +25 -27
- StreamingCommunity/Lib/M3U8/url_fixer.py +1 -4
- StreamingCommunity/Lib/TMBD/__init__.py +2 -0
- StreamingCommunity/Lib/TMBD/obj_tmbd.py +3 -17
- StreamingCommunity/Lib/TMBD/tmdb.py +4 -9
- StreamingCommunity/TelegramHelp/telegram_bot.py +50 -50
- StreamingCommunity/Upload/update.py +3 -2
- StreamingCommunity/Upload/version.py +1 -1
- StreamingCommunity/Util/color.py +1 -1
- StreamingCommunity/Util/{_jsonConfig.py → config_json.py} +148 -54
- StreamingCommunity/Util/headers.py +2 -38
- StreamingCommunity/Util/logger.py +72 -42
- StreamingCommunity/Util/message.py +8 -3
- StreamingCommunity/Util/os.py +41 -93
- StreamingCommunity/Util/table.py +8 -17
- StreamingCommunity/run.py +26 -34
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.9.0.dist-info}/METADATA +165 -92
- StreamingCommunity-2.9.0.dist-info/RECORD +75 -0
- StreamingCommunity/Api/Template/Util/recall_search.py +0 -37
- StreamingCommunity/Lib/Downloader/HLS/proxyes.py +0 -110
- StreamingCommunity/Util/call_stack.py +0 -42
- StreamingCommunity/Util/console.py +0 -12
- StreamingCommunity-2.7.0.dist-info/RECORD +0 -79
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.9.0.dist-info}/LICENSE +0 -0
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.9.0.dist-info}/WHEEL +0 -0
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.9.0.dist-info}/entry_points.txt +0 -0
- {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.9.0.dist-info}/top_level.txt +0 -0
|
@@ -4,13 +4,17 @@ import logging
|
|
|
4
4
|
from urllib.parse import quote_plus
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
# External library
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.prompt import Prompt
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
# Internal utilities
|
|
8
|
-
from StreamingCommunity.Util.console import console, msg
|
|
9
13
|
from StreamingCommunity.Api.Template import get_select_title
|
|
14
|
+
from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
10
15
|
|
|
11
16
|
|
|
12
17
|
# Logic class
|
|
13
|
-
from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
14
18
|
from .site import title_search, media_search_manager, table_show_manager
|
|
15
19
|
from .series import download_thread
|
|
16
20
|
|
|
@@ -22,6 +26,9 @@ _deprecate = False
|
|
|
22
26
|
_priority = 2
|
|
23
27
|
_engineDownload = "mp4"
|
|
24
28
|
|
|
29
|
+
msg = Prompt()
|
|
30
|
+
console = Console()
|
|
31
|
+
|
|
25
32
|
|
|
26
33
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
27
34
|
"""
|
|
@@ -5,8 +5,11 @@ from urllib.parse import urlparse
|
|
|
5
5
|
from typing import Tuple
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
# External library
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
|
|
11
|
+
|
|
8
12
|
# Internal utilities
|
|
9
|
-
from StreamingCommunity.Util.console import console
|
|
10
13
|
from StreamingCommunity.Util.message import start_message
|
|
11
14
|
from StreamingCommunity.Util.os import os_manager
|
|
12
15
|
from StreamingCommunity.Lib.Downloader import MP4_downloader
|
|
@@ -28,6 +31,9 @@ from .util.ScrapeSerie import GetSerieInfo
|
|
|
28
31
|
from StreamingCommunity.Api.Player.ddl import VideoSource
|
|
29
32
|
|
|
30
33
|
|
|
34
|
+
# Variable
|
|
35
|
+
console = Console()
|
|
36
|
+
|
|
31
37
|
|
|
32
38
|
def download_video(index_episode_selected: int, scape_info_serie: GetSerieInfo, video_source: VideoSource) -> Tuple[str,bool]:
|
|
33
39
|
"""
|
|
@@ -7,11 +7,11 @@ import logging
|
|
|
7
7
|
# External libraries
|
|
8
8
|
import httpx
|
|
9
9
|
from bs4 import BeautifulSoup
|
|
10
|
+
from rich.console import Console
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
# Internal utilities
|
|
13
|
-
from StreamingCommunity.Util.
|
|
14
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
14
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
15
15
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
16
16
|
from StreamingCommunity.Util.table import TVShowManager
|
|
17
17
|
|
|
@@ -23,10 +23,10 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
# Variable
|
|
26
|
+
console = Console()
|
|
26
27
|
media_search_manager = MediaManager()
|
|
27
28
|
table_show_manager = TVShowManager()
|
|
28
29
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
29
|
-
disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
def title_search(word_to_search: str) -> int:
|
|
@@ -42,24 +42,19 @@ def title_search(word_to_search: str) -> int:
|
|
|
42
42
|
media_search_manager.clear()
|
|
43
43
|
table_show_manager.clear()
|
|
44
44
|
|
|
45
|
-
#
|
|
46
|
-
domain_to_use = site_constant.
|
|
47
|
-
|
|
48
|
-
if not disable_searchDomain:
|
|
49
|
-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
45
|
+
# Check if domain is working
|
|
46
|
+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
50
47
|
|
|
51
48
|
if domain_to_use is None or base_url is None:
|
|
52
|
-
console.print("[bold red]
|
|
49
|
+
console.print("[bold red]Error: Unable to determine valid domain or base URL.[/bold red]")
|
|
53
50
|
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
|
|
54
51
|
sys.exit(1)
|
|
55
52
|
|
|
56
|
-
|
|
53
|
+
search_url = f"{site_constant.FULL_URL}/search/?&q={word_to_search}&quick=1&type=videobox_video&nodes=11"
|
|
54
|
+
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
|
55
|
+
|
|
57
56
|
try:
|
|
58
|
-
response = httpx.get(
|
|
59
|
-
url=f"{site_constant.FULL_URL}/search/?&q={word_to_search}&quick=1&type=videobox_video&nodes=11",
|
|
60
|
-
headers={'user-agent': get_userAgent()},
|
|
61
|
-
timeout=max_timeout
|
|
62
|
-
)
|
|
57
|
+
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
|
63
58
|
response.raise_for_status()
|
|
64
59
|
|
|
65
60
|
except Exception as e:
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
from urllib.parse import quote_plus
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
# External library
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.prompt import Prompt
|
|
9
|
+
|
|
10
|
+
|
|
6
11
|
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util.console import console, msg
|
|
8
12
|
from StreamingCommunity.Api.Template import get_select_title
|
|
13
|
+
from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
9
14
|
|
|
10
15
|
|
|
11
16
|
# Logic class
|
|
12
|
-
from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
13
17
|
from .site import title_search, media_search_manager, table_show_manager
|
|
14
18
|
from .series import download_series
|
|
15
19
|
|
|
@@ -21,6 +25,9 @@ _deprecate = False
|
|
|
21
25
|
_priority = 2
|
|
22
26
|
_engineDownload = "hls"
|
|
23
27
|
|
|
28
|
+
msg = Prompt()
|
|
29
|
+
console = Console()
|
|
30
|
+
|
|
24
31
|
|
|
25
32
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
26
33
|
"""
|
|
@@ -4,8 +4,12 @@ import os
|
|
|
4
4
|
from typing import Tuple
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
# External library
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.prompt import Prompt
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
# Internal utilities
|
|
8
|
-
from StreamingCommunity.Util.console import console, msg
|
|
9
13
|
from StreamingCommunity.Util.message import start_message
|
|
10
14
|
from StreamingCommunity.Lib.Downloader import HLS_Downloader
|
|
11
15
|
|
|
@@ -28,6 +32,10 @@ from .util.ScrapeSerie import GetSerieInfo
|
|
|
28
32
|
from StreamingCommunity.Api.Player.supervideo import VideoSource
|
|
29
33
|
|
|
30
34
|
|
|
35
|
+
# Variable
|
|
36
|
+
msg = Prompt()
|
|
37
|
+
console = Console()
|
|
38
|
+
|
|
31
39
|
|
|
32
40
|
def download_video(index_season_selected: int, index_episode_selected: int, scape_info_serie: GetSerieInfo) -> Tuple[str,bool]:
|
|
33
41
|
"""
|
|
@@ -64,13 +72,10 @@ def download_video(index_season_selected: int, index_episode_selected: int, scap
|
|
|
64
72
|
m3u8_url=master_playlist,
|
|
65
73
|
output_path=os.path.join(mp4_path, mp4_name)
|
|
66
74
|
).start()
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
os.remove(r_proc['path'])
|
|
72
|
-
except:
|
|
73
|
-
pass
|
|
75
|
+
|
|
76
|
+
if r_proc['error'] is not None:
|
|
77
|
+
try: os.remove(r_proc['path'])
|
|
78
|
+
except: pass
|
|
74
79
|
|
|
75
80
|
return r_proc['path'], r_proc['stopped']
|
|
76
81
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
# External libraries
|
|
6
7
|
import httpx
|
|
7
8
|
from bs4 import BeautifulSoup
|
|
8
|
-
|
|
9
|
+
from rich.console import Console
|
|
9
10
|
|
|
10
11
|
# Internal utilities
|
|
11
|
-
from StreamingCommunity.Util.
|
|
12
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
12
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
13
13
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
14
|
from StreamingCommunity.Util.table import TVShowManager
|
|
15
15
|
|
|
@@ -21,10 +21,11 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
# Variable
|
|
24
|
+
console = Console()
|
|
24
25
|
media_search_manager = MediaManager()
|
|
25
26
|
table_show_manager = TVShowManager()
|
|
26
27
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
27
|
-
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
def title_search(word_to_search: str) -> int:
|
|
@@ -40,25 +41,19 @@ def title_search(word_to_search: str) -> int:
|
|
|
40
41
|
media_search_manager.clear()
|
|
41
42
|
table_show_manager.clear()
|
|
42
43
|
|
|
43
|
-
#
|
|
44
|
-
domain_to_use = site_constant.
|
|
45
|
-
|
|
46
|
-
if not disable_searchDomain:
|
|
47
|
-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
44
|
+
# Check if domain is working
|
|
45
|
+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
48
46
|
|
|
49
47
|
if domain_to_use is None or base_url is None:
|
|
50
|
-
console.print("[bold red]
|
|
48
|
+
console.print("[bold red]Error: Unable to determine valid domain or base URL.[/bold red]")
|
|
51
49
|
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
|
|
52
50
|
sys.exit(1)
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
print(f"{
|
|
52
|
+
search_url = f"{site_constant.FULL_URL}/?story={word_to_search}&do=search&subaction=search"
|
|
53
|
+
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
|
54
|
+
|
|
56
55
|
try:
|
|
57
|
-
response = httpx.get(
|
|
58
|
-
url=f"{site_constant.FULL_URL}/?story={word_to_search}&do=search&subaction=search",
|
|
59
|
-
headers={'user-agent': get_userAgent()},
|
|
60
|
-
timeout=max_timeout
|
|
61
|
-
)
|
|
56
|
+
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
|
62
57
|
response.raise_for_status()
|
|
63
58
|
|
|
64
59
|
except Exception as e:
|
|
@@ -11,7 +11,7 @@ from bs4 import BeautifulSoup
|
|
|
11
11
|
|
|
12
12
|
# Internal utilities
|
|
13
13
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
|
-
from StreamingCommunity.Util.
|
|
14
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
# Logic class
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
from urllib.parse import quote_plus
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
from
|
|
6
|
+
# External library
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.prompt import Prompt, Confirm
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
# Logic class
|
|
@@ -20,6 +21,9 @@ _deprecate = False
|
|
|
20
21
|
_priority = 2
|
|
21
22
|
_engineDownload = "hls"
|
|
22
23
|
|
|
24
|
+
msg = Prompt()
|
|
25
|
+
console = Console()
|
|
26
|
+
|
|
23
27
|
|
|
24
28
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
25
29
|
"""
|
|
@@ -7,14 +7,14 @@ import logging
|
|
|
7
7
|
# External libraries
|
|
8
8
|
import httpx
|
|
9
9
|
from bs4 import BeautifulSoup
|
|
10
|
+
from rich.console import Console
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
# Internal utilities
|
|
13
|
-
from StreamingCommunity.Util.
|
|
14
|
-
from StreamingCommunity.Util.os import os_manager
|
|
14
|
+
from StreamingCommunity.Util.os import os_manager, get_call_stack
|
|
15
15
|
from StreamingCommunity.Util.message import start_message
|
|
16
16
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
17
|
-
from StreamingCommunity.Util.table import TVShowManager
|
|
17
|
+
from StreamingCommunity.Util.table import TVShowManager
|
|
18
18
|
from StreamingCommunity.Lib.Downloader import HLS_Downloader
|
|
19
19
|
|
|
20
20
|
|
|
@@ -27,6 +27,10 @@ from StreamingCommunity.Api.Template.config_loader import site_constant
|
|
|
27
27
|
from StreamingCommunity.Lib.TMBD import Json_film
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
# Variable
|
|
31
|
+
console = Console()
|
|
32
|
+
|
|
33
|
+
|
|
30
34
|
def download_film(movie_details: Json_film) -> str:
|
|
31
35
|
"""
|
|
32
36
|
Downloads a film using the provided tmbd id.
|
|
@@ -82,10 +86,8 @@ def download_film(movie_details: Json_film) -> str:
|
|
|
82
86
|
output_path=os.path.join(mp4_path, title_name)
|
|
83
87
|
).start()
|
|
84
88
|
|
|
85
|
-
if
|
|
86
|
-
try:
|
|
87
|
-
|
|
88
|
-
except:
|
|
89
|
-
pass
|
|
89
|
+
if r_proc['error'] is not None:
|
|
90
|
+
try: os.remove(r_proc['path'])
|
|
91
|
+
except: pass
|
|
90
92
|
|
|
91
93
|
return r_proc['path']
|
|
@@ -5,8 +5,12 @@ import subprocess
|
|
|
5
5
|
from urllib.parse import quote_plus
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
# External library
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
from rich.prompt import Prompt
|
|
11
|
+
|
|
12
|
+
|
|
8
13
|
# Internal utilities
|
|
9
|
-
from StreamingCommunity.Util.console import console, msg
|
|
10
14
|
from StreamingCommunity.Api.Template import get_select_title
|
|
11
15
|
from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
|
|
12
16
|
|
|
@@ -25,6 +29,9 @@ _deprecate = False
|
|
|
25
29
|
_priority = 1
|
|
26
30
|
_engineDownload = "hls"
|
|
27
31
|
|
|
32
|
+
msg = Prompt()
|
|
33
|
+
console = Console()
|
|
34
|
+
|
|
28
35
|
|
|
29
36
|
def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
30
37
|
"""
|
|
@@ -38,7 +45,7 @@ def search(string_to_search: str = None, get_onylDatabase: bool = False):
|
|
|
38
45
|
# Chiedi la scelta all'utente con il bot Telegram
|
|
39
46
|
string_to_search = bot.ask(
|
|
40
47
|
"key_search",
|
|
41
|
-
f"Inserisci la parola da cercare\noppure
|
|
48
|
+
f"Inserisci la parola da cercare\noppure back per tornare alla scelta: ",
|
|
42
49
|
None
|
|
43
50
|
)
|
|
44
51
|
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
# External library
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
# Internal utilities
|
|
7
|
-
from StreamingCommunity.Util.console import console
|
|
8
11
|
from StreamingCommunity.Util.os import os_manager
|
|
9
12
|
from StreamingCommunity.Util.message import start_message
|
|
10
13
|
from StreamingCommunity.Lib.Downloader import HLS_Downloader
|
|
@@ -20,6 +23,10 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
|
|
20
23
|
from StreamingCommunity.Api.Player.vixcloud import VideoSource
|
|
21
24
|
|
|
22
25
|
|
|
26
|
+
# Variable
|
|
27
|
+
console = Console()
|
|
28
|
+
|
|
29
|
+
|
|
23
30
|
def download_film(select_title: MediaItem) -> str:
|
|
24
31
|
"""
|
|
25
32
|
Downloads a film using the provided film ID, title name, and domain.
|
|
@@ -73,10 +80,8 @@ def download_film(select_title: MediaItem) -> str:
|
|
|
73
80
|
if script_id != "unknown":
|
|
74
81
|
TelegramSession.deleteScriptId(script_id)
|
|
75
82
|
|
|
76
|
-
if
|
|
77
|
-
try:
|
|
78
|
-
|
|
79
|
-
except:
|
|
80
|
-
pass
|
|
83
|
+
if r_proc['error'] is not None:
|
|
84
|
+
try: os.remove(r_proc['path'])
|
|
85
|
+
except: pass
|
|
81
86
|
|
|
82
87
|
return r_proc['path']
|
|
@@ -4,14 +4,18 @@ import os
|
|
|
4
4
|
from typing import Tuple
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
# External library
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.prompt import Prompt
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
# Internal utilities
|
|
8
|
-
from StreamingCommunity.Util.console import console, msg
|
|
9
13
|
from StreamingCommunity.Util.message import start_message
|
|
10
14
|
from StreamingCommunity.Lib.Downloader import HLS_Downloader
|
|
11
15
|
from StreamingCommunity.TelegramHelp.telegram_bot import TelegramSession, get_bot_instance
|
|
12
16
|
|
|
13
17
|
# Logic class
|
|
14
|
-
from .util.ScrapeSerie import
|
|
18
|
+
from .util.ScrapeSerie import GetSerieInfo
|
|
15
19
|
from StreamingCommunity.Api.Template.Util import (
|
|
16
20
|
manage_selection,
|
|
17
21
|
map_episode_title,
|
|
@@ -28,7 +32,12 @@ from StreamingCommunity.Api.Template.Class.SearchType import MediaItem
|
|
|
28
32
|
from StreamingCommunity.Api.Player.vixcloud import VideoSource
|
|
29
33
|
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
# Variable
|
|
36
|
+
msg = Prompt()
|
|
37
|
+
console = Console()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def download_video(index_season_selected: int, index_episode_selected: int, scrape_serie: GetSerieInfo, video_source: VideoSource) -> Tuple[str,bool]:
|
|
32
41
|
"""
|
|
33
42
|
Download a single episode video.
|
|
34
43
|
|
|
@@ -77,15 +86,13 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
|
|
|
77
86
|
output_path=os.path.join(mp4_path, mp4_name)
|
|
78
87
|
).start()
|
|
79
88
|
|
|
80
|
-
if
|
|
81
|
-
try:
|
|
82
|
-
|
|
83
|
-
except:
|
|
84
|
-
pass
|
|
89
|
+
if r_proc['error'] is not None:
|
|
90
|
+
try: os.remove(r_proc['path'])
|
|
91
|
+
except: pass
|
|
85
92
|
|
|
86
93
|
return r_proc['path'], r_proc['stopped']
|
|
87
94
|
|
|
88
|
-
def download_episode(index_season_selected: int, scrape_serie:
|
|
95
|
+
def download_episode(index_season_selected: int, scrape_serie: GetSerieInfo, video_source: VideoSource, download_all: bool = False) -> None:
|
|
89
96
|
"""
|
|
90
97
|
Download episodes of a selected season.
|
|
91
98
|
|
|
@@ -147,7 +154,7 @@ def download_series(select_season: MediaItem) -> None:
|
|
|
147
154
|
start_message()
|
|
148
155
|
|
|
149
156
|
# Init class
|
|
150
|
-
scrape_serie =
|
|
157
|
+
scrape_serie = GetSerieInfo(site_constant.FULL_URL)
|
|
151
158
|
video_source = VideoSource(site_constant.FULL_URL, True)
|
|
152
159
|
|
|
153
160
|
# Setup video source
|
|
@@ -5,11 +5,11 @@ import sys
|
|
|
5
5
|
|
|
6
6
|
# External libraries
|
|
7
7
|
import httpx
|
|
8
|
+
from rich.console import Console
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
# Internal utilities
|
|
11
|
-
from StreamingCommunity.Util.
|
|
12
|
-
from StreamingCommunity.Util._jsonConfig import config_manager
|
|
12
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
13
13
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
14
|
from StreamingCommunity.Util.table import TVShowManager
|
|
15
15
|
from StreamingCommunity.TelegramHelp.telegram_bot import get_bot_instance
|
|
@@ -21,12 +21,11 @@ from StreamingCommunity.Api.Template.Util import search_domain
|
|
|
21
21
|
from StreamingCommunity.Api.Template.Class.SearchType import MediaManager
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
# Variable
|
|
25
|
+
console = Console()
|
|
26
26
|
media_search_manager = MediaManager()
|
|
27
27
|
table_show_manager = TVShowManager()
|
|
28
28
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
29
|
-
disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
def title_search(title_search: str) -> int:
|
|
@@ -39,13 +38,10 @@ def title_search(title_search: str) -> int:
|
|
|
39
38
|
Returns:
|
|
40
39
|
int: The number of titles found.
|
|
41
40
|
"""
|
|
42
|
-
domain_to_use = site_constant
|
|
43
|
-
|
|
44
|
-
if not disable_searchDomain:
|
|
45
|
-
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
41
|
+
domain_to_use, base_url = search_domain(site_constant.SITE_NAME, site_constant.FULL_URL)
|
|
46
42
|
|
|
47
43
|
if domain_to_use is None or base_url is None:
|
|
48
|
-
console.print("[bold red]
|
|
44
|
+
console.print("[bold red]Error: Unable to determine valid domain or base URL.[/bold red]")
|
|
49
45
|
console.print("[yellow]The service might be temporarily unavailable or the domain may have changed.[/yellow]")
|
|
50
46
|
sys.exit(1)
|
|
51
47
|
|
|
@@ -54,13 +50,12 @@ def title_search(title_search: str) -> int:
|
|
|
54
50
|
|
|
55
51
|
media_search_manager.clear()
|
|
56
52
|
table_show_manager.clear()
|
|
57
|
-
|
|
53
|
+
|
|
54
|
+
search_url = f"{site_constant.FULL_URL}/api/search?q={title_search}"
|
|
55
|
+
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
|
56
|
+
|
|
58
57
|
try:
|
|
59
|
-
response = httpx.get(
|
|
60
|
-
url=f"{site_constant.FULL_URL}/api/search?q={title_search.replace(' ', '+')}",
|
|
61
|
-
headers={'user-agent': get_userAgent()},
|
|
62
|
-
timeout=max_timeout
|
|
63
|
-
)
|
|
58
|
+
response = httpx.get(search_url, headers={'user-agent': get_userAgent()}, timeout=max_timeout, follow_redirects=True)
|
|
64
59
|
response.raise_for_status()
|
|
65
60
|
|
|
66
61
|
except Exception as e:
|
|
@@ -11,7 +11,7 @@ from bs4 import BeautifulSoup
|
|
|
11
11
|
|
|
12
12
|
# Internal utilities
|
|
13
13
|
from StreamingCommunity.Util.headers import get_userAgent
|
|
14
|
-
from StreamingCommunity.Util.
|
|
14
|
+
from StreamingCommunity.Util.config_json import config_manager
|
|
15
15
|
from StreamingCommunity.Api.Player.Helper.Vixcloud.util import Season, EpisodeManager
|
|
16
16
|
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ from StreamingCommunity.Api.Player.Helper.Vixcloud.util import Season, EpisodeMa
|
|
|
19
19
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class
|
|
22
|
+
class GetSerieInfo:
|
|
23
23
|
def __init__(self, url):
|
|
24
24
|
"""
|
|
25
25
|
Initialize the ScrapeSerie class for scraping TV series information.
|