hi nekmo, when uploading my video files it often gives me this error:
ValueError: Metadata has no value 'width' (index 0)
and skips the file, moving on to the next one
What I Did
I use your wonderful script for a maximum upload through one of my scripts. I'll send you the composition of the command, but this does not generate an error. The error depends on the file you upload
Traceback (most recent call last):
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/bin/telegram-upload", line 8, in
sys.exit(upload_cli())
^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/telegram_upload/exceptions.py", line 68, in wrap
return fn(*args, kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/telegram_upload/management.py", line 191, in upload
client.send_files(to, files, delete_on_success, print_file_id, forward)
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/telegram_upload/client/telegram_upload_client.py", line 126, in send_files
message = self.send_one_file(entity, file, send_as_media, thumb=thumb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/telegram_upload/client/telegram_upload_client.py", line 103, in send_one_file
message = self._send_file_message(entity, file, thumb, progress)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/telegram_upload/client/telegram_upload_client.py", line 59, in _send_file_message
progress_callback=progress, attributes=file.file_attributes)
^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/telegram_upload/upload_files.py", line 202, in file_attributes
return get_file_attributes(self.path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/telegram_upload/upload_files.py", line 65, in get_file_attributes
(0, video_meta.get('width'))[metadata_has(video_meta, 'width')],
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aik/Scrivania/script/telegram-upload-aik/rose/venv/lib/python3.11/site-packages/hachoir/metadata/metadata.py", line 81, in get
raise ValueError(
ValueError: Metadata has no value 'width' (index 0)
pip freeze
): click==8.1.7 cryptg==0.4.0 dnspython==2.4.2 hachoir==3.2.0 more-itertools==10.1.0 prompt-toolkit==3.0.39 pyaes==1.6.1 pyasn1==0.5.0 pymongo==4.5.0 PySocks==1.7.1 rsa==4.9 telegram-upload Telethon==1.31.1 wcwidth==0.2.8Description
hi nekmo, when uploading my video files it often gives me this error:
ValueError: Metadata has no value 'width' (index 0)
and skips the file, moving on to the next one
What I Did
I use your wonderful script for a maximum upload through one of my scripts. I'll send you the composition of the command, but this does not generate an error. The error depends on the file you upload
command = f'/telegram-upload-aik/rose/venv/bin/telegram-upload --to {linkcanale} "{file_path}" --caption "{caption}" --print-file-id'