Exemplo n.º 1
0
    def html_create_data(self, track_id: int, read_only: bool = False) -> dict:
        """returns the data for html"""
        season = ConfigObjIntegerNumber(
            f"track_{track_id}_season", 1, "Season",
            "Enter the season Number (0 for specials)")
        if read_only:
            season.input_attributes = InputAttributes("readonly")
        season.value = self.season

        episode = ConfigObjIntegerNumber(f"track_{track_id}_episode", 1,
                                         "Episode", "Enter the episode Number")
        if read_only:
            episode.input_attributes = InputAttributes("readonly")
        episode.value = self.episode
        return {
            "disc_items": [
                {
                    "type": "hidden",
                    "var_name": f"track_{track_id}_type",
                    "value": self.track_type,
                },
                season.html_dict(""),
                episode.html_dict(""),
            ],
        }
Exemplo n.º 2
0
def api_config() -> ConfigList:
    """API Config"""
    return ConfigList(
        "api",
        "API Interface",
        ConfigObjString(
            "masterkey",
            "",
            "Master API Key",
            "The master API key for full control",
            button=Button("Generate API Key",
                          "generateAPIKey",
                          True,
                          input="api_masterkey"),
            input_attributes=InputAttributes("readonly"),
        ),
        ConfigObjString(
            "userkey",
            "",
            "User API Key",
            "The user API key for limited control",
            button=Button("Generate API Key",
                          "generateAPIKey",
                          True,
                          input="api_userkey"),
            input_attributes=InputAttributes("readonly"),
        ),
    )
Exemplo n.º 3
0
def database_config() -> ConfigList:
    """Database Config"""
    return ConfigList(
        "database",
        "Database",
        ConfigObjOptionsRadio(
            "mode",
            [
                ConfigObjRadio(
                    "sqlite3",
                    "SQLite3",
                    input_attributes=InputAttributes(data_click_hide="database_mysql_section"),
                ),
                ConfigObjRadio(
                    "mysql",
                    "MYSQL",
                    input_attributes=InputAttributes(data_click_show="database_mysql_section"),
                ),
            ],
            "sqlite3",
            "Database Mode",
            "What system do you want to use for data?",
        ),
        ConfigList(
            "mysql",
            "MYSQL",
            ConfigObjString(
                "host",
                "localhost",
                "Database Address",
                "The Database Address Name or IP",
            ),
            ConfigObjIntegerNumber(
                "port",
                3306,
                "Database Port",
                "The port your database is open on",
                input_attributes=InputAttributes(min=1001, max=65535),
            ),
            ConfigObjString(
                "username",
                "",
                "Database Username",
                "The username for access to the database",
            ),
            ConfigObjPassword(
                "password",
                "Database Password",
                "The password for access to the database",
            ),
            ConfigObjString("database", "tackem", "Database Name", "The name of the database"),
            is_section=True,
        ),
    )
Exemplo n.º 4
0
    def html_create_data(self, read_only: bool = False) -> dict:
        """returns the data for html"""
        name = ConfigObjString(
            "disc_name",
            "",
            "Disc Name",
            "Enter the name of the Disc here",
        )
        name.value = self.name
        if read_only:
            name.input_attributes = InputAttributes("readonly")

        info = ConfigObjString(
            "disc_info",
            "",
            "Disc Info",
            "Enter some information for the disc here",
        )
        info.value = self.info
        if read_only:
            info.input_attributes = InputAttributes("readonly")

        language = ConfigObjOptionsSelect(
            "disc_language",
            Languages.config_option(ConfigObjOption),
            "en",
            "Disc Language",
            "Enter the language of the Disc here",
        )
        language.value = self.language
        if read_only:
            language.input_attributes = InputAttributes("readonly")

        return {
            "search":
            False,
            "disc_type":
            self.disc_type,
            "disc_items": [
                {
                    "type": "hidden",
                    "var_name": "disc_type",
                    "value": self.disc_type,
                },
                name.html_dict(""),
                info.html_dict(""),
                language.html_dict(""),
            ],
        }
Exemplo n.º 5
0
    def __init__(
        self,
        var_name: str,
        default_value: bool,
        label: str,
        help_text: str,
        hide_on_html: bool = False,
        not_in_config: bool = False,
        rules: Optional[ConfigRules] = None,
        input_attributes: Optional[InputAttributes] = None,
        data_list: Optional[DataList] = None,
        value_link: Optional[list] = None,
    ):
        if not isinstance(default_value, bool):
            raise ValueError("default value is not a boolean")
        if input_attributes is None:
            input_attributes = InputAttributes(**DEFAULT_STYLE)
        else:
            input_attributes.add_if_missing(**DEFAULT_STYLE)

        super().__init__(
            var_name,
            default_value,
            label,
            help_text,
            hide_on_html,
            not_in_config,
            rules,
            input_attributes,
            data_list,
            value_link,
        )
Exemplo n.º 6
0
    def html_create_data(self, track_id: int, read_only: bool = False) -> dict:
        """returns the data for html"""
        name = ConfigObjString(f"track_{track_id}_name", "", "Extra Name", "Enter the name")
        if read_only:
            name.input_attributes = InputAttributes("readonly")
        name.value = self.name

        return {
            "disc_items": [
                {
                    "type": "hidden",
                    "var_name": f"track_{track_id}_type",
                    "value": self.track_type,
                },
                name.html_dict(""),
            ],
        }
Exemplo n.º 7
0
 def __init__(self,
              default_value=False,
              disabled=False,
              toggle_panel=False):
     super().__init__(
         "enabled",
         default_value,
         "Enabled",
         "",
         input_attributes=InputAttributes(
             "disabled" if disabled else "enabled",
             data_on="Enabled",
             data_off="Disabled",
             data_onstyle="success",
             data_offstyle="secondary",
             data_width="124",
             data_toggle_panel="true" if toggle_panel else "false",
         ),
     )
Exemplo n.º 8
0
    def html_create_data(self, track_id: int, read_only: bool = False) -> dict:
        """returns the data for html"""
        reason = ConfigObjString(
            f"track_{track_id}_reason", "", "Reason",
            "Enter the reason to not rip this at all here")
        if read_only:
            reason.input_attributes = InputAttributes("readonly")

        reason.value = self.reason

        return {
            "disc_items": [
                {
                    "type": "hidden",
                    "var_name": f"track_{track_id}_type",
                    "value": self.track_type,
                },
                reason.html_dict(""),
            ],
        }
Exemplo n.º 9
0
def webui_config() -> ConfigList:
    """WebUI Config"""
    return ConfigList(
        "webui",
        "Web Interface",
        ConfigObjIntegerNumber(
            "port",
            8081,
            "Port",
            "The port the system is accessed on",
            input_attributes=InputAttributes(min=1001, max=65535),
        ),
        ConfigObjString("socket", "0.0.0.0", "Host Socket",
                        "The Host Socket 0.0.0.0 for all"),
        ConfigObjString("baseurl", "/", "Base Url",
                        "The Base Url must start and end with '/'"),
        ConfigObjString(
            "uploadlocation",
            "upload/",
            "Temp Upload Location",
            "Location for temp storage of uploaded files",
        ),
    )
Exemplo n.º 10
0
    def html_create_data(self, read_only: bool = False) -> dict:
        """returns the data for html"""
        name = ConfigObjString(
            "name",
            "",
            "Movie Title",
            "Enter the name of the movie here",
            button=Button("Search By Title",
                          "movieSearch",
                          True,
                          item_width=175),
        )
        name.value = self.name

        year = ConfigObjIntegerNumber(
            "year",
            0,
            "Year",
            "Enter the year here to help the search by title",
            input_attributes=InputAttributes(min=1888,
                                             max=int(
                                                 datetime.date.today().year)),
        )
        year.value = self.year

        imdbid = ConfigObjString(
            "imdbid",
            "",
            "IMDB ID",
            "Enter the IMDB ID here",
            button=Button("Search By IMDB ID",
                          "movieSearchIMDBid",
                          True,
                          item_width=175),
        )

        tmdbid = ConfigObjString(
            "tmdbid",
            "",
            "TMDB ID",
            "Enter the TMDB ID here",
            button=Button("Search By TMDB ID",
                          "movieSearchTMDBid",
                          True,
                          item_width=175),
        )
        tmdbid.value = self.tmdb_id

        year_html = year.html_dict("")
        year_html["value"] = ""
        return {
            "search":
            True,
            "disc_type":
            self.disc_type,
            "disc_data_items": [
                {
                    "type": "hidden",
                    "var_name": "disc_type",
                    "value": self.disc_type,
                },
                {
                    "type": "hidden",
                    "var_name": "disc_tmdbid",
                    "value": self.tmdb_id,
                },
                {
                    "type": "hidden",
                    "var_name": "disc_name",
                    "value": self.name,
                },
                {
                    "type": "hidden",
                    "var_name": "disc_year",
                    "value": self.year,
                },
                {
                    "type": "hidden",
                    "var_name": "disc_language",
                    "value": self.language,
                },
            ],
            "disc_items": [
                name.html_dict(""),
                year_html,
                imdbid.html_dict(""),
                tmdbid.html_dict(""),
            ],
        }
Exemplo n.º 11
0
def ripper_config() -> ConfigList:
    """Ripper Config"""
    if platform.system() != "Linux":
        return None
    if not check_for_required_programs(RIPPERREQUIREDLINUX, "Ripper"):
        return None

    drives = True
    if not Hardware.disc_drives():
        drives = False
    return ConfigList(
        "ripper",
        "Ripper",
        ConfigObjEnabled(toggle_panel=True),
        ConfigList(
            "drives",
            "Drives",
            ConfigObjEnabled(disabled=drives),
            many_section=ConfigList(
                "",
                "",
                ConfigObjEnabled(),
                ConfigObjString("label", "", "Label",
                                "What do you want to call this drive?"),
                ConfigObjString(
                    "link",
                    "",
                    "Drive Link",
                    "Address of the drive",
                    not_in_config=True,
                    input_attributes=InputAttributes("readonly", "disabled"),
                ),
                ConfigObjString(
                    "uuid",
                    "",
                    "Unique ID",
                    "A Unique code for the drive",
                    not_in_config=True,
                    input_attributes=InputAttributes("read_only", "disabled"),
                ),
                ConfigObjString(
                    "model",
                    "",
                    "Drive Model",
                    "Model of the drive",
                    not_in_config=True,
                    input_attributes=InputAttributes("read_only", "disabled"),
                ),
            ),
            rules=ConfigRules(for_each=Hardware.disc_drives()),
        ),
        ConfigList(
            "iso",
            "ISO",
            ConfigObjEnabled(),
            ConfigObjIntegerNumber(
                "threadcount",
                1,
                "How Many Instances",
                "How Many Instances of MakeMKV do you want to allow at once?",
                input_attributes=InputAttributes(min=1, max=5),
            ),
        ),
        ConfigList(
            "locations",
            "Folder Location",
            ConfigObjString(
                "iso",
                "iso/",
                "ISO Location",
                "Where do you want to watch for ISOs?",
            ),
            ConfigObjString(
                "ripping",
                "ripping/",
                "Ripping Location",
                "Where do you want to store discs while ripping them?",
            ),
        ),
        ConfigList(
            "makemkv",
            "MakeMKV",
            ConfigObjString(
                "key",
                "",
                "Licence Key",
                "Please enter your licence key for makemkv here (restart needed)",
            ),
        ),
        ConfigList(
            "videoripping",
            "Video Ripping",
            ConfigObjOptionsCheckBox(
                "torip",
                [
                    ConfigObjCheckbox("movie", "Movie"),
                    ConfigObjCheckbox("tvshow", "TV Show Episode"),
                    ConfigObjCheckbox("trailer", "Trailer"),
                    ConfigObjCheckbox("extra", "Extra"),
                    ConfigObjCheckbox("other", "Other"),
                ],
                ["movie", "tvshow"],
                "What to Rip",
                "What File Types do you want to rip and include",
            ),
        ),
        ConfigList(
            "audioripping",
            "Audo CD Ripping",
        ),
        ConfigList(
            "converter",
            "Converter",
            ConfigObjEnabled(),
            ConfigObjString(
                "ffmpeglocation",
                "ffmpeg",
                "FFmpeg Location",
                "Where is FFmpeg located?",
            ),
            ConfigObjString(
                "ffprobelocation",
                "ffprobe",
                "FFprobe Location",
                "Where is FFprobe located?",
            ),
            ConfigObjIntegerNumber(
                "threadcount",
                1,
                "How Many Instances?",
                "How Many Threads (Max of 5)",
                input_attributes=InputAttributes(min=1, max=5),
            ),
            ConfigObjOptionsSelect(
                "defaultlanguage",
                Languages.config_option(ConfigObjOption),
                "en",
                "Default Language",
                "What is your main language?",
            ),
            # TODO need to sort this so it can be different for 3D SD HD UHD and HDR Files
            ConfigList(
                "video",
                "Video",
                # VIDEO SECTION
                ConfigObjBoolean(
                    "videoinserttags",
                    True,
                    "Insert Tags",
                    "Do you want to add in the tags to the Video Files?",
                    input_attributes=YES_NO_IA,
                ),
                ConfigObjOptionsSelect(
                    "hdrmode",
                    [
                        ConfigObjOption("keep", "Keep Original"),
                        # ConfigObjOption("x265default", "convert to x265 Default"),
                        # ConfigObjOption("x265custom", "convert to x265 Custom")
                    ],
                    "keep",
                    "HDR Mode",
                    "How to treat HDR videos",
                ),
                ConfigObjOptionsSelect(
                    "video3dtype",
                    [
                        ConfigObjOption("keep", "Keep Original"),
                        ConfigObjOption("sbsl",
                                        "Side by Side (Left Eye First)"),
                        ConfigObjOption("sbsr",
                                        "Side by Side (Right Eye First)"),
                        ConfigObjOption("sbs2l",
                                        "Half Side by Side (Left Eye First)"),
                        ConfigObjOption("sbs2r",
                                        "Half Side by Side (Right Eye First)"),
                        ConfigObjOption("abl", "Top Bottom (Left Eye Top)"),
                        ConfigObjOption("abr", "Top Bottom (Right Eye Top)"),
                        ConfigObjOption("ab2l",
                                        "Half Top Bottom (Left Eye Top)"),
                        ConfigObjOption("ab2r",
                                        "Half Top Bottom (Right Eye Top)"),
                        ConfigObjOption("al",
                                        "Alternating Frames (Left Eye First)"),
                        ConfigObjOption(
                            "ar", "Alternating Frames (Right Eye First)"),
                        ConfigObjOption(
                            "irl", "Interleaved Rows (Left Eye Has Top Row)"),
                        ConfigObjOption(
                            "irr", "Interleaved Rows (Right Eye Has Top Row)"),
                        ConfigObjOption("arbg", "Anaglyph Red/Blue Grayscale"),
                        ConfigObjOption("argg",
                                        "Anaglyph Red/Green Grayscale"),
                        ConfigObjOption("arcg", "Anaglyph Red/Cyan Grayscale"),
                        ConfigObjOption("arch",
                                        "Anaglyph Red/Cyan Half Coloured"),
                        ConfigObjOption("arcc", "Anaglyph Red/Cyan Colour"),
                        ConfigObjOption("arcd",
                                        "Anaglyph Red/Cyan Colour dubois"),
                        ConfigObjOption("agmg",
                                        "Anaglyph Green/Magenta Grayscale"),
                        ConfigObjOption(
                            "agmh", "Anaglyph Green/Magenta Half Coloured"),
                        ConfigObjOption("agmc",
                                        "Anaglyph Green/Magenta Coloured"),
                        ConfigObjOption(
                            "agmd", "Anaglyph Green/Magenta Colour Dubois"),
                        ConfigObjOption("aybg",
                                        "Anaglyph Yellow/Blue Grayscale"),
                        ConfigObjOption("aybh",
                                        "Anaglyph Yellow/Blue Half Coloured"),
                        ConfigObjOption("aybc",
                                        "Anaglyph Yellow/Blue Coloured"),
                        ConfigObjOption("aybd",
                                        "Anaglyph Yellow/Blue Colour Dubois"),
                        ConfigObjOption("ml", "Mono Output (Left Eye Only)"),
                        ConfigObjOption("mr", "Mono Output (Right Eye Only)"),
                        ConfigObjOption("chl",
                                        "Checkerboard (Left Eye First)"),
                        ConfigObjOption("chr",
                                        "Checkerboard (Right Eye First)"),
                        ConfigObjOption(
                            "icl", "Interleaved Columns (Left Eye First)"),
                        ConfigObjOption(
                            "icr", "Interleaved Columns (Right Eye First)"),
                        ConfigObjOption("hdmi", "HDMI Frame Pack"),
                    ],
                    "keep",
                    "3D Type",
                    "what 3D mode do you want to transform 3d Discs into",
                ),
                ConfigObjOptionsSelect(
                    "videoresolution",
                    [
                        ConfigObjOption("keep", "Keep Original"),
                        ConfigObjOption("2160", "4K"),
                        ConfigObjOption("1080", "1080"),
                        ConfigObjOption("720", "720"),
                        ConfigObjOption("sd", "SD"),
                    ],
                    "keep",
                    "Max Video Resolution",
                    "What is the maximum resolution you want to keep or downscale to?",
                ),
                ConfigObjOptionsRadio(
                    "videocodec",
                    [
                        ConfigObjRadio(
                            "keep",
                            "Keep Original",
                            input_attributes=InputAttributes(data_click_hide=[
                                "ripper_converter_video_videopreset",
                                "ripper_converter_video_x26custom_section",
                            ]),
                        ),
                        ConfigObjRadio(
                            "x264default",
                            "X264 Default",
                            input_attributes=InputAttributes(data_click_hide=[
                                "ripper_converter_video_videopreset",
                                "ripper_converter_video_x26custom_section",
                            ]),
                        ),
                        ConfigObjRadio(
                            "x265default",
                            "X265 Default",
                            input_attributes=InputAttributes(data_click_hide=[
                                "ripper_converter_video_videopreset",
                                "ripper_converter_video_x26custom_section",
                            ]),
                        ),
                        ConfigObjRadio(
                            "x264custom",
                            "X264 Custom",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_video_x26custom_section",
                                data_click_hide=
                                "ripper_converter_video_videopreset",
                            ),
                        ),
                        ConfigObjRadio(
                            "x265custom",
                            "X265 Custom",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_video_x26custom_section",
                                data_click_hide=
                                "ripper_converter_video_videopreset",
                            ),
                        ),
                        ConfigObjRadio(
                            "preset",
                            "Preset (choose from a list)",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_video_videopreset",
                                data_click_hide=
                                "ripper_converter_video_x26custom_section",
                            ),
                        ),
                    ],
                    "keep",
                    "Video Codec",
                    "What video codec do you wish to convert to?",
                ),
                ConfigObjOptionsSelect(
                    "videopreset",
                    video_presets_config_options(ConfigObjOption),
                    "",
                    "Video Preset",
                    "What preset do you want to use?",
                ),
                ConfigList(
                    "x26custom",
                    "x26? Custom Options",
                    ConfigObjIntegerNumber(
                        "x26crf8bit",
                        23,
                        "CRF (8 bit)?",
                        """
The range of the CRF (8 bit) scale is 0–51, where 0 is lossless, 23 is the default,and 51 is worst
quality possible. A lower value generally leads to higher quality, and a subjectively sane range is
17–28. Consider 17 or 18 to be visually lossless or nearly so; it should look the same or nearly the
same as the input but it isn't technically lossless. The range is exponential, so increasing the CRF
value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the
bitrate. Choose the highest CRF value that still provides an acceptable quality. If the output looks
good, then try a higher value. If it looks bad, choose a lower value.""",
                        input_attributes=InputAttributes(min=0, max=51),
                    ),
                    ConfigObjIntegerNumber(
                        "x26crf10bit",
                        23,
                        "CRF (10 bit)?",
                        """
The range of the CRF (10 bit) scale is 0–63, where 0 is lossless, 23 is the default,and 63 is worst
quality possible.""",
                        input_attributes=InputAttributes(
                            min=0,
                            max=63,
                        ),
                    ),
                    ConfigObjOptionsSelect(
                        "x26preset",
                        [
                            ConfigObjOption("ultrafast", "Ultra Fast"),
                            ConfigObjOption("superfast", "Super Fast"),
                            ConfigObjOption("veryfast", "Very Fast"),
                            ConfigObjOption("faster", "Faster"),
                            ConfigObjOption("fast", "Fast"),
                            ConfigObjOption("medium", "Medium"),
                            ConfigObjOption("slow", "Slow"),
                            ConfigObjOption("slower", "Slower"),
                            ConfigObjOption("veryslow", "Very Slow"),
                        ],
                        "medium",
                        "Preset",
                        """
A preset is a collection of options that will provide a certain encoding speed to compression ratio.
A slower preset will provide better compression (compression is quality per filesize).
This means that, for example, if you target a certain file size or constant bit rate,
you will achieve better quality with a slower preset. Similarly, for constant quality encoding,
you will simply save bitrate by choosing a slower preset.
Use the slowest preset that you have patience for.""",
                    ),
                    ConfigObjString("x26extra", "", "Extra commands",
                                    "Other commands?"),
                    is_section=True,
                ),
            ),
            ConfigList(
                "audio",
                "Audio",
                # AUDIO SECTION
                ConfigObjOptionsRadio(
                    "originalordub",
                    [
                        ConfigObjRadio("original", "Original"),
                        ConfigObjRadio("dub", "Dubbed"),
                    ],
                    "all",
                    "Original or Dubbed Language",
                    """
Do you want the default stream to be the Original language or dubbed in your language if available?
""",
                ),
                ConfigObjOptionsRadio(
                    "audiolanguage",
                    [
                        ConfigObjRadio(
                            "all",
                            "All",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_audio_audiolanglist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "original",
                            "Original Language Only",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_audio_audiolanglist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "default",
                            "Default Language Only",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_audio_audiolanglist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "deaultandoriginal",
                            "Original Language + Default Language",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_audio_audiolanglist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "selectedandoriginal",
                            "Original Language + Selected Languages",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_audio_audiolanglist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "selected",
                            "Selected Languages",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_audio_audiolanglist_section"
                            ),
                        ),
                    ],
                    "all",
                    "Audio Languages",
                    "What Audio Languages do you want to keep?",
                ),
                ConfigList(
                    "audiolanglist",
                    "Audio Language List",
                    ConfigObjOptionsCheckBox(
                        "audiolanguages",
                        Languages.config_option(ConfigObjCheckbox),
                        "en",
                        "Audio Languages",
                        "",
                    ),
                    is_section=True,
                ),
                ConfigObjOptionsRadio(
                    "audioformat",
                    [
                        ConfigObjRadio(
                            "all",
                            "All",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_audio_audioformatlist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "highest",
                            "Highest Quality",
                            input_attributes=InputAttributes(
                                "disabled",
                                data_click_hide=
                                "ripper_converter_audio_audioformatlist_section",
                            ),
                        ),
                        ConfigObjRadio(
                            "selected",
                            "Selected Formats",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_audio_audioformatlist_section"
                            ),
                        ),
                    ],
                    "all",
                    "Audio Format",
                    "What Audio Formats do you want to keep?",
                ),
                ConfigList(
                    "audioformatlist",
                    "Audio Format List",
                    ConfigObjOptionsCheckBox(
                        "audioformats",
                        audio_format_options(ConfigObjCheckbox),
                        "",
                        "Audio Formats",
                        "",
                    ),
                    is_section=True,
                ),
            ),
            ConfigList(
                "chapters",
                "Chapters",
                # CHAPTERS SECTION
                ConfigObjBoolean(
                    "keepchapters",
                    True,
                    "Keep Chapters",
                    "Do you want to keep the chapter points?",
                    input_attributes=YES_NO_IA,
                ),
            ),
            ConfigList(
                "subtitles",
                "Subtitles",
                # SUBTITLES SECTION
                ConfigObjOptionsRadio(
                    "subtitle",
                    [
                        ConfigObjRadio(
                            "all",
                            "All",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_subtitles_subtitleslist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "none",
                            "None",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_subtitles_subtitleslist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "original",
                            "Original Language Only",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_subtitles_subtitleslist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "default",
                            "Default Language Only",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_subtitles_subtitleslist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "deaultandoriginal",
                            "Original Language + Default Language",
                            input_attributes=InputAttributes(
                                data_click_hide=
                                "ripper_converter_subtitles_subtitleslist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "selectedandoriginal",
                            "Original Language + Selected Languages",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_subtitles_subtitleslist_section"
                            ),
                        ),
                        ConfigObjRadio(
                            "selected",
                            "Selected Languages",
                            input_attributes=InputAttributes(
                                data_click_show=
                                "ripper_converter_subtitles_subtitleslist_section"
                            ),
                        ),
                    ],
                    "all",
                    "Subtitles",
                    "What subtitles do you want to keep?",
                ),
                ConfigList(
                    "subtitleslist",
                    "Subtitle List",
                    ConfigObjOptionsCheckBox(
                        "subtitlelanguages",
                        Languages.config_option(ConfigObjCheckbox),
                        "",
                        "Subtitle Languages",
                        "",
                    ),
                    is_section=True,
                ),
                ConfigObjBoolean(
                    "keepclosedcaptions",
                    True,
                    "Keep Closed Captions",
                    "Do you want to keep the closed captions?",
                    input_attributes=YES_NO_IA,
                ),
            ),
        ),
    )
Exemplo n.º 12
0
RIPPERREQUIREDLINUX = [
    "hwinfo",
    "makemkvcon",
    "java",
    "ccextractor",
    "ffmpeg",
    "ffprobe",
    "mplayer",
    "eject",
    "lsblk",
    "hwinfo",
    "blkid",
    "udfinfo",
]

YES_NO_IA = InputAttributes(data_on="Yes", data_off="No")


def ripper_config() -> ConfigList:
    """Ripper Config"""
    if platform.system() != "Linux":
        return None
    if not check_for_required_programs(RIPPERREQUIREDLINUX, "Ripper"):
        return None

    drives = True
    if not Hardware.disc_drives():
        drives = False
    return ConfigList(
        "ripper",
        "Ripper",