mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-24 09:15:51 +00:00
🐛 Fix bilibili fav download sql
This commit is contained in:
parent
06301fe648
commit
ed8a2125f3
@ -272,7 +272,7 @@ async def audio_download(
|
||||
type=12,
|
||||
title=info.get("title", ""),
|
||||
cover=info.get("cover", ""),
|
||||
message_id=0,
|
||||
message_id=msg.id if push_id else 0,
|
||||
file_id=msg.audio.file_id,
|
||||
timestamp=int(time.time()),
|
||||
)
|
||||
@ -412,7 +412,7 @@ async def go_upload(
|
||||
type=2,
|
||||
title=info.get("title", ""),
|
||||
cover=info.get("pic", ""),
|
||||
message_id=0,
|
||||
message_id=msg.id if push_id else 0,
|
||||
file_id=msg.video.file_id,
|
||||
timestamp=int(time.time()),
|
||||
)
|
||||
|
@ -67,17 +67,6 @@ async def process_video(data: Media, m: Message):
|
||||
msg = await go_upload(video, 0, m, push_id=bilifav_channel)
|
||||
if not msg:
|
||||
raise BilibiliFavException
|
||||
video_db = BiliFav(
|
||||
id=data.id,
|
||||
bv_id=data.bvid.lower(),
|
||||
type=data.type.value,
|
||||
title=data.title,
|
||||
cover=data.cover,
|
||||
message_id=msg.id,
|
||||
file_id=msg.video.file_id,
|
||||
timestamp=int(time.time()),
|
||||
)
|
||||
await BiliFavAction.add_bili_fav(video_db)
|
||||
|
||||
|
||||
async def process_audio_from_cache(audio: Audio, audio_db: BiliFav):
|
||||
@ -102,17 +91,6 @@ async def process_audio(data: Media, m: Message):
|
||||
msg = await audio_download(audio, m, push_id=bilifav_channel)
|
||||
if not msg:
|
||||
raise BilibiliFavException
|
||||
audio_db = BiliFav(
|
||||
id=data.id,
|
||||
bv_id=data.bvid.lower(),
|
||||
type=data.type.value,
|
||||
title=data.title,
|
||||
cover=data.cover,
|
||||
message_id=msg.id,
|
||||
file_id=msg.audio.file_id,
|
||||
timestamp=int(time.time()),
|
||||
)
|
||||
await BiliFavAction.add_bili_fav(audio_db)
|
||||
|
||||
|
||||
async def check_update(m: Message):
|
||||
|
Loading…
Reference in New Issue
Block a user