Added GPL headers and switch
This commit is contained in:
parent
071b9baef0
commit
244ed75061
1
.gitignore
vendored
1
.gitignore
vendored
@ -27,3 +27,4 @@
|
|||||||
/utils/
|
/utils/
|
||||||
/cfg_availible/
|
/cfg_availible/
|
||||||
/profile/
|
/profile/
|
||||||
|
/gnu_header.txt
|
||||||
|
@ -1,7 +1,22 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
from collections import OrderedDict
|
# Yandere Lewd Bot, an image posting bot for Pleroma
|
||||||
|
# Copyright (C) 2022 Anon
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
# YandereBot is a customizable, no frills image-posting bot. The bot was designed to be simple to understand
|
# YandereBot is a customizable, no frills image-posting bot. The bot was designed to be simple to understand
|
||||||
# (from a technical perspective) and easy to modify/extend. YandereBot relies on GNU formatted hash files to configure
|
# (from a technical perspective) and easy to modify/extend. YandereBot relies on GNU formatted hash files to configure
|
||||||
|
16
run.sh
16
run.sh
@ -1,6 +1,22 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
# Yandere Lewd Bot, an image posting bot for Pleroma
|
||||||
|
# Copyright (C) 2022 Anon
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
# Get the runtime path of the bot
|
# Get the runtime path of the bot
|
||||||
|
|
||||||
ABS_PATH="$(readlink -f "$0")"
|
ABS_PATH="$(readlink -f "$0")"
|
||||||
RUN_DIR="$(dirname "$ABS_PATH")"
|
RUN_DIR="$(dirname "$ABS_PATH")"
|
||||||
|
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
# Program Name: Name
|
# Yandere Lewd Bot, an image posting bot for Pleroma
|
||||||
# Purpose: Purpose
|
# Copyright (C) 2022 Anon
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import getpass
|
import getpass
|
||||||
import re
|
import re
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
# Program Name: Encryption
|
# Yandere Lewd Bot, an image posting bot for Pleroma
|
||||||
# Purpose: Encrypt and store key
|
# Copyright (C) 2022 Anon
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import base64
|
import base64
|
||||||
|
39
src/main.py
39
src/main.py
@ -1,4 +1,21 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
|
# Yandere Lewd Bot, an image posting bot for Pleroma
|
||||||
|
# Copyright (C) 2022 Anon
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import signal
|
import signal
|
||||||
@ -151,6 +168,22 @@ class FailedSanityTest(Exception):
|
|||||||
class FailedToLoadCfg(Exception):
|
class FailedToLoadCfg(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def print_gpl():
|
||||||
|
print("Yandere Lewd Bot, an image posting bot for Pleroma")
|
||||||
|
print("Copyright (C) 2022 Anon")
|
||||||
|
print("")
|
||||||
|
print("This program is free software: you can redistribute it and/or modify")
|
||||||
|
print("it under the terms of the GNU General Public License as published by")
|
||||||
|
print("the Free Software Foundation, either version 3 of the License, or")
|
||||||
|
print("(at your option) any later version.")
|
||||||
|
print("")
|
||||||
|
print("This program is distributed in the hope that it will be useful,")
|
||||||
|
print("but WITHOUT ANY WARRANTY; without even the implied warranty of")
|
||||||
|
print("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the")
|
||||||
|
print("GNU General Public License for more details.")
|
||||||
|
print("")
|
||||||
|
print("You should have received a copy of the GNU General Public License")
|
||||||
|
print("along with this program. If not, see <https://www.gnu.org/licenses/>.")
|
||||||
|
|
||||||
# Entry point if run from the command line
|
# Entry point if run from the command line
|
||||||
def main():
|
def main():
|
||||||
@ -168,11 +201,17 @@ def main():
|
|||||||
parser.add_argument("-t", "--time", help="Wait for time before posting first image", default=None)
|
parser.add_argument("-t", "--time", help="Wait for time before posting first image", default=None)
|
||||||
parser.add_argument("-d", "--date", help="Wait for date before posting first image", default=None)
|
parser.add_argument("-d", "--date", help="Wait for date before posting first image", default=None)
|
||||||
parser.add_argument("-c", "--config", help="Set custom config file (Default: {})".format(default_cfg), default=default_cfg)
|
parser.add_argument("-c", "--config", help="Set custom config file (Default: {})".format(default_cfg), default=default_cfg)
|
||||||
|
parser.add_argument("-l", "--license", help="Display GPL license", action="store_true")
|
||||||
parser.add_argument("-o", "--output-hashes", help="Output list of hashes", action="store_true")
|
parser.add_argument("-o", "--output-hashes", help="Output list of hashes", action="store_true")
|
||||||
parser.add_argument("-h", "--help", help="Show this help message and exit", action="store_true")
|
parser.add_argument("-h", "--help", help="Show this help message and exit", action="store_true")
|
||||||
parser.add_argument("remainder", help=argparse.SUPPRESS, nargs=argparse.REMAINDER)
|
parser.add_argument("remainder", help=argparse.SUPPRESS, nargs=argparse.REMAINDER)
|
||||||
arguments = parser.parse_args()
|
arguments = parser.parse_args()
|
||||||
|
|
||||||
|
# Display gpl license
|
||||||
|
if arguments.license:
|
||||||
|
print_gpl()
|
||||||
|
return 0
|
||||||
|
|
||||||
# Redirect stdout when the bot first initializes if the bot is not going to run normally
|
# Redirect stdout when the bot first initializes if the bot is not going to run normally
|
||||||
redirect_stdout = None if arguments.output_hashes or arguments.help else sys.stdout
|
redirect_stdout = None if arguments.output_hashes or arguments.help else sys.stdout
|
||||||
|
|
||||||
|
@ -1,7 +1,21 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
# Program Name: Name
|
# Yandere Lewd Bot, an image posting bot for Pleroma
|
||||||
# Purpose: Purpose
|
# Copyright (C) 2022 Anon
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import yanlib
|
import yanlib
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
# Program Name: yandereBot
|
# Yandere Lewd Bot, an image posting bot for Pleroma
|
||||||
# Purpose: A Simple Mastadon Bot to Post Images
|
# Copyright (C) 2022 Anon
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# yanlib.py is required by yandereBot.py
|
# yanlib.py is required by yandereBot.py
|
||||||
# This file contains functions and utilities that may be useful to external tools and programs that interface with
|
# This file contains functions and utilities that may be useful to external tools and programs that interface with
|
||||||
|
Reference in New Issue
Block a user