From 80393c614765d883c7acfc1be53612e338410e47 Mon Sep 17 00:00:00 2001 From: Ghost <62809003+Ghost6446@users.noreply.github.com> Date: Mon, 27 May 2024 18:57:40 +0200 Subject: [PATCH] Update reame and config file. --- README.md | 72 +++++++++++++++++++++++--- Src/Api/Altadefinizione/__init__.py | 2 - Src/Api/Streamingcommunity/__init__.py | 3 -- Src/Lib/E_Table/__init__.py | 3 +- Src/Lib/E_Table/sql_table.py | 11 +--- Src/Lib/Hls/downloader.py | 4 +- Src/Lib/Hls/segments.py | 1 + config.json | 11 ++-- 8 files changed, 77 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 76bddf9..8351c86 100644 --- a/README.md +++ b/README.md @@ -56,15 +56,37 @@ You can change some behaviors by tweaking the configuration file.
DEFAULT + * **debug**: Enables or disables debug mode. + - **Default Value**: `false` + + * **log_file**: The file where logs will be written. + - **Default Value**: `app.log` + + * **clean_console**: Clears the console before the script runs. + - **Default Value**: `true` + * **root_path**: Path where the script will add movies and TV series folders (see [Path Examples](#Path-examples)). - - **Default Value**: `media/streamingcommunity` + - **Default Value**: `Video` + + * **map_episode_name**: Mapping to choose the name of all episodes of TV Shows (see [Episode Name Usage](#Episode-name-usage)). + - **Default Value**: `%(tv_name)_S%(season)E%(episode)_%(episode_name)` * **not_close**: When activated, prevents the script from closing after its initial execution, allowing it to restart automatically after completing the first run. - **Default Value**: `false` - * **map_episode_name**: Mapping to choose the name of all episodes of TV Shows (see [Episode Name Usage](#Episode-name-usage)). - - **Default Value**: `%(episode_name)` - - **Example Value**: `%(tv_name) [S%(season)] [E%(episode)] %(episode_name)` +
+ +
+ SITE + + * **streamingcommunity**: Configuration value for streamingcommunity site. + - **Default Value**: `foo` + + * **animeunity**: Configuration value for animeunity site. + - **Default Value**: `to` + + * **altadefinizione**: Configuration value for altadefinizione site. + - **Default Value**: `food`
@@ -72,7 +94,7 @@ You can change some behaviors by tweaking the configuration file. M3U8_DOWNLOAD * **tdqm_workers**: The number of workers that will cooperate to download .ts files. **A high value may slow down your PC** - - **Default Value**: `20` + - **Default Value**: `30` * **tqdm_show_progress**: Whether to show progress during downloads or not. - **Default Value**: `true` @@ -85,15 +107,53 @@ You can change some behaviors by tweaking the configuration file.
M3U8_FILTER + * **use_codec**: Whether to use a specific codec for processing. + - **Default Value**: `false` + + * **use_gpu**: Whether to use GPU acceleration. + - **Default Value**: `false` + + * **default_preset**: The default preset for ffmpeg conversion. + - **Default Value**: `ultrafast` + + * **check_output_conversion**: Verify if the conversion run by ffmpeg is free from corruption. + - **Default Value**: `false` + * **cleanup_tmp_folder**: Upon final conversion, ensures the removal of all unformatted audio, video tracks, and subtitles from the temporary folder, thereby maintaining cleanliness and efficiency. - **Default Value**: `true` * **specific_list_audio**: A list of specific audio languages to download. - **Example Value**: `['ara', 'baq', 'cat', 'chi', 'cze', 'dan', 'dut', 'eng', 'fil', 'fin', 'forced-ita', 'fre', 'ger', 'glg', 'gre', 'heb', 'hin', 'hun', 'ind', 'ita', 'jpn', 'kan', 'kor', 'mal', 'may', 'nob', 'nor', 'pol', 'por', 'rum', 'rus', 'spa', 'swe', 'tam', 'tel', 'tha', 'tur', 'ukr', 'vie']` - * **check_output_conversion**: Verify if the conversion run by ffmpeg is free from corruption. + * **specific_list_subtitles**: A list of specific subtitle languages to download. + - **Example Value**: `['eng']` + +
+ +
+ M3U8_REQUESTS + + * **disable_error**: Whether to disable error messages. - **Default Value**: `false` + * **timeout**: The timeout value for requests. + - **Default Value**: `10` + + * **verify_ssl**: Whether to verify SSL certificates. + - **Default Value**: `false` + +
+ +
+ M3U8_PARSER + + * **skip_empty_row_playlist**: Whether to skip empty rows in the playlist m3u8. + - **Default Value**: `false` + + * **force_resolution**: Forces the use of a specific resolution. `-1` means no forced resolution. + - **Default Value**: `-1` + - **Example Value**: `1080` +
diff --git a/Src/Api/Altadefinizione/__init__.py b/Src/Api/Altadefinizione/__init__.py index c64423d..901aa5f 100644 --- a/Src/Api/Altadefinizione/__init__.py +++ b/Src/Api/Altadefinizione/__init__.py @@ -34,5 +34,3 @@ def main_film(): url=select_title.url ) - # End - console.print("\n[red]Done") diff --git a/Src/Api/Streamingcommunity/__init__.py b/Src/Api/Streamingcommunity/__init__.py index a28e32a..e09b288 100644 --- a/Src/Api/Streamingcommunity/__init__.py +++ b/Src/Api/Streamingcommunity/__init__.py @@ -53,6 +53,3 @@ def main_film_series(): # If no media find else: console.print("[red]Cant find a single element") - - # End - console.print("\n[red]Done") \ No newline at end of file diff --git a/Src/Lib/E_Table/__init__.py b/Src/Lib/E_Table/__init__.py index 8bc03f3..e61ffb3 100644 --- a/Src/Lib/E_Table/__init__.py +++ b/Src/Lib/E_Table/__init__.py @@ -1,5 +1,4 @@ # 20.05.24 -from .sql_table import SimpleDBManager, report_table, job_database +from .sql_table import SimpleDBManager, report_table report_table: SimpleDBManager = report_table -job_database: SimpleDBManager = job_database diff --git a/Src/Lib/E_Table/sql_table.py b/Src/Lib/E_Table/sql_table.py index 728f0ab..6a10393 100644 --- a/Src/Lib/E_Table/sql_table.py +++ b/Src/Lib/E_Table/sql_table.py @@ -10,7 +10,6 @@ from Src.Util._jsonConfig import config_manager # Variable CREATE_REPORT = config_manager.get_bool('M3U8_DOWNLOAD', 'create_report') -CREATE_JOB_DB = config_manager.get_bool('DEFAULT', 'create_job_database') class SimpleDBManager: @@ -210,12 +209,4 @@ if CREATE_REPORT: report_table.load_database() report_table.save_database() else: - report_table = None - - -if CREATE_JOB_DB: - job_database = SimpleDBManager("Job_database.csv", ["Id", "Name", "Season_n"]) - job_database.load_database() - job_database.save_database() -else: - job_database = None \ No newline at end of file + report_table = None \ No newline at end of file diff --git a/Src/Lib/Hls/downloader.py b/Src/Lib/Hls/downloader.py index 2eb6005..6c41f82 100644 --- a/Src/Lib/Hls/downloader.py +++ b/Src/Lib/Hls/downloader.py @@ -460,9 +460,11 @@ class Downloader(): # Rename the output file to the desired output filename if not exist if not os.path.exists(self.output_filename): + + # Rename file converted to original set in init os.rename(out_path, self.output_filename) - print("\n") + # Print size of the file console.print(Panel(f"[bold green]Download completed![/bold green]\nFile size: [bold]{format_size(os.path.getsize(self.output_filename))}[/bold]", title=f"{os.path.basename(self.output_filename.replace('.mp4', ''))}", border_style="green")) # Delete all files except the output file diff --git a/Src/Lib/Hls/segments.py b/Src/Lib/Hls/segments.py index 18075fe..43b184f 100644 --- a/Src/Lib/Hls/segments.py +++ b/Src/Lib/Hls/segments.py @@ -302,6 +302,7 @@ class M3U8_Segments: ascii=' #', bar_format=f"{Colors.YELLOW}Downloading {Colors.WHITE}({add_desc}{Colors.WHITE}): {Colors.RED}{{percentage:.2f}}% {Colors.MAGENTA}{{bar}} {Colors.YELLOW}{{elapsed}} {Colors.WHITE}< {Colors.CYAN}{{remaining}}{{postfix}} {Colors.WHITE}]", dynamic_ncols=True, + ncols=80, mininterval=0.01 ) diff --git a/config.json b/config.json index 8e23ec8..1102a5e 100644 --- a/config.json +++ b/config.json @@ -7,14 +7,8 @@ "clean_console": true, "root_path": "Video", "map_episode_name": "%(tv_name)_S%(season)E%(episode)_%(episode_name)", - "create_job_database": false, "not_close": false }, - "SITE": { - "streamingcommunity": "foo", - "animeunity": "to", - "altadefinizione": "food" - }, "M3U8_DOWNLOAD": { "tdqm_workers": 30, "tqdm_show_progress": true, @@ -39,5 +33,10 @@ "M3U8_PARSER": { "skip_empty_row_playlist": false, "force_resolution": -1 + }, + "SITE": { + "streamingcommunity": "foo", + "animeunity": "to", + "altadefinizione": "food" } } \ No newline at end of file