Похожие чаты

Hi, maybe anybody can help me: storage_media = {} alphabetical = 'ABCDEFGHIJKLMNOPQRSTUVWXYSabcdefghijklmnopqrstuvwxyz1234567890' video_file_name

= ''.join(random.choice(alphabetical))+'.mp4'
file_id = generate_file_id(video_file_name)
if file_id not in storage_media:
uploaded_video = await client.upload_file(video_file_name)
storage_media[file_id] = uploaded_video
else:
uploaded_video = storage_media[file_id]
await client.send_file(to.chat_id, file=uploaded_video, supports_streaming=True)

how to store storage_media into .json file?
because when it is not store in .json file, every time i run my bot, storage_media return to {}
i need to store it in .json file, because i need to send repeatedly media.
and if the media is video, it takes too long to upload, even using send_file or upload_file.
that is why i need to store them to .json file. so it only needs to upload it one time.

1 ответов

19 просмотров

That issue is no longer related with Telethon, and this group is not meant to be a group for learning Python. Some good resources to learn Python: • Official Docs. • Dive Into Python 3. • Learn Python. • Project Python. • Computer Science Circles. • MIT OpenCourse. • Hitchhiker’s Guide to Python. • The @PythonRes Telegram Channel. • Corey Schafer videos for beginners and in general.

Похожие вопросы

Обсуждают сегодня

как правильно удалить сддм? прописал в etc/portage.use/plasma-meta -sddm , но при обновлении юзов мне предлагает поставить lightdm (ещё лучше 😡), добавил туда - display-manage...
REDis
25
#include <stdio.h> #include <stdlib.h> #include <time.h> void mass_first_generate(int mass[5][7]) {     for (int N = 0; N < 5; N++) {         for (int A = 0; A < 7; A++) {   ...
Чувак
6
Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
https://www.linkedin.com/posts/ugama-benedicta-kelechi-codergirl-103041300_mobiledevelopment-fluttertraining-handsonlearning-activity-7263445699227254784-IdHB?utm_source=share...
CoderGirl
16
like, question: int b = 99999; is this valid and predictable C?
Ludovic 'Archivist' Lagouardette
15
Помогите пожалуйста. Делаю систему плагинов. Проблема сейчас в такая: плагины загружаются в основном потоке. FLibHandle := SafeLoadLibrary(FFileName) Но нужно еще выполнить фу...
Илья 🤣
10
VIP-397 BNBx Oracle implementation upgrade Summary This proposal, if approved, will upgrade the implementation of the BNBx Oracle contract on Venus from version 1 (V1) to v...
Venus Announcements
2
Ну вот просто даже давайте вот как. Какой нибудь конкретный кейс, можете в пример привести, где бч работает и приносит прикладную пользу, а не просто что бы было? Не крипту.
Alexander Andreev
22
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
Карта сайта