diff --git a/.gitignore b/.gitignore index 2a3874b40..688f1aa5f 100644 --- a/.gitignore +++ b/.gitignore @@ -143,3 +143,5 @@ bin/ resources/base_profile_pic.jpg resources/mdfy_profile_pic.jpg pictest.py +dev +resources/MutantAcademyBB.ttf diff --git a/userge/plugins/__init__.py b/userge/plugins/__init__.py index 445561c69..64d70582b 100644 --- a/userge/plugins/__init__.py +++ b/userge/plugins/__init__.py @@ -8,6 +8,7 @@ __all__ = ['ROOT', 'get_all_plugins'] +import sys from os.path import dirname from typing import List @@ -20,6 +21,6 @@ def get_all_plugins() -> List[str]: """list all plugins""" - plugins = get_import_path(ROOT, "/**/") + plugins = get_import_path(ROOT, "/" if len(sys.argv) == 2 and sys.argv[1] == 'dev' else "/**/") _LOG.debug("All Available Plugins: %s", plugins) return list(plugins) diff --git a/userge/utils/tools.py b/userge/utils/tools.py index 478eeb884..edd5f0793 100644 --- a/userge/utils/tools.py +++ b/userge/utils/tools.py @@ -14,7 +14,7 @@ from os.path import isfile, relpath from typing import Tuple, Dict, List, Union, Optional -from userge import logging +from userge import logging, Config _LOG = logging.getLogger(__name__) @@ -57,11 +57,11 @@ async def runcmd(cmd: str) -> Tuple[str, str, int, int]: process.pid) -async def take_screen_shot(video_file: str, duration: int) -> Optional[str]: +async def take_screen_shot(video_file: str, duration: int, path: str = '') -> Optional[str]: """take a screenshot""" _LOG.info('[[[Extracting a frame from %s ||| Video duration => %s]]]', video_file, duration) ttl = duration // 2 - thumb_image_path = f"{video_file}.jpg" + thumb_image_path = path or os.path.join(Config.DOWN_PATH, f"{video_file}.jpg") command = f"ffmpeg -ss {ttl} -i '{video_file}' -vframes 1 '{thumb_image_path}'" err = (await runcmd(command))[1] if err: diff --git a/userge/versions.py b/userge/versions.py index bec3589a7..53a787d59 100644 --- a/userge/versions.py +++ b/userge/versions.py @@ -14,7 +14,7 @@ __version_major__ = 0 __version_minor__ = 1 __version_micro__ = 5 -__version_beta__ = 6 +__version_beta__ = 7 __version__ = "{}.{}.{}".format(__version_major__, __version_minor__,