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

cannot use dynamic date in feed_url #60

Open
yoyomax80400 opened this issue Feb 2, 2022 · 1 comment · May be fixed by #87
Open

cannot use dynamic date in feed_url #60

yoyomax80400 opened this issue Feb 2, 2022 · 1 comment · May be fixed by #87

Comments

@yoyomax80400
Copy link

I can't use {{now().strftime('%d-%m-%Y')}}in the feed_url, it's seem to never work ..

could please tell me if it's possible ?

@yoyomax80400 yoyomax80400 changed the title cannot use dynamic datetime cannot use dynamic date in feed_url Feb 2, 2022
@yoyomax80400
Copy link
Author

This is the track from the log

Traceback (most recent call last): File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 684, in async_device_update await task File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/homeassistant/custom_components/feedparser/sensor.py", line 93, in update parsed_feed = feedparser.parse(self._feed) File "/usr/local/share/homeassistant/lib/python3.9/site-packages/feedparser/api.py", line 216, in parse data = _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result) File "/usr/local/share/homeassistant/lib/python3.9/site-packages/feedparser/api.py", line 115, in _open_resource return http.get(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result) File "/usr/local/share/homeassistant/lib/python3.9/site-packages/feedparser/http.py", line 171, in get f = opener.open(request) File "/usr/local/lib/python3.9/urllib/request.py", line 517, in open response = self._open(req, data) File "/usr/local/lib/python3.9/urllib/request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain result = func(*args) File "/usr/local/lib/python3.9/urllib/request.py", line 1389, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/usr/local/lib/python3.9/urllib/request.py", line 1346, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/usr/local/lib/python3.9/http/client.py", line 1285, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.9/http/client.py", line 1296, in _send_request self.putrequest(method, url, **skips) File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/util/async_.py", line 152, in protected_loop_func return func(*args, **kwargs) File "/usr/local/lib/python3.9/http/client.py", line 1130, in putrequest self._validate_path(url) File "/usr/local/lib/python3.9/http/client.py", line 1230, in _validate_path raise InvalidURL(f"URL can't contain control characters. {url!r} " http.client.InvalidURL: URL can't contain control characters. "/templates/webnext_exclusive/views/includes/epg_cache/programme-tv-rss_{{'{:02d}-{:02d}-{}'.format(now().day, now().month, now().year)}}.xml" (found at least ' ')

@ogajduse ogajduse linked a pull request Aug 17, 2023 that will close this 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

Successfully merging a pull request may close this issue.

1 participant