FriendTeamInc / VodBot

A command line interface VOD and Clip manager for Twitch.
MIT License
14 stars 1 forks source link

New config format #40

Closed NotQuiteApex closed 2 years ago

NotQuiteApex commented 2 years ago

For future versions, a reformatting of the config file is clearly necessary to cover all intended features. An example is below.

{
    "channels": [
        {
            "username": "notquiteapex",
            "save_chat": true,
            "save_vods": true,
            "save_clips": true,
            "thumbnail_icon": {
                "filename": "heads/apex.png",
                "ox": 92, "oy": 130
            },
        },
        {
            "username": "percy_creates",
            "save_chat": false,
            "save_vods": false,
            "save_clips": true,
            "thumbnail_icon": {
                "filename": "heads/percy.png",
                "ox": 146, "oy": 95
            },
        },
    ],

    "thumbnail": {
        "enable": false,

        "thumb_filename": "thumb_bg.png",
        "thumb_x": 0, "thumb_y": 0,
        "thumb_size": "1280x720",

        "screenshot_x": 300, "screenshot_y": 0,
        "screenshot_w,h": "1280,720",

        "font": "Ubuntu-Bold-Italic",
        "pointsize": 160,

        "font_gravity": "NorthWest",
        "font_x": 420, "font_y": 50,

        "head_order": [5,6,7,8,4,3,2,1],
        "head_positions": {
            [250, 250], [465, 280],
            [100, 388], [502, 508], [250, 250, 2],
            [130, 616], [544, 650], [342, 654],
        },

        "game_gravity": "center",
        "game_x": -430, "game_y": -240, 

        "games": [
            {
                "name": "minecraft", "filename": "games/minecraft.png",
                "ox": 0, "oy": 0, "w,h": "220,220",
            },
        ]
    },

    "webhook": {
        "enable": false,
        "username": "VodBot",
        "url": "discord_webhook_url",
        "avatar_url": "image_url",

        "pull_vod": {
            "enable": false,
            "username": "VodBot Pulled VOD",
            "message": "VOD Pulled! @NotQuiteApex",
            "url": "discord_webhook_url",
            "avatar_url": "image_url"
        },
        "pull_clip": {
            "enable": false,
            "username": "VodBot Pulled Clip",
            "message": "Clip Pulled! @NotQuiteApex",
        },
        "pull_job_done": { "enable": true },

        "export_video": { "enable": true },
        "export_job_done": { "enable": true },

        "upload_video": { "enable": true },
        "upload_job_done": { "enable": true }
    }

    "pull": {
        "save_chat": true,

        "gql_client": "kimne78kx3ncx6brgo4mv6wki5h1ko",

        "api_use_alt": false,
        "api_client": "",
        "api_secret": "",
    },

    "stage": {
        "timezone": "-0400",
        "desc_macros": {
            "captions": "Want to replay chat with video streams? No!",
            "watch": "Watch streams live at {links}",
            "discord": "Don't Join the Friend Team Inc.",
            "vodbot": "Stream archived by VodBot, maybe",
            "e": "on {date}\n\n{captions}\n{watch}\n{discord}\n{vodbot}"
        }
    }

    "export": {
        "ffmpeg_loglevel": "warning",

        "hardware_accel": {
            "enable": true,
            "hw_args": "",
        },

        "chat": {
            "enable": true,
            "msg_time": 10,
            "format": "RealText",
            "random_uncolored_names": true
        }
    },

    "upload": {
        "client_path": "/root/.vodbot/yt-client.json",
        "pickle_path": "/root/.vodbot/yt-session.pkl",

        "chat": {
            "enable": true,
            "msg_time": 10,
            "random_uncolored_names": true,

            "format": {
                "align": "left",
                "pos_x": 0,
                "pos_y": 100,
                "pos_weight": 6,
            }
        }
    },

    "directories": {
        "vods": "/root/.vodbot/vods",
        "clips": "/root/.vodbot/clips",

        "temp": "/root/.vodbot/temp",
        "stage": "/root/.vodbot/stage",

        "thumbnail": "/root/.vodbot/thumbnail"

        "games": "/root/.vodbot/thumbnail/games",
        "heads": "/root/.vodbot/thumbnail/heads"
    }
}
NotQuiteApex commented 2 years ago

Added webhook tables for various commands. All the webhooks have identical structure (currently), with a toggle, displayed username, custom message (for pinging users), the url for the webhook, and a url for the avatar. Webhooks get activated when completing certain tasks for commands, such as individual video downloads or uploads, and also when a command is completed.

NotQuiteApex commented 2 years ago

Moved channels out of the pull section, to dedicate a list of tables to it. Each table has a name (referred to by the program and printed for prettiness), an associated username, and info for thumbnail stuff, which is optional if thumbnail generation is not enabled. This is for #41.

New thumbnail feature (see #42), will generate a thumbnail for use with exports and uploads. Intended to be highly configurable, with plenty of options to make it look how you want. This will be off by default as it requires a new dependency, ImageMagick, to be in the PATH env variable like ffmpeg.

Moved webhooks to a dedicated table. The uppermost enable is a master toggle, and default values are under it. In each subsequent table is an individual toggle and override options, which all default to false or empty strings. Master toggle will always be off by default.

NotQuiteApex commented 2 years ago

Here is the current formatting of the config, not including new features like thumbnail generation and webhooks:

{
    "channels": [
        {
            "username": "percy_creates",
            "save_vods": true,
            "save_chat": true,
            "save_clips": true
        }
    ],

    "pull": {
        "save_chat": true,
        "gql_client": "kimne78kx3ncx6brgo4mv6wki5h1ko"
    },

    "chat": {
        "export_format": "YTT",
        "message_display_time": 10,
        "randomize_uncolored_names": true,
        "ytt_align": "left", "ytt_anchor": 6,
        "ytt_position_x": 0, "ytt_position_x": 100
    },

    "stage": {
        "timezone": "-0400",
        "description_macros": {
            "captions": "Want to see stream chat? ► Enable closed captions w/ 'English - Chat'.",
            "watch": "Watch streams live ► {links}",
            "content": "Watch our content ► https://youtube.friendteam.biz",
            "archive": "Watch past streams ► https://archive.friendteam.biz",
            "discord": "Join the FTI Discord ► https://discord.friendteam.biz",
            "vodbot": "Archived by VodBot ► https://vodbot.friendteam.biz",
            "e": "on {date}.\n\n{captions}\n\n{watch}\n{content}\n{archive}\n{discord}\n\n{vodbot}"
        }
    },

    "export": {
        "ffmpeg_loglevel": "warning",
        "chat_enable": true,
        "video_enable": true
    },

    "upload": {
        "client_path": "C:\\Users\\Apex\\.vodbot\\yt-client.json",
        "session_path": "C:\\Users\\Apex\\.vodbot\\yt-session.json",
        "chat_enable": true
    },

    "directories": {
        "vods":  "C:\\Users\\Apex\\.vodbot\\vods",
        "clips": "C:\\Users\\Apex\\.vodbot\\clips",
        "temp":  "C:\\Users\\Apex\\.vodbot\\temp",
        "stage": "C:\\Users\\Apex\\.vodbot\\stage"
    }
}