SongID icon indicating copy to clipboard operation
SongID copied to clipboard

File exceeds limit error

Open ALBINPRAVEEN opened this issue 4 years ago • 16 comments

Whenever im sending a file its showing the file exceeds more than 20mb. But i have snd fie of 300kb like that only... Any fix??

ALBINPRAVEEN avatar Jan 29 '22 06:01 ALBINPRAVEEN

Screenshot_2022-01-29-11-35-28-54 Screenshot_2022-01-29-11-35-38-74

ALBINPRAVEEN avatar Jan 29 '22 06:01 ALBINPRAVEEN

This is the code which checks file size: https://github.com/smcclennon/SongID/blob/b34894c7d345e2532e5c16fbb8a1f1f01f019d36/SongIDProcessor.py#L77-L90

Everything is in a very bad practice "catch all", so if the try fails for any reason, it will report the file as being too large.

You could troubleshoot the problem by figuring out what file size Telegram is reporting the file as being like so:

try: 
    file_info = context.bot.get_file(file_id)  # Get file information from Telegram
    file_size = file_info["file_size"]  # Extract file size
    print(f'Telegram reported file size: {file_size}')  # Print file size

If nothing is printed, then it means the try definitely failed. You should then try removing the try except to see what the actual exception is.

smcclennon avatar Jan 29 '22 11:01 smcclennon

Thanks its wokring but taking a long time to identify the song.Is there any solution for that.Any API fixing?

ALBINPRAVEEN avatar Jan 29 '22 12:01 ALBINPRAVEEN

I tried this but sometimes showing errors.Can u fix it also api take a of time to respond

ALBINPRAVEEN avatar Jan 29 '22 13:01 ALBINPRAVEEN

The API SongID uses for music identification is ACR Cloud. I haven't personally experienced slow response times. You could be experiencing slow download times from Telegram, slow disk I/O, or slow upload to ACRCloud.

smcclennon avatar Jan 29 '22 14:01 smcclennon

Not wokring bro can u try its not showing any error but when a song is send to the bot it wont resond

ALBINPRAVEEN avatar Jan 31 '22 05:01 ALBINPRAVEEN

image image

ALBINPRAVEEN avatar Jan 31 '22 05:01 ALBINPRAVEEN

You should set up Sentry so you receive all error reports for the bot.

The error is occurring here: https://github.com/smcclennon/SongID/blob/c15bd9107f401d84c6ab55d5e1e41a95ecdd5ddd/SongIDProcessor.py#L263 https://github.com/smcclennon/SongID/blob/c15bd9107f401d84c6ab55d5e1e41a95ecdd5ddd/ACRAPI.py#L61-L66

To enable Sentry and receive detailed error reports from the bot, simply create an account, create a Python project, and place your DSN here: https://github.com/smcclennon/SongID/blob/c15bd9107f401d84c6ab55d5e1e41a95ecdd5ddd/data/token_example.json#L27-L29

smcclennon avatar Jan 31 '22 08:01 smcclennon

Bro i dont understand clearly. Btw if u have telegram or insta cam u give me ur username so that i can contact u there. Or pls msg me @i_am_albin_praveen this is my username.. I wanna fix this thing bro🙏🏻

ALBINPRAVEEN avatar Jan 31 '22 09:01 ALBINPRAVEEN

It's more beneficial to discuss here so others can also understand in future.

Your error is occurring between line 62-66 because ACR: Processing request... is seen in your logs but ACR: Processing complete! is not. https://github.com/smcclennon/SongID/blob/c15bd9107f401d84c6ab55d5e1e41a95ecdd5ddd/ACRAPI.py#L61-L66

SongID has been designed to report errors like this through Sentry, which is error reporting software. Once you sign up, you will need to create a project within Sentry, similar to how you created a project within ACRCloud. You will be provided with a "DSN". You need to place that in your tokens.json, there is a place for it: https://github.com/smcclennon/SongID/blob/c15bd9107f401d84c6ab55d5e1e41a95ecdd5ddd/data/token_example.json#L27-L29

Once you have done this, Sentry will provide you with detailed information for all errors which occur.

smcclennon avatar Jan 31 '22 10:01 smcclennon

image image image image image

ALBINPRAVEEN avatar Jan 31 '22 13:01 ALBINPRAVEEN

Any fix??

ALBINPRAVEEN avatar Feb 02 '22 08:02 ALBINPRAVEEN

You may have exposed your Telegram bot token in those screenshots, you should request a new token from BotFather as soon as possible.

Please paste the full stack trace for any issues occurring in ACRAPI.py as that is where I believe your main problem lies.

smcclennon avatar Feb 02 '22 08:02 smcclennon

Idk bro what the error is

ALBINPRAVEEN avatar Feb 05 '22 07:02 ALBINPRAVEEN

Bro can u suggest me where i can get the api

ALBINPRAVEEN avatar Jun 19 '22 14:06 ALBINPRAVEEN

Can you confirm that you are sending messages directly to the bot, and not from a group/channel?

smcclennon avatar Jun 19 '22 14:06 smcclennon