Conversation
6aa2e4b to
8b29498
Compare
|
horstle
left a comment
There was a problem hiding this comment.
All in all some nice improvements.
| """Perform an HTTP request and return request""" | ||
| log(0, 'Request URL: {url}', url=url) | ||
|
|
||
| def _http_request(url, headers=None, time_out=30): |
There was a problem hiding this comment.
the headers parameter would be unused after this change
| return response # Return the response for streaming | ||
| except (HTTPError, URLError) as err: | ||
| log(2, 'Download failed with error {}'.format(err)) | ||
| if yesno_dialog(localize(30004), '{line1}\n{line2}'.format(line1=localize(30063), line2=localize(30065))): # Internet down, try again? |
There was a problem hiding this comment.
Please leave this comment in, so one doesn't have to look up what message 30065 says.
| if req is None: | ||
| return None | ||
| continue | ||
| while True: |
There was a problem hiding this comment.
I try to avoid while True. To make sure we can never get stuck in an infinite loop, I would stick with while size < total_length
| time_left = int(round((total_length - size) * (time() - starttime) / size)) | ||
| prog_message = '{line1}\n{line2}'.format( | ||
| line1=message, | ||
| line2=localize(30058, mins=time_left // 60, secs=time_left % 60)) # Time remaining |
There was a problem hiding this comment.
Again, keep the comment. I don't want to have to look up what message 30058 is.
| cdm_versions = http_get(config.WIDEVINE_VERSIONS_URL) | ||
| log(0, f"Available Widevine versions from repo: {cdm_versions}") | ||
| cdm_versions = cdm_versions.strip('\n').split('\n') | ||
| log(0, f"Available Widevine versions from repo: {cdm_versions}") |
There was a problem hiding this comment.
I think this is a bit much, even in a debug log

No description provided.