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

How to make tldextract do not down load public_suffix_list.dat #332

Closed
SQYYHCJ opened this issue May 25, 2024 · 4 comments
Closed

How to make tldextract do not down load public_suffix_list.dat #332

SQYYHCJ opened this issue May 25, 2024 · 4 comments

Comments

@SQYYHCJ
Copy link

SQYYHCJ commented May 25, 2024

I want to use the DrissionPage deponds on tldextract in offline env.
I use pyinstaller packaged my project. The exception throwed when I run the App.

Exception reading Public Suffix List url https://publicsuffix.org/list/public_suffix_list.dat
Traceback (most recent call last):
File "tldextract\cache.py", line 209, in run_and_cache
File "tldextract\cache.py", line 111, in get
KeyError: "namespace: publicsuffix.org-tlds key: {'urls': ('https://publicsuffix.org/list/public_suffix_list.dat', 'https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat'), 'fallback_to_snapshot': True}"

@ajasonwang
Copy link

I have the same issue, also trying setting suffix_list_urls=None in main() but no luck, will there be a global option to disable default live http request?

@john-kurkowski
Copy link
Owner

Could you share repro steps? The full code you're using and the full error message?

When I clear my cache

>>> import tldextract

>>> tldextract.tldextract.update()

disconnect from the Internet, then run these 2 lines from the README about no live HTTP fetching,

>>> no_fetch_extract = tldextract.TLDExtract(suffix_list_urls=())
>>> no_fetch_extract('http://www.google.com')
ExtractResult(subdomain='www', domain='google', suffix='com', is_private=False)

it works for me, no raised exception.

@john-kurkowski
Copy link
Owner

Possibly related feature request: #233.

@john-kurkowski
Copy link
Owner

Closing due to inactivity. Let me know if you have more details about your issue.

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

3 participants