fallaciousreasoning / CalibreLibgenStore

A Libgen Fiction store plugin for Calibre
MIT License
144 stars 19 forks source link

Language Filtering #15

Open frecklemaid opened 1 year ago

frecklemaid commented 1 year ago

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.

fallaciousreasoning commented 1 year ago

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 :laughing: