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

(Re)moved IENC charts #33

Open
2 of 4 tasks
nohal opened this issue Dec 18, 2022 · 2 comments
Open
2 of 4 tasks

(Re)moved IENC charts #33

nohal opened this issue Dec 18, 2022 · 2 comments

Comments

@nohal
Copy link
Contributor

nohal commented Dec 18, 2022

Investigate what happened to the chart sources:

  • Belgium
  • France - Rhone
  • The Netherlands (Geertruidenberg, Waspik)
  • Poland
@marcelrv
Copy link
Contributor

For the The Netherlands (Geertruidenberg, Waspik) the issue is that the files are downloaded by default with '.zip' extension.
However, for these 2 places it is not actually a zip file containing the ENC but instead it is the file directly.

To fix we would need the script to be more clever in finding the proper filetype
https://github.com/chartcatalogs/scripts/blob/master/nl_ienc.py#L26

but it is a bit tricky as it is not directly visible in the source: https://vaarweginformatie.nl/frp/api/webcontent/downloads?pageId=infra/enc

[{"name":"Zeeland Compleet Week 13 - 2023 - 40MB","version":1,"author":"RWS Zeeland","date":1679994067723,"fileId":3476189474,"externalUrl":null},
{"name":"Waddenzee Compleet Week 12 – 2023 – 43 MB","version":1,"author":"RWS CIV IGA DOA","date":1679914094922,"fileId":3474383083,"externalUrl":null},
{"name":"Port of Rotterdam 2022-12-14","version":1,"author":"Port of Rotterdam","date":1675154649018,"fileId":3410002695,"externalUrl":null},
{"name":"Nederland (excl Zeeland) 2023-01-18- 45MB","version":1,"author":"RWS CIV","date":1674058075107,"fileId":3395631778,"externalUrl":null},
{"name":"IENC Haven Geertruidenberg","version":1,"author":"Gemeente Geertruidenberg","date":1487752185369,"fileId":161337079,"externalUrl":null},
{"name":"IENC Haven Waspik","version":1,"author":"Gemeente Waalwijk","date":1464762736859,"fileId":113616371,"externalUrl":null}]

@marcelrv
Copy link
Contributor

this would be the way to get the filename

from urllib.request import urlopen
url = "https://www.vaarweginformatie.nl/fdd/main/wicket/resource/org.apache.wicket.Application/downloadfileResource?fileId=3474383083"
response = urlopen(url)
filename = response.headers.get_filename()
print(filename)

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

2 participants