DistriNet / tranco-python-package

Python package to access the Tranco list
MIT License
20 stars 9 forks source link

Old lists not downloadable #1

Closed rflume closed 5 years ago

rflume commented 5 years ago

Hi,

when I try to download the list from 01 Jan. 2019 I get an BadZipFile("File is not a zip file") error. I can, however, directly download the list (.csv file) from the website.

The code to download the list is the following:

from tranco import Tranco

t = Tranco(cache=True, cache_dir='.tranco')
list_jan = t.list('2019-01-01')

The same error occurs for the list of 2019-02-01 while retreiving 2019-01-01 (and any list after that) works as expected.

Is there a workaround to fix this, like downloading the csv file directly through the Tranco module?

Thanks!

VictorLeP commented 5 years ago

Thank you for notifying us of this issue! Older lists are not available as ZIP files, but I've now added a fallback that will directly download the csv in such cases.

rflume commented 5 years ago

Thank you for the quick fix!