home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.67k stars 29.95k forks source link

downloader component doesn't work with `ftp://` scheme #10968

Closed phardy closed 6 years ago

phardy commented 6 years ago

Home Assistant release (hass --version): 0.59.1

Python release (python3 --version): Python 3.5.3

Component/platform: downloader

Description of problem: I'm trying to download weather forecast data that is only available via anonymous FTP. Fetching the URL works in my local browser and using curl on the same machine running Home Assistant. But the downloader is unable to do so. Calling the download_file service results in this error in the log:

2017-12-05 22:16:47 ERROR (MainThread) [homeassistant.core] Invalid service data for downloader.download_file: invalid url for dictionary value @ data['url']. Got 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10064.xml'

I've tested my download with an HTTPS URL ("https://www.google.com/"), and the content I expect is downloaded

Expected: I expect the file to be output to the configured download location. Instead I get the above error, and no file.

Problem-relevant configuration.yaml entries and steps to reproduce:

downloader:
  download_dir: downloads

(yes, I've ensured that $HOME/.homeassistant/downloads/ exists and is writeable, downloading other files results in content in this directory)

  1. Go to the services dev tool.
  2. Select the downloader domain.
  3. Select the download_file service.
  4. Enter this JSON in the Service Data field: {"url": "ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10064.xml"}

Traceback (if applicable): No traceback is generated that I can see, the log message implies that the exception has been caught and dealt with.

Additional info:

phardy commented 6 years ago

sigh Realised not long after posting this issue that my Home Assistant install was a little old.

I've updated from 0.58.1 to 0.59.1 and re-run my tests. An FTP:// URL is still failing while HTTP and HTTPS succeed. Updated the original report.

fabaff commented 6 years ago

Support for FTP is not implemented in the downloader component.

balloobbot commented 6 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

balloobbot commented 6 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍