<reponame>ryanitto/routine_convert<filename>routine_convert/settings.py
"""
Routine Convert settings


Summary
-------
Common variables to be used throughout module should live in this spot.


Required to run
--------
BINARIES (2):       "HandBrakeCLI.exe", "ffprobe.exe"
PRESET FILE (1):    presets.json (generated by Handbrake)
root_dir:           Needs to point to a "media folder" on your system!  (ex.  C:\BluRay_Files)
"""

import os


# BINARIES
# =================================

# @ryan Note:
# Originally, I specified a general 'binary folder' is where I place the required binaries for
# this module.  Even if there's only one, or a few, required by the module - it's convenient to have
# them under one spot! :)
BIN_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), 'bin'))  # Ex:  C:\site-packages\routine_convert\bin


# Path to Hand-brake CLI
# (CLI version, to run conversion:  https://handbrake.fr/downloads2.php)
HB_BIN = os.path.join(BIN_DIR, 'HandBrakeCLI.exe')  # Ex:  C:\site-packages\routine_convert\bin\HandBrakeCLI.exe

# Not required: (GUI version, for ease-of-use to make presets/do single tasks: https://handbrake.fr/downloads.php)

# Path to ffprobe
# (part of ffmpeg: https://ffmpeg.zeranoe.com/builds/)
FFPROBE = os.path.join(BIN_DIR, 'ffprobe.exe')  # Ex:  C:\site-packages\routine_convert\bin\ffprobe.exe
FFPROBE_FMT_STR = 'format'
FFPROBE_TAG_STR = 'tags'


# MEDIA SETTINGS
# =================================
# Media directories
root_dir = r'C:\media'

# Output ile format
container = 'av_mkv'
ext = 'mkv'

dvd_name = 'DVD'
blu_name = 'Blu-Ray'

# Physical disc formats (used as sub-folders to look in)
disc_formats = [
    dvd_name,
    blu_name,
]

# Media categories.  These are used to describe folder locations and to describe media subclasses.  There are multiple
# since some forms of media have different properties/structure than others.
# Example: since TV shows have additional info than movies, different subclasses will be used for them
movie_cat = 'movie'
show_cat = 'show'

media_categories = {
    movie_cat: 'Movies',
    show_cat: 'TV Shows',
}

# Folders for processing media.
source_key = 'source'
output_key = 'output'
old_source_key = 'old_source'

process_dirs = {
    source_key: 'TO_CONVERT',  # Media ready for conversion
    output_key: 'CONVERTED',  # Completed converted files, for review
    old_source_key: 'SOURCE_PROCESSED',  # Media source moved into folder, no longer queued
}


# PRESET FILE
# =================================
# Handbrake setting location (this is made by loading up the GUI version of the program)
# Ex:   C:\users\yourname\AppData\HandBrake\presets.json
PRESET_FILE = os.path.join(os.environ['AppData'], r'HandBrake\presets.json')

# Handbrake presets. The JSON preset file for Handbrake follows a convention of <category>/<preset-name>
# - Category (e.g.  General, Web, Devices, Matroska...)
# - Preset name (e.g.  Very Fast 1080p30, Android 1080p30...)
presets = {
    dvd_name: r'/'.join([
        'Ryan',  # category
        '(Ryan) DVD - 480p - 265 (Very Slow)'  # preset name
    ]),
    blu_name: r'/'.join([
        'Ryan',  # category
        '(Ryan) Apple 1080p - Surround - 265 (Very Slow)'  # preset name
    ]),
}


# SEPARATORS
# =================================
EMP_SEP = ''
SPC_SEP = ' '
USCORE_SEP = '_'
DASH_SEP = '-'
WIDE_DASH_SEP = DASH_SEP.join([' ', ' '])  # result: ' - '
NEW_LINE_SEP = ''.join(['=' for i in range(50)])

"""
Routine Convert settings


Summary
-------
Common variables to be used throughout module should live in this spot.


Required to run
--------
BINARIES (2):       "HandBrakeCLI.exe", "ffprobe.exe"
PRESET FILE (1):    presets.json (generated by Handbrake)
root_dir:           Needs to point to a "media folder" on your system!  (ex.  C:\BluRay_Files)
"""

import os


# BINARIES
# =================================

# @ryan Note:
# Originally, I specified a general 'binary folder' is where I place the required binaries for
# this module.  Even if there's only one, or a few, required by the module - it's convenient to have
# them under one spot! :)
BIN_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), 'bin'))  # Ex:  C:\site-packages\routine_convert\bin


# Path to Hand-brake CLI
# (CLI version, to run conversion:  https://handbrake.fr/downloads2.php)
HB_BIN = os.path.join(BIN_DIR, 'HandBrakeCLI.exe')  # Ex:  C:\site-packages\routine_convert\bin\HandBrakeCLI.exe

# Not required: (GUI version, for ease-of-use to make presets/do single tasks: https://handbrake.fr/downloads.php)

# Path to ffprobe
# (part of ffmpeg: https://ffmpeg.zeranoe.com/builds/)
FFPROBE = os.path.join(BIN_DIR, 'ffprobe.exe')  # Ex:  C:\site-packages\routine_convert\bin\ffprobe.exe
FFPROBE_FMT_STR = 'format'
FFPROBE_TAG_STR = 'tags'


# MEDIA SETTINGS
# =================================
# Media directories
root_dir = r'C:\media'

# Output ile format
container = 'av_mkv'
ext = 'mkv'

dvd_name = 'DVD'
blu_name = 'Blu-Ray'

# Physical disc formats (used as sub-folders to look in)
disc_formats = [
    dvd_name,
    blu_name,
]

# Media categories.  These are used to describe folder locations and to describe media subclasses.  There are multiple
# since some forms of media have different properties/structure than others.
# Example: since TV shows have additional info than movies, different subclasses will be used for them
movie_cat = 'movie'
show_cat = 'show'

media_categories = {
    movie_cat: 'Movies',
    show_cat: 'TV Shows',
}

# Folders for processing media.
source_key = 'source'
output_key = 'output'
old_source_key = 'old_source'

process_dirs = {
    source_key: 'TO_CONVERT',  # Media ready for conversion
    output_key: 'CONVERTED',  # Completed converted files, for review
    old_source_key: 'SOURCE_PROCESSED',  # Media source moved into folder, no longer queued
}


# PRESET FILE
# =================================
# Handbrake setting location (this is made by loading up the GUI version of the program)
# Ex:   C:\users\yourname\AppData\HandBrake\presets.json
PRESET_FILE = os.path.join(os.environ['AppData'], r'HandBrake\presets.json')

# Handbrake presets. The JSON preset file for Handbrake follows a convention of <category>/<preset-name>
# - Category (e.g.  General, Web, Devices, Matroska...)
# - Preset name (e.g.  Very Fast 1080p30, Android 1080p30...)
presets = {
    dvd_name: r'/'.join([
        'Ryan',  # category
        '(Ryan) DVD - 480p - 265 (Very Slow)'  # preset name
    ]),
    blu_name: r'/'.join([
        'Ryan',  # category
        '(Ryan) Apple 1080p - Surround - 265 (Very Slow)'  # preset name
    ]),
}


# SEPARATORS
# =================================
EMP_SEP = ''
SPC_SEP = ' '
USCORE_SEP = '_'
DASH_SEP = '-'
WIDE_DASH_SEP = DASH_SEP.join([' ', ' '])  # result: ' - '
NEW_LINE_SEP = ''.join(['=' for i in range(50)])
Routine Convert settings   Summary ------- Common variables to be used throughout module should live in this spot.   Required to run -------- BINARIES (2):       "HandBrakeCLI.exe", "ffprobe.exe" PRESET FILE (1):    presets.json (generated by Handbrake) root_dir:           Needs to point to a "media folder" on your system!  (ex.  C:\BluRay_Files) # BINARIES # ================================= # @ryan Note: # Originally, I specified a general 'binary folder' is where I place the required binaries for # this module.  Even if there's only one, or a few, required by the module - it's convenient to have # them under one spot! :) # Ex:  C:\site-packages\routine_convert\bin # Path to Hand-brake CLI # (CLI version, to run conversion:  https://handbrake.fr/downloads2.php) # Ex:  C:\site-packages\routine_convert\bin\HandBrakeCLI.exe # Not required: (GUI version, for ease-of-use to make presets/do single tasks: https://handbrake.fr/downloads.php) # Path to ffprobe # (part of ffmpeg: https://ffmpeg.zeranoe.com/builds/) # Ex:  C:\site-packages\routine_convert\bin\ffprobe.exe # MEDIA SETTINGS # ================================= # Media directories # Output ile format # Physical disc formats (used as sub-folders to look in) # Media categories.  These are used to describe folder locations and to describe media subclasses.  There are multiple # since some forms of media have different properties/structure than others. # Example: since TV shows have additional info than movies, different subclasses will be used for them # Folders for processing media. # Media ready for conversion # Completed converted files, for review # Media source moved into folder, no longer queued # PRESET FILE # ================================= # Handbrake setting location (this is made by loading up the GUI version of the program) # Ex:   C:\users\yourname\AppData\HandBrake\presets.json # Handbrake presets. The JSON preset file for Handbrake follows a convention of <category>/<preset-name> # - Category (e.g.  General, Web, Devices, Matroska...) # - Preset name (e.g.  Very Fast 1080p30, Android 1080p30...) # category # preset name # category # preset name # SEPARATORS # ================================= # result: ' - '