StreamingCommunity 2.7.0__py3-none-any.whl → 2.8.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.

Files changed (71) hide show
  1. StreamingCommunity/Api/Player/ddl.py +2 -2
  2. StreamingCommunity/Api/Player/maxstream.py +7 -13
  3. StreamingCommunity/Api/Player/supervideo.py +7 -33
  4. StreamingCommunity/Api/Player/vixcloud.py +8 -80
  5. StreamingCommunity/Api/Site/1337xx/__init__.py +8 -1
  6. StreamingCommunity/Api/Site/1337xx/site.py +10 -16
  7. StreamingCommunity/Api/Site/1337xx/title.py +4 -1
  8. StreamingCommunity/Api/Site/animeunity/__init__.py +9 -2
  9. StreamingCommunity/Api/Site/animeunity/film_serie.py +7 -1
  10. StreamingCommunity/Api/Site/animeunity/site.py +8 -10
  11. StreamingCommunity/Api/Site/animeunity/util/ScrapeSerie.py +1 -1
  12. StreamingCommunity/Api/Site/cb01new/__init__.py +8 -1
  13. StreamingCommunity/Api/Site/cb01new/film.py +7 -1
  14. StreamingCommunity/Api/Site/cb01new/site.py +16 -15
  15. StreamingCommunity/Api/Site/ddlstreamitaly/__init__.py +9 -2
  16. StreamingCommunity/Api/Site/ddlstreamitaly/series.py +7 -1
  17. StreamingCommunity/Api/Site/ddlstreamitaly/site.py +10 -15
  18. StreamingCommunity/Api/Site/ddlstreamitaly/util/ScrapeSerie.py +1 -1
  19. StreamingCommunity/Api/Site/guardaserie/__init__.py +9 -2
  20. StreamingCommunity/Api/Site/guardaserie/series.py +9 -1
  21. StreamingCommunity/Api/Site/guardaserie/site.py +12 -17
  22. StreamingCommunity/Api/Site/guardaserie/util/ScrapeSerie.py +1 -1
  23. StreamingCommunity/Api/Site/mostraguarda/__init__.py +6 -2
  24. StreamingCommunity/Api/Site/mostraguarda/film.py +7 -3
  25. StreamingCommunity/Api/Site/streamingcommunity/__init__.py +9 -2
  26. StreamingCommunity/Api/Site/streamingcommunity/film.py +8 -1
  27. StreamingCommunity/Api/Site/streamingcommunity/series.py +14 -5
  28. StreamingCommunity/Api/Site/streamingcommunity/site.py +10 -15
  29. StreamingCommunity/Api/Site/streamingcommunity/util/ScrapeSerie.py +2 -2
  30. StreamingCommunity/Api/Template/Util/__init__.py +0 -1
  31. StreamingCommunity/Api/Template/Util/get_domain.py +24 -66
  32. StreamingCommunity/Api/Template/Util/manage_ep.py +10 -5
  33. StreamingCommunity/Api/Template/config_loader.py +8 -8
  34. StreamingCommunity/Api/Template/site.py +3 -6
  35. StreamingCommunity/Lib/Downloader/HLS/downloader.py +10 -13
  36. StreamingCommunity/Lib/Downloader/HLS/segments.py +11 -31
  37. StreamingCommunity/Lib/Downloader/MP4/downloader.py +12 -9
  38. StreamingCommunity/Lib/Downloader/TOR/downloader.py +109 -101
  39. StreamingCommunity/Lib/FFmpeg/__init__.py +1 -1
  40. StreamingCommunity/Lib/FFmpeg/capture.py +10 -12
  41. StreamingCommunity/Lib/FFmpeg/command.py +15 -14
  42. StreamingCommunity/Lib/FFmpeg/util.py +9 -38
  43. StreamingCommunity/Lib/M3U8/decryptor.py +72 -146
  44. StreamingCommunity/Lib/M3U8/estimator.py +8 -16
  45. StreamingCommunity/Lib/M3U8/parser.py +1 -17
  46. StreamingCommunity/Lib/M3U8/url_fixer.py +1 -4
  47. StreamingCommunity/Lib/TMBD/__init__.py +2 -0
  48. StreamingCommunity/Lib/TMBD/obj_tmbd.py +3 -17
  49. StreamingCommunity/Lib/TMBD/tmdb.py +4 -9
  50. StreamingCommunity/TelegramHelp/telegram_bot.py +50 -50
  51. StreamingCommunity/Upload/update.py +3 -2
  52. StreamingCommunity/Upload/version.py +1 -1
  53. StreamingCommunity/Util/color.py +1 -1
  54. StreamingCommunity/Util/{_jsonConfig.py → config_json.py} +148 -54
  55. StreamingCommunity/Util/headers.py +2 -38
  56. StreamingCommunity/Util/logger.py +72 -42
  57. StreamingCommunity/Util/message.py +8 -3
  58. StreamingCommunity/Util/os.py +41 -93
  59. StreamingCommunity/Util/table.py +8 -17
  60. StreamingCommunity/run.py +26 -34
  61. {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/METADATA +165 -92
  62. StreamingCommunity-2.8.0.dist-info/RECORD +75 -0
  63. StreamingCommunity/Api/Template/Util/recall_search.py +0 -37
  64. StreamingCommunity/Lib/Downloader/HLS/proxyes.py +0 -110
  65. StreamingCommunity/Util/call_stack.py +0 -42
  66. StreamingCommunity/Util/console.py +0 -12
  67. StreamingCommunity-2.7.0.dist-info/RECORD +0 -79
  68. {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/LICENSE +0 -0
  69. {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/WHEEL +0 -0
  70. {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/entry_points.txt +0 -0
  71. {StreamingCommunity-2.7.0.dist-info → StreamingCommunity-2.8.0.dist-info}/top_level.txt +0 -0
@@ -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.console import console
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
- # Find new domain if prev dont work
46
- domain_to_use = site_constant.DOMAIN_NOW
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]Error: Unable to determine valid domain or base URL.[/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
- # Send request to search for titles
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:
@@ -11,7 +11,7 @@ from bs4 import BeautifulSoup
11
11
 
12
12
 
13
13
  # Internal utilities
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
 
17
17
 
@@ -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
  """
@@ -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.console import console
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
- disable_searchDomain = config_manager.get_bool("DEFAULT", "disable_searchDomain")
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
- # Find new domain if prev dont work
44
- domain_to_use = site_constant.DOMAIN_NOW
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]Error: Unable to determine valid domain or base URL.[/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
- # Send request to search for titles
55
- print(f"{site_constant.FULL_URL}/?story={word_to_search}&do=search&subaction=search")
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._jsonConfig import config_manager
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
- # Internal utilities
7
- from StreamingCommunity.Util.console import console, msg
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.console import console
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, get_call_stack
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.
@@ -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 🔙 back per tornare alla scelta: ",
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.
@@ -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 ScrapeSerie
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
- def download_video(index_season_selected: int, index_episode_selected: int, scrape_serie: ScrapeSerie, video_source: VideoSource) -> Tuple[str,bool]:
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
 
@@ -85,7 +94,7 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
85
94
 
86
95
  return r_proc['path'], r_proc['stopped']
87
96
 
88
- def download_episode(index_season_selected: int, scrape_serie: ScrapeSerie, video_source: VideoSource, download_all: bool = False) -> None:
97
+ def download_episode(index_season_selected: int, scrape_serie: GetSerieInfo, video_source: VideoSource, download_all: bool = False) -> None:
89
98
  """
90
99
  Download episodes of a selected season.
91
100
 
@@ -147,7 +156,7 @@ def download_series(select_season: MediaItem) -> None:
147
156
  start_message()
148
157
 
149
158
  # Init class
150
- scrape_serie = ScrapeSerie(site_constant.FULL_URL)
159
+ scrape_serie = GetSerieInfo(site_constant.FULL_URL)
151
160
  video_source = VideoSource(site_constant.FULL_URL, True)
152
161
 
153
162
  # 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.console import console
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]Error: Unable to determine valid domain or base URL.[/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._jsonConfig import config_manager
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 ScrapeSerie:
22
+ class GetSerieInfo:
23
23
  def __init__(self, url):
24
24
  """
25
25
  Initialize the ScrapeSerie class for scraping TV series information.
@@ -1,6 +1,5 @@
1
1
  # 23.11.24
2
2
 
3
- from .recall_search import execute_search
4
3
  from .get_domain import search_domain
5
4
  from .manage_ep import (
6
5
  manage_selection,
@@ -1,20 +1,24 @@
1
1
  # 18.06.24
2
2
 
3
- import ssl
4
- import time
3
+ import certifi
5
4
  from urllib.parse import urlparse, unquote
6
5
 
7
6
 
8
7
  # External libraries
9
8
  import httpx
9
+ from rich.console import Console
10
10
 
11
11
 
12
12
  # Internal utilities
13
13
  from StreamingCommunity.Util.headers import get_headers
14
- from StreamingCommunity.Util.console import console
15
- from StreamingCommunity.Util._jsonConfig import config_manager
14
+ from StreamingCommunity.Util.config_json import config_manager
16
15
 
17
16
 
17
+ # Variable
18
+ console = Console()
19
+ VERIFY = config_manager.get("REQUESTS", "verify")
20
+ MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
21
+
18
22
 
19
23
  def get_tld(url_str):
20
24
  """Extract the TLD (Top-Level Domain) from the URL."""
@@ -50,16 +54,7 @@ def get_base_domain(url_str):
50
54
  except Exception:
51
55
  return None
52
56
 
53
- def get_base_url(url_str):
54
- """Extract base URL including protocol and domain, removing path and query parameters."""
55
- try:
56
- parsed = urlparse(url_str)
57
- return f"{parsed.scheme}://{parsed.netloc}"
58
-
59
- except Exception:
60
- return None
61
-
62
- def validate_url(url, base_url, max_timeout, max_retries=2, sleep=1):
57
+ def validate_url(url, base_url):
63
58
  """Validate if URL is accessible and matches expected base domain."""
64
59
  console.print(f"\n[cyan]Starting validation for URL[white]: [yellow]{url}")
65
60
 
@@ -71,71 +66,34 @@ def validate_url(url, base_url, max_timeout, max_retries=2, sleep=1):
71
66
  console.print(f"[red]Domain structure mismatch: {url_domain} != {base_domain}")
72
67
  return False, None
73
68
 
74
- # Count dots to ensure we don't have extra subdomains
75
- base_dots = base_url.count('.')
76
- url_dots = url.count('.')
77
- if url_dots > base_dots + 1:
78
- console.print(f"[red]Too many subdomains in URL")
79
- return False, None
80
-
81
69
  client = httpx.Client(
82
- verify=False,
70
+ verify=VERIFY,
83
71
  headers=get_headers(),
84
- timeout=max_timeout
72
+ timeout=MAX_TIMEOUT
85
73
  )
86
74
 
87
- for retry in range(max_retries):
88
- try:
89
- time.sleep(sleep)
90
-
91
- # Initial check without redirects
92
- response = client.get(url, follow_redirects=False)
93
- if response.status_code == 403:
94
- console.print(f"[red]Check failed (403) - Attempt {retry + 1}/{max_retries}")
95
- continue
96
-
97
- if response.status_code >= 400:
98
- console.print(f"[red]Check failed: HTTP {response.status_code}")
99
- return False, None
100
-
101
- # Follow redirects and verify final domain
102
- final_response = client.get(url, follow_redirects=True)
103
- final_domain = get_base_domain(str(final_response.url))
104
- console.print(f"[cyan]Redirect url: [red]{final_response.url}")
105
-
106
- if final_domain != base_domain:
107
- console.print(f"[red]Final domain mismatch: {final_domain} != {base_domain}")
108
- return False, None
109
-
110
- new_tld = get_tld(str(final_response.url))
111
- if new_tld != get_tld(url):
112
- return True, new_tld
113
-
114
- return True, None
115
-
116
- except (httpx.RequestError, ssl.SSLError) as e:
117
- console.print(f"[red]Connection error: {str(e)}")
118
- time.sleep(sleep)
119
- continue
120
-
121
- return False, None
75
+ # Make request to web site
76
+ response = client.get(url, follow_redirects=False)
77
+
78
+ if response.status_code >= 400:
79
+ console.print(f"[red]Check failed: HTTP {response.status_code}")
80
+ console.print(f"[red]Response content: {response.text}")
81
+ return False, None
82
+
83
+ return True, base_domain
122
84
 
123
85
  def search_domain(site_name: str, base_url: str, get_first: bool = False):
124
- """Search for valid domain matching site name and base URL."""
125
- max_timeout = config_manager.get_int("REQUESTS", "timeout")
126
-
86
+ """Search for valid domain matching site name and base URL."""
127
87
  try:
128
- is_correct, redirect_tld = validate_url(base_url, base_url, max_timeout)
88
+ is_correct, redirect_tld = validate_url(base_url, base_url)
129
89
 
130
90
  if is_correct:
131
91
  tld = redirect_tld or get_tld(base_url)
132
- config_manager.configSite[site_name]['domain'] = tld
133
-
134
- console.print(f"[green]Successfully validated initial URL")
135
92
  return tld, base_url
136
93
 
137
94
  else:
138
95
  return None, None
139
96
 
140
97
  except Exception as e:
141
- console.print(f"[red]Error testing initial URL: {str(e)}")
98
+ console.print(f"[red]Error testing initial URL: {str(e)}")
99
+ return None, None
@@ -5,15 +5,21 @@ import logging
5
5
  from typing import List
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.Util.os import os_manager
11
- from StreamingCommunity.Util._jsonConfig import config_manager
15
+ from StreamingCommunity.Util.config_json import config_manager
12
16
  from StreamingCommunity.Util.table import TVShowManager
13
17
 
14
18
 
15
- # Config
16
- MAP_EPISODE = config_manager.get('DEFAULT', 'map_episode_name')
19
+ # Variable
20
+ msg = Prompt()
21
+ console = Console()
22
+ MAP_EPISODE = config_manager.get('OUT_FOLDER', 'map_episode_name')
17
23
 
18
24
 
19
25
  def dynamic_format_number(n: int) -> str:
@@ -195,7 +201,6 @@ def display_episodes_list(episodes_manager) -> str:
195
201
  """
196
202
  # Set up table for displaying episodes
197
203
  table_show_manager = TVShowManager()
198
- table_show_manager.set_slice_end(10)
199
204
 
200
205
  # Add columns to the table
201
206
  column_info = {