Skip to content

Commit 09ec623

Browse files
committed
Fix Torrent Download and inline query
1 parent 7b0e256 commit 09ec623

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torrenthunt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def callbackHandler(call):
739739
Path(f"/TorrentHuntTmp/{call.from_user.id}").mkdir(parents=True, exist_ok=True)
740740

741741
open(f"/TorrentHuntTmp/{call.from_user.id}/{torrentInfo['infoHash']}.torrent", 'wb').write(response.content)
742-
thumbnail = requests.get(torrentInfo['image']) if torrentInfo['image'] else None
742+
thumbnail = requests.get(torrentInfo['thumbnail']) if torrentInfo['thumbnail'] else None
743743

744744
data = open(f"/TorrentHuntTmp/{call.from_user.id}/{torrentInfo['infoHash']}.torrent", 'rb')
745745

@@ -791,7 +791,7 @@ def query_text(inline_query):
791791
if count >= 5:
792792
break
793793
info = torrent.info(link=item['link'])
794-
queryResult.append(telebot.types.InlineQueryResultArticle(id=count, title=item['name'], thumb_url=info['image'] or 'https://raw.githubusercontent.com/hemantapkh/TorrentHunt/main/images/TorrentHunt.jpg', thumb_width='123', thumb_height='182', description=f"{item['size']} size {item['seeders']} seeders {item['leechers']} leechers", input_message_content=telebot.types.InputTextMessageContent(queryMessageContent(userId=inline_query.from_user.id, torrentId=item['torrentId']), parse_mode='HTML')))
794+
queryResult.append(telebot.types.InlineQueryResultArticle(id=count, title=item['name'], thumb_url=info['thumbnail'] or 'https://raw.githubusercontent.com/hemantapkh/TorrentHunt/main/images/TorrentHunt.jpg', thumb_width='123', thumb_height='182', description=f"{item['size']} size {item['seeders']} seeders {item['leechers']} leechers", input_message_content=telebot.types.InputTextMessageContent(queryMessageContent(userId=inline_query.from_user.id, torrentId=item['torrentId']), parse_mode='HTML')))
795795

796796
nextOffset = offset + 5 if offset < 20 else 0
797797
nextPage = page+1 if nextOffset == 20 else page

0 commit comments

Comments
 (0)