Zekfad / nhentai_dart

Dart client for nhentai.net undocumented APIs
https://pub.dev/packages/nhentai
ISC License
10 stars 1 forks source link

Update to use newer dependencies #11

Open WeebNetsu opened 1 year ago

WeebNetsu commented 1 year ago

I am primarily interested in the http dependency which is quite outdated, it would be great if it could be updated to v 1.0.0 or higher. This is primarily since other projects using this dependency might run into the below:

Because nhentai 1.0.0-dev.11 depends on http ^0.13.5 and no versions of nhentai match >1.0.0-dev.11 <2.0.0, nhentai ^1.0.0-dev.11 requires http ^0.13.5.
So, because this app depends on both nhentai ^1.0.0-dev.11 and http ^1.1.0, version solving failed.

This can be an issue if http has features or security patches in later versions

Zekfad commented 1 year ago

As part of this I'll probably incorporate fetch_client to increase browser compatibility, do you have any requests for API changes for stable 1.0.0 release?

WeebNetsu commented 1 year ago

Allowing us to search / filter by language and author would also be great!

While we're here, I've also noticed that search responds with API Exception: does not exist whenever you search for some terms (such as furry, baka and dragon ball)

Zekfad commented 1 year ago

You can already do that.

  const tag = nh.Tag(
    id: 0,
    type: nh.TagType.language,
    name: 'english',
    count: 0,
    url: '',
  );

  final q = '${const nh.SearchQueryTag(tag)}';
  final res = await api.search(q).first;

But I admit, it's not so nice with this approach, I'll address it.

As for terms, that is a known API limitation, see https://github.com/Zekfad/nhentai-api/issues/19 for more info. I might add search via site and HTML parsing, but that's out of the scope of this package, I still can do it as a separate package I think.

WeebNetsu commented 1 year ago

Both of those would be great! Thank you a ton!

Zekfad commented 1 year ago

@WeebNetsu I've pushed changes to master, you can use dependency override to point your pubspec to git.

  nhentai:
    git:
      url: https://github.com/Zekfad/nhentai_dart
      ref: master
WeebNetsu commented 1 year ago

Thank you my friend! :)

WeebNetsu commented 1 year ago

Is there by any chance a way to do a search, but then to exclude specific tags from the search?

Zekfad commented 1 year ago

Sure, just add minus before tag search query. Check info page on site, there is syntax help. Also check tags example on master branch.

WeebNetsu commented 1 year ago

Ahh, yes, you are correct, thank you!

WeebNetsu commented 1 year ago

Can we potentially hide or include specific books based on a query search? Such as hide/filter out 177013 and 544301 on a query search? Like how we can do with tags?

Zekfad commented 1 year ago

Use stream methods, e.g. where. I don't think there's a way to refine query to exclude particular books.

WeebNetsu commented 1 year ago

Ahh, damn, I see :')