diff --git a/README.md b/README.md index e499d8f..a1c5437 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ You can chat, help improve this repo, or just hang around for some fun in the ** * [Requirement](#requirement) * [Usage](#usage) * [Update](#update) + * [Win 7](#win-7) * [CONFIGURATION](#Configuration) * [DOCKER](#docker) * [TUTORIAL](#tutorial) @@ -65,114 +66,138 @@ python update.py python3 update.py ``` +## Win 7 + +Windows 7 does not enforce TLS 1.2 by default, which can lead to security issues. Follow these steps to ensure TLS 1.2 is enabled: + +1. **Update Internet Explorer**: + - Ensure Internet Explorer is updated to the latest version (11). + ![Internet Explorer Update](./Src/Assets/win_7_install/explorer11.png) + +2. **Enable TLS 1.1 and TLS 1.2**: + - Open Internet Options. + - Go to Advanced settings. + - Check "Use TLS 1.1" and "Use TLS 1.2". + + ![Internet Options](./Src/Assets/win_7_install/internet_option.png) + + > [!IMPORTANT] + > If Internet Explorer is not updated, these Registry values won't take effect. Also, ensure update "KB3140245" is installed. + > Microsoft Knowledge Article: [KB3140245](https://support.microsoft.com/kb/3140245) + +3. **Update Windows**: + - Ensure all important updates, including up to the latest 2020 Cumulative updates, are installed. This ensures the OS Trusted Certificates Store is regularly updated by Microsoft servers. + +4. **Registry Configuration**: + - After installing all the latest Windows Updates, download and run the Microsoft Easy Fix tool linked in KB3140245 article ([download link](https://download.microsoft.com/download/0/6/5/0658B1A7-6D2E-474F-BC2C-D69E5B9E9A68/MicrosoftEasyFix51044.msi)). + - Alternatively, add the following values manually by copying and saving them as a `.reg` file: + +```bash + Windows Registry Editor Version 5.00 + + ; Make all protocols available + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp\] + DefaultSecureProtocols=DWORD:0xAA0 + + ; Make all protocols available + [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp\] + DefaultSecureProtocols=DWORD:0xAA0 + + ; TLS 1.1 + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] + DisabledByDefault=DWORD:0 + Enabled=dword:1 + + ; TLS 1.2 + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] + DisabledByDefault=DWORD:0 + Enabled=dword:1 +``` + +They should be added automatically by some .Net framework update, but in case the OS doesn't have them added already, you can put them manually, this will also improve compatibility with a lot of new .Net apps + + ## Configuration -You can change some behaviors by tweaking the configuration file. +You can customize the behavior of the script by tweaking the configuration file. + +--- ### Options (DEFAULT) -* debug: Whether debugging information should be displayed or not. - - Default Value: false +- **get_moment_title**: Whether to fetch the title of the moment or not. + - **Default Value**: false -* get_info: Whether additional information should be fetched or not with debug enabled. - - Default Value: false +- **root_path**: Path where the script will add movies and TV series folders (see [Path Examples](#Path-examples)). + - **Default Value**: media/streamingcommunity -* show_message: Whether messages should be displayed to the user or not. - - Default Value: true +- **movies_folder_name**: The folder name where all the movies will be placed. Do not put a trailing slash. + - **Default Value**: Movies -* clean_console: Whether the console should be cleared before displaying new information or not. - - Default Value: true +- **series_folder_name**: The folder name where all the TV series will be placed. Do not put a trailing slash. + - **Default Value**: Series -* get_moment_title: Whether to fetch the title of the moment or not. - - Default Value: false +- **anime_folder_name**: The folder name where all the anime will be placed. Do not put a trailing slash. + - **Default Value**: Anime -* root_path: Path where the script will add movies and TV series folders (see [Path Examples](#Path-examples)). - - Default Value: media/streamingcommunity - - Example Value: /path/to/root +- **not_close**: Whether to keep the application running after completion or not. + - **Default Value**: false -* movies_folder_name: The folder name where all the movies will be placed. Do not put a trailing slash. - - Default Value: downloaded-movies - - Example Value: Movies - -* series_folder_name: The folder name where all the TV series will be placed. Do not put a trailing slash. - - Default Value: mytvseries - - Example Value: Series - -* anime_folder_name: The folder name where all the anime will be placed. Do not put a trailing slash. - - Default Value: myanime - - Example Value: Anime - -* not_close: Whether to keep the application running after completion or not. - - Default Value: false - -### Options (SITE) - -* streaming_domain: The domain of the streaming site. - - Default Value: forum - - Example Value: express - -* anime_domain: The domain of the anime site. - - Default Value: to - - Example Value: estate +--- ### Options (M3U8) -* tdqm_workers: The number of workers that will cooperate to download .ts files. **A high value may slow down your PC** - - Default Value: 20 +- **tdqm_workers**: The number of workers that will cooperate to download .ts files. **A high value may slow down your PC** + - **Default Value**: 20 -* tqdm_progress_timeout: The timeout duration for progress display updates in seconds after quit download. - - Default Value: 10 +- **tqdm_progress_timeout**: The timeout duration for progress display updates in seconds after quit download. + - **Default Value**: 10 -* minimum_ts_files_in_folder: The minimum number of .ts files expected in a folder. - - Default Value: 15 +- **use_openssl**: Indicates whether OpenSSL should be utilized for encryption during the conversion of TS files with key and IV. + - **Default Value**: false -* download_percentage: The percentage of download completion required to consider the download complete. - - Default Value: 1 - - Example Value: 0.95 +- **use_codecs**: Specifies whether specific codecs (e.g., h264 for video, AAC for audio) should be used for converting TS files to MP4. **May slow down your PC** + - **Default Value**: false -* requests_timeout: The timeout duration for HTTP requests in seconds. - - Default Value: 5 +- **enable_time_quit**: Whether to enable quitting the download after a certain time period. + - **Default Value**: false -* use_openssl: Indicates whether OpenSSL should be utilized for encryption during the conversion of TS files with key and IV. - - Default Value: false +- **tqdm_show_progress**: Whether to show progress during downloads or not. **May slow down your PC** + - **Default Value**: false -* use_codecs: Specifies whether specific codecs (e.g., h264 for video, AAC for audio) should be used for converting TS files to MP4. **May slow down your PC** - - Default Value: false +- **cleanup_tmp_folder**: Whether to clean up temporary folders after processing or not. + - **Default Value**: true -* enable_time_quit: Whether to enable quitting the download after a certain time period. - - Default Value: false - -* tqdm_show_progress: Whether to show progress during downloads or not. **May slow down your PC** - - Default Value: false - -* cleanup_tmp_folder: Whether to clean up temporary folders after processing or not. - - Default Value: true +--- ### Options (M3U8_OPTIONS) -* download_audio: Indicates whether audio files should be downloaded or not. - - Default Value: true +- **download_audio**: Indicates whether audio files should be downloaded or not. + - **Default Value**: true -* download_subtitles: Indicates whether subtitles should be downloaded or not. - - Default Value: true +- **download_subtitles**: Indicates whether subtitles should be downloaded or not. + - **Default Value**: true -* merge_subtitles: Indicates if you want to merge subs in mp4 file or separate files .vtt - - Default Value: true +- **merge_subtitles**: Indicates if you want to merge subs in mp4 file or separate files .vtt + - **Default Value**: true -* specific_list_audio: A list of specific audio languages to download. - - Default Value: ["ita"] - - Example Value: ["eng", "fra"] +- **specific_list_audio**: A list of specific audio languages to download. + - **Default Value**: ["ita"] + - **Example Value**: ["eng", "fra"] -* specific_list_subtitles: A list of specific subtitle languages to download. - - Default Value: ["eng"] - - Example Value: ["spa", "por"] +- **specific_list_subtitles**: A list of specific subtitle languages to download. + - **Default Value**: ["eng"] + - **Example Value**: ["spa", "por"] -* 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) - - Example Value: %(tv_name) [S%(season)] [E%(episode)] %(episode_name) +- **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) + - **Example Value**: %(tv_name) [S%(season)] [E%(episode)] %(episode_name) + +--- > [!IMPORTANT] -> If you're on **Windows** you'll need to use double black slashes. On Linux/MacOS, one slash is fine. +> If you're on **Windows**, you'll need to use double black slashes. On Linux/MacOS, one slash is fine. + #### Path examples: diff --git a/Src/Api/series.py b/Src/Api/series.py index 1123cc0..a3c608f 100644 --- a/Src/Api/series.py +++ b/Src/Api/series.py @@ -3,6 +3,7 @@ import os import sys import logging +from typing import List # Internal utilities @@ -30,7 +31,7 @@ table_show_manager = TVShowManager() # --> LOGIC -def manage_selection(cmd_insert: str, max_count: int) -> list[int]: +def manage_selection(cmd_insert: str, max_count: int) -> List[int]: """ Manage user selection for seasons to download. diff --git a/Src/Api/site.py b/Src/Api/site.py index 81508b1..feef8d3 100644 --- a/Src/Api/site.py +++ b/Src/Api/site.py @@ -3,6 +3,7 @@ import sys import json import logging +from typing import Tuple # External libraries @@ -185,7 +186,7 @@ def get_version(text: str) -> str: raise -def get_version_and_domain() -> tuple[str, str]: +def get_version_and_domain() -> Tuple[str, str]: """ Retrieves the version and domain of a website. diff --git a/Src/Assets/win_7_install/explorer11.png b/Src/Assets/win_7_install/explorer11.png new file mode 100644 index 0000000..74cc758 Binary files /dev/null and b/Src/Assets/win_7_install/explorer11.png differ diff --git a/Src/Assets/win_7_install/internet_option.png b/Src/Assets/win_7_install/internet_option.png new file mode 100644 index 0000000..5e9b22c Binary files /dev/null and b/Src/Assets/win_7_install/internet_option.png differ diff --git a/Src/Lib/FFmpeg/util/helper.py b/Src/Lib/FFmpeg/util/helper.py index 3fa6f31..e463198 100644 --- a/Src/Lib/FFmpeg/util/helper.py +++ b/Src/Lib/FFmpeg/util/helper.py @@ -5,6 +5,7 @@ import os import json import logging import shutil +from typing import Tuple, List, Dict # External libraries @@ -92,7 +93,7 @@ def get_video_duration(file_path: str) -> (float): return None -def format_duration(seconds: float) -> list[int, int, int]: +def format_duration(seconds: float) -> Tuple[int, int, int]: """ Format duration in seconds into hours, minutes, and seconds. @@ -315,7 +316,7 @@ def concatenate_and_save(file_list_path: str, output_filename: str, v_codec: str return output_file_path -def join_audios(video_path: str, audio_tracks: list[dict[str, str]], prefix: str = "merged") -> str: +def join_audios(video_path: str, audio_tracks: List[Dict[str, str]], prefix: str = "merged") -> str: """ Join video with multiple audio tracks and sync them if there are matching segments. @@ -401,7 +402,7 @@ def join_audios(video_path: str, audio_tracks: list[dict[str, str]], prefix: str return "" -def transcode_with_subtitles(video: str, subtitles_list: list[dict[str, str]], output_file: str, prefix: str = "transcoded") -> str: +def transcode_with_subtitles(video: str, subtitles_list: List[Dict[str, str]], output_file: str, prefix: str = "transcoded") -> str: """ Transcode a video with subtitles. diff --git a/Src/Lib/Request/my_requests.py b/Src/Lib/Request/my_requests.py index 6610c87..8148d0a 100644 --- a/Src/Lib/Request/my_requests.py +++ b/Src/Lib/Request/my_requests.py @@ -9,7 +9,17 @@ import re import urllib.parse import urllib.request import urllib.error -from typing import Dict, Optional, Union, Unpack +from typing import Dict, Optional, Union + +try: + from typing import Unpack +except ImportError: + # (Python <= 3.10), + try: + from typing_extensions import Unpack + except ImportError: + raise ImportError("Unable to import Unpack from typing or typing_extensions. " + "Please make sure you have the necessary libraries installed.") # Constants diff --git a/Src/Util/os.py b/Src/Util/os.py index 89cc633..3ec16c2 100644 --- a/Src/Util/os.py +++ b/Src/Util/os.py @@ -8,6 +8,7 @@ import hashlib import logging import re import zipfile +from typing import List # Costant @@ -223,7 +224,7 @@ def compute_sha1_hash(input_string: str) -> str: return hashed_string -def decode_bytes(bytes_data: bytes, encodings_to_try: list[str] = None) -> str: +def decode_bytes(bytes_data: bytes, encodings_to_try: List[str] = None) -> str: """ Decode a byte sequence using a list of encodings and return the decoded string. diff --git a/run.py b/run.py index 4fe8e90..14fe6b7 100644 --- a/run.py +++ b/run.py @@ -1,6 +1,7 @@ # 10.12.23 -> 31.01.24 import sys +import os import logging import platform import argparse @@ -42,6 +43,10 @@ def initialize(switch = False): Checks Python version, removes temporary folder, and displays start message. """ + # Set terminal size for win 7 + if platform.system() == "Windows" and "7" in platform.version(): + os.system('mode 120, 40') + # Get system where script is run run_system = platform.system() @@ -55,8 +60,8 @@ def initialize(switch = False): logging.getLogger('root').setLevel(logging.ERROR) - if sys.version_info < (3, 11): - console.log("Install python version > 3.11") + if sys.version_info < (3, 7): + console.log("Install python version > 3.7.16") sys.exit(0)