Skip to content
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

Fixed shareus.io/shrs.link #34

Merged
merged 2 commits into from
Apr 18, 2024
Merged

Fixed shareus.io/shrs.link #34

merged 2 commits into from
Apr 18, 2024

Conversation

whitedemon938
Copy link
Collaborator

Fixed Shareus.io / shrs.link

@whitedemon938 whitedemon938 merged commit 7e0c2ea into main Apr 18, 2024
0 of 4 checks passed
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Diffusion123 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

"initial": "true",
"referrer": "https://shareus.io/",
}
DOMAIN = f"https://api.shrslink.xyz"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_refinement): Consider using a constant for the DOMAIN value.

Hardcoding URLs can lead to issues if the URL changes. It's better to define such URLs in a configuration file or as a constant at the top of the module.

Suggested change
DOMAIN = f"https://api.shrslink.xyz"
# At the top of the module
API_DOMAIN = "https://api.shrslink.xyz"
# In the relevant function or method
DOMAIN = API_DOMAIN

if res:
return res.json()['link_info']['destination']
else:
raise DDLException("Link Extraction Failed")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_clarification): Consider adding specific error messages for different failure cases.

Using the same error message for different types of failures can make debugging more difficult. Providing more specific messages can help identify issues more quickly.

Suggested change
raise DDLException("Link Extraction Failed")
raise DDLException("Link Extraction Failed: No response or invalid format received")

"initial": "true",
"referrer": "https://shareus.io/",
}
DOMAIN = f"https://api.shrslink.xyz"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): We've found these issues:

@whitedemon938 whitedemon938 deleted the beta branch April 29, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant