Skip to content

Commit

Permalink
geyify patch 🙈
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed May 24, 2020
1 parent 799751a commit 19aa5af
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,5 @@ bin/
resources/base_profile_pic.jpg
resources/mdfy_profile_pic.jpg
pictest.py
dev
resources/MutantAcademyBB.ttf
3 changes: 2 additions & 1 deletion userge/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

__all__ = ['ROOT', 'get_all_plugins']

import sys
from os.path import dirname
from typing import List

Expand All @@ -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)
6 changes: 3 additions & 3 deletions userge/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion userge/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__,
Expand Down

0 comments on commit 19aa5af

Please sign in to comment.