Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
DoroWolf committed Jul 31, 2024
1 parent 72c4430 commit e5f65ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion core/utils/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ async def download_(filename=filename, path=path):
private_ip_check(url)

data = None

if method.upper() == 'GET':
data = await get_url(url, status_code=status_code, headers=headers, fmt='read', timeout=timeout, attempt=1,
request_private_ip=request_private_ip, logging_err_resp=logging_err_resp)
Expand Down
7 changes: 6 additions & 1 deletion modules/github/repo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import uuid

from core.builtins import Bot, Image, Plain, Url
from core.dirty_check import rickroll
from core.utils.http import download, get_url
Expand Down Expand Up @@ -55,8 +57,11 @@ async def repo(msg: Bot.MessageSession, name: str):
else:
await msg.send_message([Plain(message)])

hash = str(uuid.uuid4())
download_pic = await download(
f'https://opengraph.githubassets.com/c9f4179f4d560950b2355c82aa2b7750bffd945744f9b8ea3f93cc24779745a0/{result["full_name"]}')
url=f'https://opengraph.githubassets.com/{hash}/{result["full_name"]}',
filename=f'{hash}.png'
)
if download_pic:
await msg.finish([Image(download_pic)], quote=False)

Expand Down

0 comments on commit e5f65ed

Please sign in to comment.