GithubHelp home page GithubHelp logo

tanaikech / goris Goto Github PK

View Code? Open in Web Editor NEW
104.0 5.0 14.0 55 KB

This is a CLI tool to search for images with Google Reverse Image Search (goris).

License: MIT License

Go 100.00%
google-image-search reverse-image-search cli cli-tool cli-app golang

goris's Introduction

goris

Build Status MIT License

Overview

This is a CLI tool to search for images with Google Reverse Image Search.

Description

Images can be searched by image files and image URLs. Searched images display URLs and also can be downloaded as image files.

How to Install

Download an executable file from the release page and put to a directory with path.

or

Use go get.

$ go install github.com/tanaikech/goris@latest

IMPORTANT

20230406: In the current stage, the specification for running the reverse image search was changed at Google side. I could modify the script for searching the images using an image URL. But, I have still not modified the script for searching the images using an image file. I'm sorry for this. Now, I am analyzing. When I could do it, I would like to modify this. So, in the current stage, please use the following command.

$ goris s -u [image URL]

Usage

Search images from an image file. You can select number of output URLs using -n. The maximum number of output URLs is 100. (The current default value is 10. So when -n is not used, 10 URLs are returned.)

$ goris s -f [image file] -n 50

Search images from an image URL.

$ goris s -u [image URL]

Download searched images from an image file. Following sample downloads 10 searched images using an image file.

$ goris s -f [image file] -d -n 10

Retrieve web pages with matching images on Google top page. When this is not used, images are retrieved.

$ goris s -u [image URL] -w
$ goris s -f [image file] -w

Licence

MIT

Author

TANAIKE

If you have any questions and commissions for me, feel free to tell me using e-mail of [email protected]

Update History

  • v1.0.0 (April 26, 2017)

    Initial release.

  • v1.0.1 (May 16, 2017)

    1. A bugfix
      • When number of retrieved URLs is smaller than number of default output, an error had occurred. This was fixed. (Thank you! Steve Davis)
  • v1.1.0 (June 13, 2017)

    1. Add option
      • When images are matched to a searched image, web pages with matching images are retrieved. These are web pages displayed on Google top page. When this is not used, images are retrieved. This was added as a boolean option. (This was added by a request.)

  • v1.1.1 (January 3, 2020)

    1. It seems that the specification of github.com/urfave/cli was changed by the update of https://github.com/urfave/cli. By this, when go get -u github.com/tanaikech/goris is run, an error occurred. So this error was removed.

  • v2.0.0 (April 23, 2020)

    1. The specification for running the reverse image search was changed at Google side. By this, this application was also changed.

  • v3.0.0 (February 23, 2022)

    1. The specification for running the reverse image search was changed at Google side. By this, this application was also changed.

  • v3.0.1 (May 2, 2022)

    1. About the option -w, a bug was resolved. By this, the URLs of the related Web site are returned. As the default, 10 URLs are returned. If you want to retrieve more, please use the option -n like -n 20.

  • v3.0.2 (February 2, 2023)

    1. Modified go.mod and go.sum.

  • v3.0.3 (April 6, 2023)

    1. Rebuild with the latest version.

  • v3.0.4 (April 6, 2023)

    1. The specification for running the reverse image search was changed at Google side. By this, this application was also changed. But, in the current stage, an image file in the local PC cannot be searched while an image URL can be searched. Now, I am analyzing. When I could do it, I would like to modify this. So, in the current stage, please use the following command.
     $ goris s -u URL

TOP

goris's People

Contributors

tanaikech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

goris's Issues

Doesn't work with files

> goris s -f /home/d9k/Pictures/myFile.png 
# Specification at Google side has been changed. By this, this command cannot be still modifying. So, in the current stage, this command cannot be used. I apologize for this situation.
# Please use goris s -u URL

Either fix searching by file or update README (for example add message written in italic on top of README and duplicate it on https://github.com/tanaikech/goris?tab=readme-ov-file#usage). It's unclear that program can't work with files until you try to do it.

'cannot find package "github.com/cpuguy83/go-md2man/v2/md2man"' during install

I'm on Mac High Sierra. Here's my go version ...

go version
go version go1.10 darwin/amd64

But following the install command, I get this error

davea$ go get -u github.com/tanaikech/goris
package github.com/cpuguy83/go-md2man/v2/md2man: cannot find package "github.com/cpuguy83/go-md2man/v2/md2man" in any of:
/usr/local/Cellar/go/1.10/libexec/src/github.com/cpuguy83/go-md2man/v2/md2man (from $GOROOT)
/Users/davea/go/src/github.com/cpuguy83/go-md2man/v2/md2man (from $GOPATH)

Error installing package

I am getting some errors when trying to install the package:

$ go version
go version go1.16.3 darwin/amd64
$ go get -u github.com/tanaikech/goris                                                                               
go: downloading github.com/tanaikech/goris v1.1.1
go: downloading github.com/tanaikech/goris v2.0.0+incompatible
go: downloading github.com/PuerkitoBio/goquery v1.6.1
go: downloading github.com/urfave/cli v1.22.5
go: downloading github.com/andybalholm/cascadia v1.1.0
go: downloading golang.org/x/net v0.0.0-20200202094626-16171245cfb2
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: downloading github.com/andybalholm/cascadia v1.2.0
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading golang.org/x/net v0.0.0-20210428140749-89ef3d95e781
go: downloading github.com/russross/blackfriday v1.6.0
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
# github.com/tanaikech/goris
../../go/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:64:12: cannot use []*cli.Author{...} (type []*cli.Author) as type []cli.Author in assignment
../../go/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:69:13: cannot use []*cli.Command{...} (type []*cli.Command) as type []cli.Command in assignment
../../go/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:79:6: unknown field 'Aliases' in struct literal of type cli.StringFlag
../../go/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:84:6: unknown field 'Aliases' in struct literal of type cli.StringFlag
../../go/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:89:6: unknown field 'Aliases' in struct literal of type cli.IntFlag
../../go/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:95:6: unknown field 'Aliases' in struct literal of type cli.BoolFlag
../../go/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:100:6: unknown field 'Aliases' in struct literal of type cli.BoolFlag

Pages that include matching images

Hi,

Correct me if i'm wrong but as far as i saw the tool only returns the related images from the google search while my use case is more towards the websites\pages that hosted the matched images i.e. "Pages that include matching images"

Is there any way to search\filter by those alone?

unknown field 'Aliases' in struct literal of type cli.BoolFlag

> go get -u github.com/tanaikech/goris
go: downloading github.com/tanaikech/goris v1.1.1
go: downloading github.com/tanaikech/goris v2.0.0+incompatible
go: github.com/tanaikech/goris upgrade => v2.0.0+incompatible
go: finding module for package github.com/urfave/cli
go: finding module for package github.com/PuerkitoBio/goquery
go: downloading github.com/urfave/cli v1.22.5
go: found github.com/urfave/cli in github.com/urfave/cli v1.22.5
go: found github.com/PuerkitoBio/goquery in github.com/PuerkitoBio/goquery v1.6.1
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: github.com/andybalholm/cascadia upgrade => v1.2.0
go: github.com/cpuguy83/go-md2man/v2 upgrade => v2.0.0
go: github.com/russross/blackfriday/v2 upgrade => v2.1.0
go: golang.org/x/net upgrade => v0.0.0-20210405180319-a5a99cb37ef4
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/russross/blackfriday/v2 v2.1.0
# github.com/tanaikech/goris
../../go/packages/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:64:12: cannot use []*cli.Author literal (type []*cli.Author) as type []cli.Author in assignment
../../go/packages/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:69:13: cannot use []*cli.Command literal (type []*cli.Command) as type []cli.Command in assignment
../../go/packages/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:79:6: unknown field 'Aliases' in struct literal of type cli.StringFlag
../../go/packages/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:84:6: unknown field 'Aliases' in struct literal of type cli.StringFlag
../../go/packages/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:89:6: unknown field 'Aliases' in struct literal of type cli.IntFlag
../../go/packages/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:95:6: unknown field 'Aliases' in struct literal of type cli.BoolFlag
../../go/packages/pkg/mod/github.com/tanaikech/[email protected]+incompatible/goris.go:100:6: unknown field 'Aliases' in struct literal of type cli.BoolFlag

index out of range

When doing a search like this:
goris s -u https://images-na.ssl-images-amazon.com/images/M/MV5BMTk3ODYxNjQ3OV5BMl5BanBnXkFtZTgwNzA1MDQ5MTI@._V1_SX300.jpg -n 10

It throws an index out of range. If you limit the result set to 9 with -n 9, it returns fine. I think if the number of results returned is less than requested, it tries to loop beyond the index in dispres.

I have zero experience in Go programming -- maybe a good opportunity to dig in and learn.
Thanks for a great utility ! ! !

Search for larger/highres versions of an image

Hi @tanaikech! This tools seems to be more or less exactly what I'm looking for.

I've got folder with hundreds of images scraped from a no longer existing image blog and would like to search&replace the mostly lowres pictures with higher resolution images that can be found on the net.

Unfortunately, Google, and hence gores seems to distinguish between normal "reverse image search" an larger copies. So a reverse search seems to provide everything except the larger versions.

Is there something in the API which could i.e. be toggled by a command line argument to switch over to the larger version search?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.