6 ms·
Ok, ignoring the many “why?” questions I have as an Old One with zero interest in TikTok and even less in artificial likes, there are lots of code smells here.
by yawpitch 2y ago
Ok, ignoring the many “why?” questions I have as an Old One with zero interest in TikTok and even less in artificial likes, there are lots of code smells here.
First off, installing dependencies as a default side effect of just running the file. This could cause all sorts of problems for a user, especially given you’re doing it in a naked except clause, which means your script could kick off pip installs under all sorts of circumstances that have nothing to do with missing dependencies.
Second off, sourcing [a hopefully not malicious] Tesseract .zip (or anything) from a random Google Drive link, again as a side effect of merely running the script. Especially problematic in this case as the script assumes you’re running this on Windows, but the side effects will happen before the script fails anyway on other OSs.
Third, not sure why you’re using a path inside the repo to hold the (ephemeral) captcha PNG… tempfile might be of help here.
Fourth, all those fixed length sleeps seem like a good way to teach a server-side tool that your likes aren’t organic.
Lastly, consider running black and pylint on your Python code. Formatting everything to be more readable helps, as does fixing all the complaints you’ll get about naming.