pyinat / pyinaturalist

Python client for iNaturalist
https://pyinaturalist.readthedocs.io
MIT License
133 stars 16 forks source link

Feature request: Check the file size of audio files #556

Closed arky closed 4 months ago

arky commented 4 months ago

Feature description

Check the file size of audio files and throw an exception error if audio size exceeds 20 MB.

Currently iNat limits the maximum audio file size to 20MB.

JWCook commented 4 months ago

Sure, I can add that. Just curious, what kind of error do you currently get?

arky commented 4 months ago

@JWCook Interestingly you don't get an error from API calls. Just infinite timeout write errors https://github.com/pyinat/pyinaturalist/issues/535

My guess is iNat set this limit in Upload UI but not in the API.

JWCook commented 4 months ago

Oh! Well that's good to know.

How did you determine the limit is 20MB? Just trial and error? The only reference to this I could find in iNat repos was this commented out code and error messages in the Android app.

arky commented 4 months ago

Create a file exceeding 20 MB fallocate -l 22020096 test.wav and upload from web interface. You will get following warning:

image

arky commented 4 months ago

Thank you @JWCook