[docs]defmain()->None:"""Main function for app. Scrape and collect magnets from provided URL. Check torrent dir for currently downloading torrents. Read and populate blacklist. Confirm with data collated which magnets the torrent client should be loaded with and add them to the client. Print torrent names that are now downloading. """parser=_Parser()ifnot_shutil.which("transmission-daemon"):raiseRuntimeError("transmission-daemon is not installed")files=_AppFiles()# instantiate client with settingssettings=_Settings(files.settings)client=_Client(**settings)# scrape magnets and evaluate torrents to load client withmagnets=_Magnets(parser.args.url,_HEADERS)downloading=_Downloading(files.torrents)blacklist=_Blacklist(files.blacklist)approved=_Approved(magnets,downloading,blacklist)# load up approved torrents and announceifapproved:client.add_torrents(*approved.values())print("the following unmatched torrents have just been added:")print("- {}".format("\n- ".join(approved.keys())))