LuanRT / google-this

A simple yet powerful module to retrieve organic search results and much more from Google.
https://www.npmjs.com/package/googlethis
MIT License
320 stars 77 forks source link

1.7.1 Search() function returning empty result list regardless of image passed #52

Closed SOME-1HING closed 7 months ago

SOME-1HING commented 1 year ago

Steps to reproduce

import fs from "fs/promises";
import google from "googlethis";

async function reverse(){
  const imageBuffer = await fs.readFile("./sample.jpg");
  const reverse = await google.search(imageBuffer, { ris: true });
  console.log(reverse);
};

reverse()

Failure Logs

{
  results: [],
  videos: [],
  knowledge_panel: KnowledgeGraph {
    type: null,
    title: null,
    description: null,
    url: null,
    metadata: [],
    books: [],
    tv_shows_and_movies: [],
    ratings: [],
    available_on: [],
    images: [],
    songs: [],
    socials: [],
    demonstration: null,
    lyrics: null
  },
  featured_snippet: FeaturedSnippet { title: null, description: null, url: null },
  did_you_mean: null,
  weather: Weather {
    location: null,
    forecast: null,
    precipitation: null,
    humidity: null,
    temperature: null,
    wind: null,
    image: null
  },
  time: Time { hours: null, date: null },
  location: Location { title: null, distance: null, map: null },
  dictionary: Dictionary {
    word: null,
    phonetic: null,
    audio: null,
    definitions: [],
    examples: []
  },
  translation: Translation {
    source_language: null,
    target_language: null,
    source_text: null,
    target_text: null
  },
  top_stories: [],
  unit_converter: Converters {},
  people_also_ask: [],
  people_also_search: []
}
Error: TypeError: Cannot read properties of undefined (reading 'url')
    at Object.reverse (file:///C:/Users/***/Documents/GitHub/telegram-js-bot/src/GReverse.js:29:50)
    at async Object.callback (file:///C:/Users/***/Documents/GitHub/telegram-js-bot/index.js:57:20)

Expected behavior

I was expecting the search() function to return a non-empty array with the search results, such as an array of image URLs or other relevant data. Specifically, I was not expecting the result to be an empty array like {results: []}.

Current behavior

The current behavior is that the search() function is consistently returning an empty results list, represented as an empty array like {results: []}, regardless of the image that is passed as an argument. I have tested the function with multiple images, including those that were previously working before April, but it is still returning an empty results array.

Version

Default

Anything else?

No response

Checklist

n-xsi commented 1 year ago

Same issue over here. Although, it seems they already know about it as there is already a closed issue on it

Strooss commented 1 year ago

same issue

LuanRT commented 1 year ago

For anyone reading this, sorry for the silence in this repo. I want to fix all the bugs and migrate it to TypeScript at some point but I always end up forgetting about it.

Strooss commented 1 year ago

Yes please changing to typescript will be heaven

Johannes-Ptg commented 1 year ago

has there been any update on this? i have the same issue right now, but would to make this work!

edit: looked into this a little bit further by inserting some console.logs on the main.js. it turns out that for me google is blocking my requests and shows a a captcha page.

ispyhumanfly commented 11 months ago

I'm also experiencing the same issue.

threeal commented 11 months ago

It seems also happens on non image search. Any updates? @LuanRT

kafkaesqu3 commented 11 months ago

I think they've changed the tag for the description: This returns no results: https://github.com/LuanRT/google-this/blob/5bca62f9f9ce7a0eb831f415781eea6055d250d2/lib/core/nodes/OrganicResults.js#L61

Resulting in statement this being false: https://github.com/LuanRT/google-this/blob/5bca62f9f9ce7a0eb831f415781eea6055d250d2/lib/core/nodes/OrganicResults.js#L128

Which means the results are never populated Sorry don't know enough javascript to make fix

FraglyG commented 11 months ago

this issue renders the entire package unusable, hoping a fix is applied soon

christopher-inegbedion commented 10 months ago

is the fix going to be merged any time soon?

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.