Skip to content

Commit

Permalink
Fixed an error on post_blog function. into community
Browse files Browse the repository at this point in the history
  • Loading branch information
FeralAmagai committed Sep 4, 2023
1 parent 09c7fbb commit a5cd6b1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pymino
Version: 1.2.5.0
Version: 1.2.5.1
Summary: Easily create a bot for Amino Apps using a modern easy to use synchronous library.
Home-page: https://github.com/forevercynical/pymino
Author: forevercynical
Expand Down
2 changes: 1 addition & 1 deletion pymino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__author__ = 'cynical'
__license__ = 'MIT'
__copyright__ = 'Copyright 2023 Cynical'
__version__ = '1.2.5.0'
__version__ = '1.2.5.1'
__description__ = 'A Python wrapper for the aminoapps.com API'

from .bot import Bot
Expand Down
8 changes: 4 additions & 4 deletions pymino/ext/async_community.py
Original file line number Diff line number Diff line change
Expand Up @@ -6407,8 +6407,8 @@ async def chat_request_privilege(self, privilege: bool, comId: Union[str, int] =
async def post_blog(self,
title: str,
content: str,
imageList: list = None,
captionList: list = None,
imageList: List[str] = None,
captionList: List[list] = None,
categoriesList: list = None,
backgroundColor: str = None,
fansOnly: bool = False,
Expand Down Expand Up @@ -6449,8 +6449,8 @@ async def post_blog(self,
... print(blog.content)
"""
media = []
if captionList is not None: [media.append([100, await self.__handle_media__(image[0], "image/jpg", True), image[1]] for image in captionList)]
elif imageList is not None: [media.append([100, await self.__handle_media__(image, "image/jpg", True), None] for image in imageList)]
if captionList is not None: [media.append([100, await self.__handle_media__(image[0], "image/jpg", True), image[1]])for image in captionList]
elif imageList is not None: [media.append([100, await self.__handle_media__(image, "image/jpg", True), None])for image in imageList]

data = dict(address = None,
content = content,
Expand Down
8 changes: 4 additions & 4 deletions pymino/ext/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -6321,8 +6321,8 @@ def chat_request_privilege(self, privilege: bool, comId: Union[str, int] = None)
def post_blog(self,
title: str,
content: str,
imageList: list = None,
captionList: list = None,
imageList: List[str] = None,
captionList: List[list] = None,
categoriesList: list = None,
backgroundColor: str = None,
fansOnly: bool = False,
Expand Down Expand Up @@ -6363,8 +6363,8 @@ def post_blog(self,
... print(blog.content)
"""
media = []
if captionList is not None: [media.append([100, self.__handle_media__(image[0], "image/jpg", True), image[1]] for image in captionList)]
elif imageList is not None: [media.append([100, self.__handle_media__(image, "image/jpg", True), None] for image in imageList)]
if captionList is not None: [media.append([100, self.__handle_media__(image[0], "image/jpg", True), image[1]])for image in captionList]
elif imageList is not None: [media.append([100, self.__handle_media__(image, "image/jpg", True), None])for image in imageList]

data = dict(address = None,
content = content,
Expand Down
12 changes: 11 additions & 1 deletion pymino/ext/utilities/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,14 @@ def signature(self, data: str) -> str:
self.SIGNATURE_KEY,
str(data).encode("utf-8"), sha1).digest())

return b64encode(bytes(signature)).decode("utf-8")
return b64encode(bytes(signature)).decode("utf-8")

def update_device(self, device: str):
encoded_data = sha1(str(bytes.fromhex(device[2:42])).encode('utf-8')).hexdigest()

digest = new(
self.DEVICE_KEY,
self.PREFIX + bytes.fromhex(encoded_data),
sha1).hexdigest()

return f"{bytes.hex(self.PREFIX)}{encoded_data}{digest}".upper()
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pymino
version = 1.2.5.0
version = 1.2.5.1
author = forevercynical
author_email = me@cynical.gg
description = Easily create a bot for Amino Apps using a modern easy to use synchronous library.
Expand Down

0 comments on commit a5cd6b1

Please sign in to comment.