Aeon
Aeon copied to clipboard
Beta
Summary by Sourcery
Introduce a new NAME_PREFIX feature to allow custom filename prefixes throughout the download and upload pipeline, remove the deprecated LEECH_FILENAME_PREFIX setting, implement prefix application logic, and integrate an InstagramResolver for video downloads via InstaDL API.
New Features:
- Add NAME_PREFIX option to prefix leeched/downloaded file names via UI, config, and CLI (-np)
- Integrate InstagramResolver with TrueLinkResolver for downloading Instagram videos using external InstaDL API
Enhancements:
- Rename and remove legacy LEECH_FILENAME_PREFIX usage in code, replacing with NAME_PREFIX
- Implement proceed_name_prefix method to apply filename prefixes in TaskListener download flow
- Register InstagramResolver during startup
Documentation:
- Update configuration docs and config_sample to replace LEECH_FILENAME_PREFIX with NAME_PREFIX
- Revise help messages to reference NAME_PREFIX instead of LEECH_FILENAME_PREFIX
Reviewer's Guide
This PR introduces a unified NAME_PREFIX feature to replace the old LEECH_FILENAME_PREFIX, implements logic to apply that prefix to downloaded and leeched files, cleans up legacy prefix code in the uploader, and integrates an Instagram resolver into the TrueLink framework.
Sequence diagram for applying NAME_PREFIX during file processing
sequenceDiagram
participant Listener
participant HelperCommon
participant TaskListener
participant FileSystem
Listener->>HelperCommon: Set name_prefix from user_dict or Config
TaskListener->>HelperCommon: Call proceed_name_prefix(dl_path)
HelperCommon->>FileSystem: Rename file(s) with name_prefix if needed
FileSystem-->>HelperCommon: Return new path
HelperCommon-->>TaskListener: Return updated path
Class diagram for NAME_PREFIX unification and InstagramResolver addition
classDiagram
class Config {
JD_PASS: str
IS_TEAM_DRIVE: bool
LEECH_DUMP_CHAT: list[str]
LEECH_SPLIT_SIZE: int
MEDIA_GROUP: bool
HYBRID_LEECH: bool
INSTADL_API: str
HEROKU_APP_NAME: str
HEROKU_API_KEY: str
NAME_PREFIX: str
_convert(key, value)
}
class InstagramResolver {
DOMAINS: list[str]
resolve(url: str): LinkResult | FolderResult
}
Config <|-- InstagramResolver: uses
Class diagram for removal of LEECH_FILENAME_PREFIX and related uploader changes
classDiagram
class TelegramUploader {
_media_dict: dict
_last_msg_in_group: bool
_up_path: str
_user_dump: str
_lcaption: str
_media_group: bool
_nprefix: str
_user_settings()
_prepare_file(file_, dirpath)
}
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Deprecate LEECH_FILENAME_PREFIX in favor of NAME_PREFIX |
|
bot/core/config_manager.pyconfig_sample.pydocs/CONFIGURATIONS.mdbot/helper/ext_utils/help_messages.pybot/modules/users_settings.pybot/modules/mirror_leech.pybot/modules/ytdlp.pybot/helper/mirror_leech_utils/telegram_uploader.py |
| Initialize and resolve name_prefix in common listener |
|
bot/helper/common.py |
| Implement proceed_name_prefix routine and invoke on download complete |
|
bot/helper/common.pybot/helper/listeners/task_listener.py |
| Clean up legacy prefix logic in TelegramUploader |
|
bot/helper/mirror_leech_utils/telegram_uploader.py |
| Integrate InstagramResolver into TrueLink |
|
bot/core/startup.pybot/helper/mirror_leech_utils/download_utils/insta_resolver.py |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Summary of Changes
Hello @5hojib, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new capability for the bot to download content directly from Instagram by leveraging an external InstaDL API. Alongside this new feature, it undertakes a significant refactoring of the file naming prefix functionality, transitioning from LEECH_FILENAME_PREFIX to a more generalized NAME_PREFIX. This change centralizes the logic for applying prefixes to downloaded files and directories, ensuring a more robust and consistent naming convention across various operations.
Highlights
- Instagram Downloader Integration: Added support for downloading content from Instagram by integrating with an external InstaDL API, enabling the bot to resolve and fetch Instagram media.
- Filename Prefix Refactoring: The
LEECH_FILENAME_PREFIXsetting has been renamed toNAME_PREFIXand its implementation has been refactored for more consistent application across all downloaded files and directories. - Centralized Prefix Application: A new
proceed_name_prefixmethod was introduced to handle the renaming of files and folders by applying the configuredNAME_PREFIXafter download completion.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.