Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running detect() or detect_multiple() on a webradio will make the script hang #35

Open
outsbart opened this issue Oct 25, 2021 · 2 comments

Comments

@outsbart
Copy link

funny little bug

how to reproduce:
wad.Detector().detect("https://webradio.divsi.unimi.it")

@Feandil
Copy link
Contributor

Feandil commented Oct 26, 2021

Funny little bug indeed.
Taking a quick look, the issue is, I think, that this URL returns an infinite chunked 'audio/mpeg'.
This means that the read at https://github.com/CERN-CERT/WAD/blob/master/wad/detection.py#L97 never returns.
I guess we should set up a sort of limit there...

@outsbart
Copy link
Author

Exactly, one of the solution could be using requests' iter_content and allowing the code to stop reading after a certain size threshold is reached.

Something like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants