I once had a bug in a C# program I wrote. It made a HTTP request and if the user agent was left to default (whatever that was), the server just gave back an empty string as a reply. I took way to long until I understood what was going on and I kept chasing async, thinking I had messed it up some how.
It’s because there is no clear indication of where a block ends.
Here is some sample code. I find it difficult to tell how many indentations I have or where I need to write if I want to continue at a certain level.
import time
import aiohttp
"""
Retreives the data from RSS URL and return the status codes as well as the data. Return -1 if something went wrong.
"""
async def get_rss_feed(rss_url):
async with aiohttp.ClientSession() as session:
try:
retry_count = 0
while retry_count < 5:
async with session.get(rss_url) as resp:
if resp.status == 200:
return {'status': resp.status, 'data': await resp.text()}
else:
retry_count += 1
time.sleep(60)
if retry_count == 5:
raise ValueError('To many failed connection attempts', retry_count)
except aiohttp.InvalidURL as error:
return {'status': -1, 'data': f"Error: {rss_url} is not a valid URL.", 'error': error}
except aiohttp.ClientConnectorError as error:
return {'status': -1, 'data': f"Error: Could not connect to {rss_url}.", 'error': error}
except ValueError as error:
return {'status': -1, 'data': f"Error: Could not connect to {rss_url} after {retry_count} attempts.", 'error': error}
If someone really wants this service but do not want to (or cannot) host it themself, https://ovpn.com offer this in their client. I used to have a pi-hole selfhosted but not anymore. Using their client on my phone as well solved the problem with blocking ads while not at home.
Feature-rich
To be able to set download location, not download into folders, change location based on category, stop seeding after ratio or time, watch a folder for torrent files, delete said files after importing them, minimize to tray.
Not sure what transmission can and cannot do, but those are some examples of features in this context. Others may have a different opinion.
I get that a malware can get inside the worlds most secure system, if for example a user lets it in. What I am saying is that showing a honey pot in response to “ssh is more secure than a software that runs code without you giving consent and without your knowledge” not say anything, except what happens if someone gets in.
Ah, gotcha! Thanks