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

Language Filtering #15

Open
frecklemaid opened this issue Mar 29, 2023 · 1 comment
Open

Language Filtering #15

frecklemaid opened this issue Mar 29, 2023 · 1 comment

Comments

@frecklemaid
Copy link

frecklemaid commented Mar 29, 2023

I'm looking for a way to filter results by language and/or format. I've tried the following:
def search(self, query): url = self.base_url query_params = { 'q': query, 'criteria': '', 'language': 'English', 'format': 'epub', }

As well as the following in def parse:
if language != "English": return None

I'm wondering if pagination is the issue as usually the first page of search results for libgen.is at least doesn't have English (or French) results. As you can probably tell, I'm not super familiar with python (much more familiar with Java) and am a beginner programmer. I'll keep trying to work it out on my own and will post the solution if I work it out. As far as I can tell, the first option should work.

@frecklemaid frecklemaid changed the title Feature Request/Guidance Language Filtering Mar 29, 2023
@fallaciousreasoning
Copy link
Owner

fallaciousreasoning commented Mar 29, 2023

Interesting - I would've thought that would work. If you print out the url and enter it in the browser, do you get the results you expect?

https://libgen.rs/fiction/?q=query&criteria=&language=English&format=epub looks like it does the search/filter properly.

I don't think the if statement in parse should be needed but if it helps, it helps 😆

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

No branches or pull requests

2 participants