polyrabbit / hacker-news-digest

:newspaper: Let ChatGPT Summarize Hacker News for You
http://hackernews.betacat.io/
GNU Lesser General Public License v3.0
668 stars 87 forks source link

Update http.py & requirements.txt #27

Closed melroy89 closed 9 months ago

melroy89 commented 10 months ago

Remove external parameter (not used anymore) when upgrading to latest fake-useragent.

polyrabbit commented 10 months ago

Thanks for the lib! just out of curiosity, how did you find I reverted the version...

Also another feedback - it seems we can get a explicit error when failed to get one ua string by setting fallback=None

# https://github.com/fake-useragent/fake-useragent/blob/1.2.1/src/fake_useragent/fake.py#L103-L106
if self.fallback is None:
    raise FakeUserAgentError(
        f"Error occurred during getting browser: {attr}"
    )  # noqa

But __init__ function forbids this setting

# https://github.com/fake-useragent/fake-useragent/blob/1.2.1/src/fake_useragent/fake.py#L40
assert isinstance(fallback, str), "fallback must be string"

Is this the intended behavior?

polyrabbit commented 9 months ago

@melroy89 Merged, thanks. I'm not setting the fallback param now.