Extravi / araa-search

A privacy-respecting, ad-free, self-hosted Google metasearch engine with strong security that offers full API support and utilizes Qwant for images, and DuckDuckGo for auto-complete.
https://araa.extravi.dev
GNU Affero General Public License v3.0
241 stars 22 forks source link

Make images.py and videos.py more readable. #76

Closed amogusussy closed 11 months ago

amogusussy commented 11 months ago

Right now, there's a just a tone of inline for loops. This makes it harder to read, as everything's all over the place. This PR replaces all that with one single for loop for all the results, which appends a dict to the results var. This makes it more readable, since everything's in one place, and doesn't have any hidden inline logic. This also makes the api self documenting. Before this PR, you have to know the exact index of each item you want to get. Now, you can use a named key to grab the item you want. This also removes the requests.get in __init__.py that gets localhost. I would have done it for the text results too, but as you mentioned in #68, you're working on something with that, and interfering with the text results might cause some conflicts.

Extravi commented 11 months ago

Please don't open this pull request again. I don't like changes to my defaults, and these changes are also unnecessary.