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

[CUMLOUDER] fix needed "POST" #140

Closed
wants to merge 1 commit into from

Conversation

bachig26
Copy link
Contributor

search returns 'null' type error, have some issue - POST Method.

if anyone can fix it, it'll be nice. @appdevelpo @OshekharO

@appdevelpo
Copy link
Member

try fetch()

@bachig26
Copy link
Contributor Author

try fetch()

i did change, but doesn't help

async search(kw) {
 const url = "https://www.cumlouder.com/search/";
 const res = await fetch(url, {
    method: "POST",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8",
      "Accept-Encoding": "gzip",
      "Accept-Language": "en-US,en;q=0.5",
      "Connection": "keep-alive",
      "referer": "https://www.cumlouder.com/",
      "origin": "https://www.cumlouder.com",
    },
    body: `form[search]=${kw}`,
 });

got some different error,

Invalid argument (source): Must be a String or List<int>.: _Map len:5
#0      new HtmlInputStream (package:html/src/html_input_stream.dart:73)
#1      new HtmlTokenizer (package:html/src/tokenizer.dart:75)
#2      new HtmlParser (package:html/parser.dart:156)
#3      parse (package:html/parser.dart:42)
#4      ExtensionService.initRuntime.<anonymous closure> (package:miru_app/data/services/extension_service.dart:171)
#5      QuickJsRuntime2.initChannelFunctions.<anonymous closure> (package:flutter_js/quickjs/quickjs_runtime2.dart:251)
#6      Function._apply (dart:core-patch/function_patch.dart:11)
#7      Function.apply (dart:core-patch/function_patch.dart:35)
#8      _DartFunction.invoke (package:flutter_js/quickjs/object.dart:33)
#9      QuickJsRuntime2._ensureEngine.<anonymous closure> (package:flutter_js/quickjs/quickjs_runtime2.dart:82)
#10     channelDispacher (package:flutter_js/quickjs/ffi.dart:202)
#11     _FfiCallbackchannelDispacher (dart:ffi)
#12     FfiTrampoline_jsIsException (dart:ffi)
#13     QuickJsRuntime2._executePendingJob (package:flutter_js/quickjs/quickjs_runtime2.dart:157)
#14     QuickJsRuntime2.dispatch (package:flutter_js/quickjs/quickjs_runtime2.dart:168)
#15     QuickJsRuntime2.executePendingJob (package:flutter_js/quickjs/quickjs_runtime2.dart:230)
#16     HandlePromises._doHandlePromise.<anonymous closure> (package:flutter_js/extensions/handle_promises.dart:109)
#17     HandlePromises._doHandlePromise.<anonymous closure>.<anonymous closure> (package:flutter_js/extensions/handle_promises.dart:112)
#18     new Future.delayed.<anonymous closure> (dart:async/future.dart:427)
#19     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18)
#20     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398)
#21     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429)
#22     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184)

i don't know if this is related to the form token that comes with the keyword search in the request. as you see in the original code line 48.

@appdevelpo
Copy link
Member

appdevelpo commented Dec 21, 2023

const res = await this.request(`/search/?q=${kw}`, {
      headers: {
        "Content-Type": "application/x-www-form-urlencoded",
		"referer": "https://www.cumlouder.com/",
      },
      data: `form[search]=${kw}`,
      method: "post",
    });
    console.log(res);
does it mean success

image

@bachig26
Copy link
Contributor Author

const res = await this.request(`/search/?q=${kw}`, {
      headers: {
        "Content-Type": "application/x-www-form-urlencoded",
		"referer": "https://www.cumlouder.com/",
      },
      data: `form[search]=${kw}`,
      method: "post",
    });
    console.log(res);
does it mean success

it doesn't work.

miru_Kmv0rn5XjZ

@OshekharO
Copy link
Member

OshekharO commented Dec 22, 2023

@bachig26

async search(kw, page) {
    const res = await this.request('', {
      headers: {
        "Miru-Url": `https://www.cumlouder.com/search/${page}?q=${kw}`,
        "Content-Type": "application/x-www-form-urlencoded",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8",
        "referer": "https://www.cumlouder.com/",
        "origin": "https://www.cumlouder.com",
      },
      data: {
        'form[search]': kw,
      },
      method: "POST",
    });

    const bsxList = await this.querySelectorAll(res, "div.box-escena");
    const novel = [];
    for (const element of bsxList) {
      const html = await element.content;
      const url = await this.getAttributeText(html, "h3 > a", "href");
      const title = await this.querySelector(html, "h3 > a").text;
      const cover = await this.querySelector(html, "img").getAttributeText("data-src");
      novel.push({
        title: title.trim(),
        url: "https://www.cumlouder.com" + url,
        cover,
      });
    }
    return novel;
  }

Can you try this and check what response it's giving? Also don't create this many extension of 🙈.

@bachig26
Copy link
Contributor Author

Can you try this and check what response it's giving? Also don't create this many extension of 🙈.

It's because these are the ones that's easy to create and you know from my msg on TG on Non-NSFW extensions. I started creating lot of good non-nsfw extensions but they're either doesn't work or has encrypted. 🥹

@bachig26
Copy link
Contributor Author

Can you try this and check what response it's giving?
it just gives me an msg., "No data".

also i'm closing this anyway as i don't know how to fix it.

@bachig26 bachig26 closed this Dec 22, 2023
@bachig26 bachig26 deleted the cumlouder branch December 22, 2023 09:24
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

Successfully merging this pull request may close these issues.

3 participants