-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update Instagram function to use default API URL if INSTADL_API is not set #298
Conversation
… is not set This commit updates the instagram function in the direct_link_generator.py file to use a default API URL (https://instagramcdn.vercel.app) if the INSTADL_API configuration variable is not provided or is empty. This ensures that the function can still fetch the direct video download URL from an Instagram post even when the INSTADL_API is not set. Signed-off-by: Riajul <[email protected]>
Reviewer's Guide by SourceryThe pull request updates the Instagram function to use a default API URL if No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rjriajul - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- The code contains a hardcoded URL
https://instagramcdn.vercel.app
which could be an API key or secret. (link)
Overall Comments:
- Consider adding a descriptive error message when the API request fails.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
) | ||
full_url = f"{Config.INSTADL_API}/api/video?postUrl={link}" | ||
|
||
api_url = Config.INSTADL_API or 'https://instagramcdn.vercel.app' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 issue (security): The code contains a hardcoded URL https://instagramcdn.vercel.app
which could be an API key or secret.
This pull request includes changes to the
instagram
function in thebot/helper/mirror_leech_utils/download_utils/direct_link_generator.py
file. The changes improve the handling of the Instagram downloader API by providing a default API URL and simplifying the code structure.Improvements to API handling and code simplification:
bot/helper/mirror_leech_utils/download_utils/direct_link_generator.py
: Updated theinstagram
function to use a default API URL ifConfig.INSTADL_API
is not set, ensuring the function can still operate without a specific API configuration. Simplified the conditional checks for the response data.Summary by Sourcery
Updates the Instagram function to use a default API URL if INSTADL_API is not set, ensuring the function can still operate without a specific API configuration. Simplifies the conditional checks for the response data.
Enhancements: