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

[Feature Request] Search mangadex using search terms #42

Closed
jakoblover opened this issue May 22, 2020 · 7 comments · Fixed by #173
Closed

[Feature Request] Search mangadex using search terms #42

jakoblover opened this issue May 22, 2020 · 7 comments · Fixed by #173
Labels
enhancement New feature or request

Comments

@jakoblover
Copy link

Is your feature request related to a problem? Please describe.
It is cumbersome to find the url on mangadex if i know exactly the name of the manga i wanna read

Describe the solution you'd like
I would like to search mangadex for a manga straight in Mango. If I know exactly what I want, I would like to enter a search term and get a list of candidates.

Additional context
It doesn't have to be very complicated, but a simple search engine would be nice.

@jakoblover jakoblover added the enhancement New feature or request label May 22, 2020
@hkalexling
Copy link
Member

I agree it would be nice feature to have, but as far as I know MangaDex does not have open APIs for searching, so the only way to have the functionality is to parse the HTML directly. This can be problematic and will probably break things when they update their UI :/

@jaredlt What do you think?

@hkalexling
Copy link
Member

hkalexling commented May 22, 2020

I found a MangaDex JS API that does this by matching manga URLs in the HTML using regex. See https://github.com/md-y/mangadex-full-api/blob/01d7284849bec5f9bd5f683da1dd2445e97babeb/src/structure/manga.js#L234-L241

This approach should be more robust. I think it's worth trying out.

@jaredlt
Copy link
Collaborator

jaredlt commented May 23, 2020

Agree that the API would be best. I just asked in their Discord to check and search still isn't available unfortunately. So looks like scraping is the only option. Some random thoughts and comments:

  • How do we ensure the user is logged in?
  • Handling errors and rate limits (we may want to explore some form of exponential backoff as we wouldn't want a Mangadex's user account to be banned because another Mango admin keeps trying to search - worst case, but something to consider)
  • Rather than regex the entire html would it be better to reach for a html parser and then iterate of each <a tag? I see there's a native .parse_html method or the myhtml shard looks good (maybe overkill for v1)
  • The quick search results page is pretty clean html. If we want to bring in eg. Title, Author, Image it may not be too difficult to scrape this data and still do it in a reasonably robust way.
  • I really like the simplicity of the single input form on the Download page and I wonder if we can avoid making it more complex ie. handle all cases (id, url, search term). URL is easy to detect but in it's current form if a manga title is just numbers this will conflict with being able to search. I've seen systems like Radarr get around this by introducing a prefix eg. by default it will search by search term but if you enter imdb:tt0116481 is will search by id. We could perhaps do something similar eg. mangadex:5420

@jakoblover
Copy link
Author

It would probably not be very hard to have the single search bar. If it's a valid mangadex id and does not return any results specifically for that id, search using search terms.

@Baitinq
Copy link

Baitinq commented Jan 27, 2021

I agree that this would be an extremely good addition to mango.

@hkalexling
Copy link
Member

FYI we had some discussions on improving MangaDex integration at #24. I will work on that soon, and the searching feature will also be implemented as a by-product of #24 :)

@mango-assistant
Copy link

Hi there! The feature has been added in v0.21.0. Thanks for the feature request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants