diff --git a/Src/Api/Animeunity/Core/Vix_player/player.py b/Src/Api/Animeunity/Core/Player/vixcloud.py similarity index 92% rename from Src/Api/Animeunity/Core/Vix_player/player.py rename to Src/Api/Animeunity/Core/Player/vixcloud.py index c977888..dd6192c 100644 --- a/Src/Api/Animeunity/Core/Vix_player/player.py +++ b/Src/Api/Animeunity/Core/Player/vixcloud.py @@ -50,24 +50,7 @@ class VideoSource: self.series_name = series_name self.obj_title_manager: TitleManager = TitleManager() self.obj_episode_manager: EpisodeManager = EpisodeManager() - - def get_preview(self) -> None: - """ - Retrieves preview information of a media-id - """ - - try: - response = requests.post(f"https://{self.base_name}.{self.domain}/api/titles/preview/{self.media_id}", headers = self.headers) - response.raise_for_status() - - # Collect all info about preview - self.obj_preview = PreviewManager(response.json()) - - except Exception as e: - logging.error(f"Error collecting preview info: {e}") - raise - def get_count_episodes(self): """ Fetches the total count of episodes available for the anime. diff --git a/Src/Api/Animeunity/anime.py b/Src/Api/Animeunity/anime.py index 26a6357..35ac2d6 100644 --- a/Src/Api/Animeunity/anime.py +++ b/Src/Api/Animeunity/anime.py @@ -12,7 +12,7 @@ from Src.Util.message import start_message # Logic class -from .Core.Vix_player.player import VideoSource +from .Core.Player.vixcloud import VideoSource from .Core.Util import manage_selection diff --git a/Src/Api/Streamingcommunity/Core/Vix_player/player.py b/Src/Api/Streamingcommunity/Core/Player/vixcloud.py similarity index 93% rename from Src/Api/Streamingcommunity/Core/Vix_player/player.py rename to Src/Api/Streamingcommunity/Core/Player/vixcloud.py index cb26be4..1cbba36 100644 --- a/Src/Api/Streamingcommunity/Core/Vix_player/player.py +++ b/Src/Api/Streamingcommunity/Core/Player/vixcloud.py @@ -53,23 +53,6 @@ class VideoSource: self.obj_title_manager: TitleManager = TitleManager() self.obj_episode_manager: EpisodeManager = EpisodeManager() - def get_preview(self) -> None: - """ - Retrieves preview information of a media-id - """ - - try: - - response = requests.post(f"https://{self.base_name}.{self.domain}/api/titles/preview/{self.media_id}", headers=self.headers) - response.raise_for_status() - - # Collect all info about preview - self.obj_preview = PreviewManager(response.json()) - - except Exception as e: - logging.error(f"Error collecting preview info: {e}") - raise - def collect_info_seasons(self) -> None: """ Collect information about seasons. diff --git a/Src/Api/Streamingcommunity/film.py b/Src/Api/Streamingcommunity/film.py index 2b9d7bf..b71216f 100644 --- a/Src/Api/Streamingcommunity/film.py +++ b/Src/Api/Streamingcommunity/film.py @@ -13,7 +13,7 @@ from Src.Util.message import start_message # Logic class -from .Core.Vix_player.player import VideoSource +from .Core.Player.vixcloud import VideoSource # Config diff --git a/Src/Api/Streamingcommunity/series.py b/Src/Api/Streamingcommunity/series.py index 9b2ecc0..a30e847 100644 --- a/Src/Api/Streamingcommunity/series.py +++ b/Src/Api/Streamingcommunity/series.py @@ -14,7 +14,7 @@ from Src.Lib.Hls.downloader import Downloader # Logic class -from .Core.Vix_player.player import VideoSource +from .Core.Player.vixcloud import VideoSource from .Core.Util import manage_selection, map_episode_title diff --git a/Src/Lib/FFmpeg/command.py b/Src/Lib/FFmpeg/command.py index f3b85c1..aad5b46 100644 --- a/Src/Lib/FFmpeg/command.py +++ b/Src/Lib/FFmpeg/command.py @@ -21,7 +21,7 @@ from Src.Util.os import check_file_existence, suppress_output from Src.Util.console import console from .util import has_audio_stream, need_to_force_to_ts, check_ffmpeg_input, check_duration_v_a from .capture import capture_ffmpeg_real_time -from ..M3U8.parser import M3U8_Codec +from ..M3U8 import M3U8_Codec # Config diff --git a/Src/Lib/M3U8/__init__.py b/Src/Lib/M3U8/__init__.py index 08a541b..9037df3 100644 --- a/Src/Lib/M3U8/__init__.py +++ b/Src/Lib/M3U8/__init__.py @@ -1,6 +1,9 @@ -# 02.04.24 +# 09.06.24 -from .decryption import M3U8_Decryption -from .estimator import M3U8_Ts_Estimator -from .parser import M3U8_Parser, M3U8_Codec -from .url_fixer import M3U8_UrlFix \ No newline at end of file +from .helper import ( + M3U8_Decryption, + M3U8_Ts_Estimator, + M3U8_Parser, + M3U8_Codec, + M3U8_UrlFix +) \ No newline at end of file diff --git a/Src/Lib/M3U8/helper/__init__.py b/Src/Lib/M3U8/helper/__init__.py new file mode 100644 index 0000000..9888972 --- /dev/null +++ b/Src/Lib/M3U8/helper/__init__.py @@ -0,0 +1,6 @@ +# 02.04.24 + +from .decryptor import M3U8_Decryption +from .estimator import M3U8_Ts_Estimator +from .parser import M3U8_Parser, M3U8_Codec +from .url_fixer import M3U8_UrlFix \ No newline at end of file diff --git a/Src/Lib/M3U8/decryption.py b/Src/Lib/M3U8/helper/decryptor.py similarity index 100% rename from Src/Lib/M3U8/decryption.py rename to Src/Lib/M3U8/helper/decryptor.py diff --git a/Src/Lib/M3U8/estimator.py b/Src/Lib/M3U8/helper/estimator.py similarity index 100% rename from Src/Lib/M3U8/estimator.py rename to Src/Lib/M3U8/helper/estimator.py diff --git a/Src/Lib/M3U8/parser.py b/Src/Lib/M3U8/helper/parser.py similarity index 99% rename from Src/Lib/M3U8/parser.py rename to Src/Lib/M3U8/helper/parser.py index bf364eb..0554164 100644 --- a/Src/Lib/M3U8/parser.py +++ b/Src/Lib/M3U8/helper/parser.py @@ -4,7 +4,7 @@ import logging # Internal utilities -from .lib_parser import load +from ..parser import load # External libraries diff --git a/Src/Lib/M3U8/url_fixer.py b/Src/Lib/M3U8/helper/url_fixer.py similarity index 100% rename from Src/Lib/M3U8/url_fixer.py rename to Src/Lib/M3U8/helper/url_fixer.py diff --git a/Src/Lib/M3U8/lib_parser/__init__.py b/Src/Lib/M3U8/parser/__init__.py similarity index 100% rename from Src/Lib/M3U8/lib_parser/__init__.py rename to Src/Lib/M3U8/parser/__init__.py diff --git a/Src/Lib/M3U8/lib_parser/_util.py b/Src/Lib/M3U8/parser/_util.py similarity index 100% rename from Src/Lib/M3U8/lib_parser/_util.py rename to Src/Lib/M3U8/parser/_util.py diff --git a/Src/Lib/M3U8/lib_parser/model.py b/Src/Lib/M3U8/parser/model.py similarity index 99% rename from Src/Lib/M3U8/lib_parser/model.py rename to Src/Lib/M3U8/parser/model.py index c1a89ef..035e636 100644 --- a/Src/Lib/M3U8/lib_parser/model.py +++ b/Src/Lib/M3U8/parser/model.py @@ -5,7 +5,7 @@ from collections import namedtuple # Internal utilities -from ..lib_parser import parser +from ..parser import parser # Variable @@ -13,7 +13,6 @@ StreamInfo = namedtuple('StreamInfo', ['bandwidth', 'program_id', 'resolution', Media = namedtuple('Media', ['uri', 'type', 'group_id', 'language', 'name','default', 'autoselect', 'forced', 'characteristics']) - class M3U8: """ Represents a single M3U8 playlist. Should be instantiated with the content as string. diff --git a/Src/Lib/M3U8/lib_parser/parser.py b/Src/Lib/M3U8/parser/parser.py similarity index 99% rename from Src/Lib/M3U8/lib_parser/parser.py rename to Src/Lib/M3U8/parser/parser.py index dd49f96..d7c666d 100644 --- a/Src/Lib/M3U8/lib_parser/parser.py +++ b/Src/Lib/M3U8/parser/parser.py @@ -6,7 +6,7 @@ import datetime # Internal utilities -from ..lib_parser import protocol +from ..parser import protocol from ._util import ( remove_quotes, remove_quotes_parser, diff --git a/Src/Lib/M3U8/lib_parser/protocol.py b/Src/Lib/M3U8/parser/protocol.py similarity index 100% rename from Src/Lib/M3U8/lib_parser/protocol.py rename to Src/Lib/M3U8/parser/protocol.py diff --git a/Test/t_m3u8_parser.py b/Test/t_m3u8_parser.py index c6468e5..e57010e 100644 --- a/Test/t_m3u8_parser.py +++ b/Test/t_m3u8_parser.py @@ -13,13 +13,11 @@ def read_file(file_path): return m3u8_content - # Import -from Src.Lib.M3U8.lib_parser import M3U8 +from Src.Lib.M3U8.parser import M3U8 from Src.Lib.M3U8 import M3U8_Parser - # Test data obj_m3u8_parser = M3U8_Parser() base_path_file = os.path.join('Test', 'data', 'm3u8') diff --git a/config.json b/config.json index 3ac1b38..4399826 100644 --- a/config.json +++ b/config.json @@ -17,7 +17,7 @@ "proxy": [] }, "M3U8_DOWNLOAD": { - "tdqm_workers": 4, + "tdqm_workers": 3, "tqdm_delay": 0.01, "tqdm_use_large_bar": true, "download_video": true, diff --git a/requirements.txt b/requirements.txt index d9a07e1..6001546 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ requests bs4 -certifi -tqdm rich +tqdm unidecode fake-useragent \ No newline at end of file