In this release, we focused on enhancing search functionality, improving script structure and error handling, and updating dependencies.
Highlights
Search
- Pagination for navigating through search results.
- Caching of previously visited pages to avoid re-fetching.
- Improved user experience with added options and better error handling.
Features
- Appended a book emoji (📖) before each title in the search results.
- Added the ability to navigate to the next page and previous page.
- Added "➡️ Next page" and "⬅️ Previous page" options to the
titlesandurlslists. - Added "🔍 Search again" and "❌ Exit" options to the
titlesandurlslists. - Implemented caching of previously visited pages to avoid re-fetching them.
Refactors
- Improved main script structure and error handling:
- Renamed
clsfunction toclear_terminalfor better readability (unused). - Moved
choicesinside themainfunction to limit its scope. - Added
sysimport for handling script exit. - Improved error handling by checking if
selected_actionisNoneand exiting gracefully. - Wrapped
mainfunction call in atryblock to handleKeyboardInterruptand exit gracefully. - Renamed variables for clarity:
optionstoactionsandrestoresult.
- Renamed
- Improved chapter fetching and error handling:
- Renamed variable
craptoscriptfor better readability. - Added a check to ensure
stringis notNonebefore proceeding. - Simplified
download_folderassignment using a conditional expression. - Added logging for cases where no tracks are found in the provided URL.
- General cleanup and improved readability.
- Renamed variable
- Improved search module structure and error handling:
- Combined
if not_foundandif not_found.text == "Nothing Found"into a single condition. - Added a check to ensure
resultsis a list before iterating. - Handled "Search again" selection by calling
search_book()recursively. - Handled "Exit" selection by exiting the function gracefully.
- Handled "Next page" and "Previous page" selections to navigate accordingly.
- Combined
Chores
- Updated dependencies and version:
- Bump version from
0.2to0.3. - Updated dependencies:
- json5 from
0.9.10to0.9.28 - pick from
2.3.2to2.4.0 - requests from
2.27.1to2.32.3 - tqdm from
4.64.0to4.67.0 - urllib3 from
1.26.8to2.2.3
- json5 from
- Maintained other dependencies at current versions.
- Bump version from
❤️ Big thanks to Copilot