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

Search method always returns page 1 no matter what page is supplied. #61

Closed
Macaroni-Biff opened this issue Jan 15, 2024 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Macaroni-Biff
Copy link

As the title suggests, I'm having an issue where the search method is always returning the default page of search results, 1. I'm attempting to use the search method to jump to the 3rd page of the search results. Which is what I assume the page argument is for...

Enma version: 2.2.1
Python version: 3.12
OS: Windows 10 (Though I'm using bash for windows)
Source: This is happening while using the nHentai source. I haven't tested with any other sources.

My code:

from typing import cast
from enma import Enma, DefaultAvailableSources, CloudFlareConfig, NHentai, Sort

enma = Enma[DefaultAvailableSources]()
config = CloudFlareConfig(
    user_agent='<my-user-agent>',
    cf_clearance='<my-cf-clearance>'
)

enma.source_manager.set_source(source_name='nhentai')
nh_source = cast(NHentai, enma.source_manager.source)
nh_source.set_config(config=config)

foo = enma.search('tanline', 3)
print(foo)
print('Output: ' + str(foo.page))

The printed object (sorry, I didn't take the time to make it prettier. It's late.):

image

Second print result:
Output: 1

This will always be the case. No matter what number I supply to the page argument, it is always returned as 1.

That's the only issue, everything else works perfectly fine. I'm able to search, view and download everything. I just need to get this search pagination implemented and I'll be golden ponyboy!

Please let me know if I'm misunderstanding what the page parameter is supposed to be used for, as this could very well be a layer 8 issue. However, if that's the case and this always returns 1 then I don't really see why it's a required value.

Thank you so much for this library and all the hard work put into it!

@AlexandreSenpai AlexandreSenpai self-assigned this Jan 17, 2024
@AlexandreSenpai AlexandreSenpai added the bug Something isn't working label Jan 17, 2024
@AlexandreSenpai
Copy link
Owner

AlexandreSenpai commented Jan 17, 2024

Hello, thanks for reporting. This is a bug indeed. page property represents the source pagination value. That means that the page must match the source current pagination number.

@AlexandreSenpai
Copy link
Owner

Fixed. It will be available in the next release

@AlexandreSenpai
Copy link
Owner

Available at version 2.3.0!

pip install enma==2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants