Skip to content

Commit

Permalink
Fix: only process is_video as webm - #3
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyskye committed Apr 23, 2023
1 parent 3327a37 commit 72070b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
file_path = response.json()['result']['file_path']
response = requests.get(f'https://api.telegram.org/file/bot{bot_token}/{file_path}')

if 'is_animated' in sticker and sticker['is_animated'] or 'is_video' in sticker and sticker['is_video']:
# is_animated' in sticker and sticker['is_animated'] or
if 'is_video' in sticker and sticker['is_video']:
# extract frames and frame rate from the animated WebM
with tempfile.NamedTemporaryFile(suffix='.webm') as f:
f.write(response.content)
Expand Down

0 comments on commit 72070b6

Please sign in to comment.