-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update #29
Conversation
Signed-off-by: zYxDevs <me@isekai.eu.org>
Format code.
Reviewer's Guide by SourceryThis pull request introduces the addition of an 'apikey' parameter to the constructors of both AsyncWibuAPI and WibuAPI classes, along with a 'headers' attribute. All API calls within these classes have been updated to include the 'headers' parameter. Additionally, the 'getwibu' utility function has been modified to accept and use the 'headers' parameter. The README.md file has also been updated to include a new analytics badge and additional paid features. File-Level Changes
Tips
|
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 @zYxDevs - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 7 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟡 Documentation: 6 issues found
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
@@ -5,267 +5,268 @@ | |||
|
|||
|
|||
class AsyncWibuAPI: | |||
def __init__(self): | |||
def __init__(self, apikey: str = ""): |
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.
suggestion: Consider making 'apikey' a required parameter.
Making 'apikey' a required parameter would ensure that the API key is always provided, which might be necessary for the API calls to function correctly.
def __init__(self, apikey: str = ""): | |
def __init__(self, apikey: str): |
self.base_url = "https://wibu-api.eu.org/api" | ||
self.deprecated_url = "https://api.wibu-api.eu.org/api" | ||
self.headers = {"x-wibu-key": apikey} |
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 (bug_risk): Check for empty API key.
Consider adding a check to ensure that 'apikey' is not empty. If it is, you might want to raise an exception or log a warning.
|
||
# Anime, Donghua, Hentai | ||
async def lendrive(self, link: str): | ||
try: | ||
url = f"{self.base_url}/anime/lendrive?link={link}" | ||
return await getwibu(url, timeout=15) | ||
return await getwibu(url, headers=self.headers, timeout=15) |
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.
suggestion: Consider handling specific exceptions.
Catching a general 'Exception' can make debugging difficult. Consider catching specific exceptions that 'getwibu' might raise.
return await getwibu(url, headers=self.headers, timeout=15) | |
import aiohttp | |
try: | |
url = f"{self.base_url}/anime/lendrive?link={link}" | |
async with aiohttp.ClientSession() as session: | |
async with session.get(url, headers=self.headers, timeout=15) as response: | |
return await response.text() | |
except aiohttp.ClientError as e: | |
return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" |
@@ -5,267 +5,268 @@ | |||
|
|||
|
|||
class WibuAPI: | |||
def __init__(self): | |||
def __init__(self, apikey: str = ""): |
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.
suggestion: Consider making 'apikey' a required parameter.
Making 'apikey' a required parameter would ensure that the API key is always provided, which might be necessary for the API calls to function correctly.
def __init__(self, apikey: str = ""): | |
def __init__(self, apikey: str): |
self.base_url = "https://wibu-api.eu.org/api" | ||
self.deprecated_url = "https://api.wibu-api.eu.org/api" | ||
self.headers = {"x-wibu-key": apikey} |
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 (bug_risk): Check for empty API key.
Consider adding a check to ensure that 'apikey' is not empty. If it is, you might want to raise an exception or log a warning.
- [x] LH Translation ziper | ||
- [x] Shinigami ziper | ||
- [x] Worldmanhwas ziper | ||
- [x] Maid Manga ziper | ||
- [x] Mangayaro ziper | ||
- [x] Cosmicscans ziper | ||
- [x] nHentai ziper | ||
- [x] nHentai, nHentai.to, Hentaifox, AsmHentai, Pururin ziper |
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 (documentation): Consider changing 'ziper' to 'zipper'.
The term 'ziper' appears multiple times in the document. It should be 'zipper'.
- [x] Sheakomik, Sheamanga ziper | ||
- [x] Komikindo.info ziper | ||
- [x] Mikoroku ziper | ||
- [x] Mangakakalot ziper | ||
- [x] OnlyWaifu ziper | ||
- [x] Manhwatop ziper | ||
- [x] Manhuafast ziper | ||
- [x] Drakescans ziper |
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 (documentation): Consider changing 'ziper' to 'zipper'.
The term 'ziper' appears multiple times in the document. It should be 'zipper'.
- [x] Sheakomik, Sheamanga ziper | ||
- [x] Komikindo.info ziper | ||
- [x] Mikoroku ziper | ||
- [x] Mangakakalot ziper | ||
- [x] OnlyWaifu ziper | ||
- [x] Manhwatop ziper | ||
- [x] Manhuafast ziper | ||
- [x] Drakescans ziper | ||
- [x] Omegascans ziper |
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 (documentation): Consider changing 'ziper' to 'zipper'.
The term 'ziper' appears multiple times in the document. It should be 'zipper'.
- [x] Sheakomik, Sheamanga ziper | ||
- [x] Komikindo.info ziper | ||
- [x] Mikoroku ziper | ||
- [x] Mangakakalot ziper | ||
- [x] OnlyWaifu ziper | ||
- [x] Manhwatop ziper | ||
- [x] Manhuafast ziper | ||
- [x] Drakescans ziper | ||
- [x] Omegascans ziper | ||
- [x] Telegra.ph ziper |
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 (documentation): Consider changing 'ziper' to 'zipper'.
The term 'ziper' appears multiple times in the document. It should be 'zipper'.
@@ -55,6 +60,10 @@ | |||
- [x] Javhd | |||
- [x] Search parser | |||
- [x] Download link scraper | |||
- [x] Rule34 downloader | |||
- [x] Bunkrr.su downloader | |||
- [x] NudeCosplayGirl ziper |
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 (documentation): Consider changing 'ziper' to 'zipper'.
The term 'ziper' appears multiple times in the document. It should be 'zipper'.
Summary by Sourcery
This pull request enhances the 'AsyncWibuAPI' and 'WibuAPI' classes by adding support for API key authentication. All API request methods have been updated to include headers with the API key. Additionally, the README.md file has been updated to reflect new paid features and include a Repobeats analytics image.