Since i learned a lot of more advanced python things in two months, i rebuilt sterra (again) because its architecture was completely fucked up, i don't even know how it was still working without issues ... . So i used things i discovered such as `*args` and `**kwargs`, prebuilt function for classes such as `__str__` or `__call__`, `getattr()`, `globals()`, custom Exceptions, `self.func()`, etc
Arguments
- Added the argument `--only-usernames` in export module to export only usernames (doesn't scrape the informations about them)
- Simplified the exports and path system; at each export, the history saves the path and creates an id for the path (based on the timestamp). This id is then used to get the file, instead of the long path (the long path is still working). Also improved the History module, that can show the path of an id, and vice versa.
- Added the argument `-p|--part` in export module that is mutually exclusive with `-t|--target`, to fill the path of the part that we want to continue to export. The mutual exclusion is because the part is stored in the history, and the target list is stored in it. This change removes the error of target list when taking back the export of a part.
- Added the `interests` to `--analysis-type` in analyse module, that will show the accounts that have the most chances of being interests of the user.
- Added `--raw-raising` to the base parser, that raises the Exceptions instead of priting their name and what's going on. Useful for devellopement and debug purpose.
- Added `--clear-parts` to history module, to delete all the part stored in the module directory, and `--file-id` to get the path of a file from its export id.
- Added a `--name` option for every module that can export a file. This allows to choose the custom name of the file.
- Added `--compare-tree` that shows all the tree that leads to the compared file (to see what have been compared to what)
Architecture
- Turned all the many parsers that was launched by a choice checking sys.argv in one single parser with the `ArgumentParser().add_subparsers()` function.
- Exceptions are now real exceptions, that can be raised if you use the new argument `--raw-raising`
- Outputs are now centralized in one function called for every print (but tqdm), so it is easier for the program to control colors, logos, etc.
- Now checking if you have access to the account if it is in private.
- Created a file that contains useful functions and definitions, to centralize these things and make it easier to change.
- The function to makes names for the files to export have now a module to do that (extrarra) since it was causing a lot of trouble.
Details
- Instagram id now exported under str (it was exported under int before and was complicating the values conversion of dicts)
- Made a big work on the file names. To know what data was in before, it was based on regex trying to find match the name splited. Now it is working with a clear spliting and a defined letters indicating values. That makes the files and path more efficient and customizable.
- Now, if during data extraction an username responds 404, instead of skipping adding it and causing the export of a path, adding it to the result with None for each keys except for username.
- Removed the printing of the username of the account you're using in export module because it was indiscreet if you want to take a screenshot.
- If the `--name` is already taken, the program will ask for another until it is a not used one.
- It is now possible to compare list exported from compare module.