Giter Site home page Giter Site logo

e6dl's Introduction

e6dl

"I don't care about any of this, just take me to the downloads"

This is a command line tool for downloading posts that match certain tags on e621 or e926.

It does basically the same thing as this tool except it was written in Go and the output is a lot less pretty.

It supports concurrently downloading posts, and you can set a maximum number of workers that should be downloading at a time.

I made this because I wanted to rewrite one of my previous projects in Go, so I decided to start with this one since it's a pretty small and simple command line tool that encapsulates a lot of concepts in the language (type definition, imports, goroutines, standard libraries, slices, to name a few).

Installing

Prebuilt Binaries

There is an install script available for Linux/macOS here. It automatically grabs the latest release (at the time of writing) and saves to /usr/local/bin/e6dl.

From Source

Clone repo.

# Build e6dl then install it to /usr/local/bin
make install

You can also install it to a custom path of your choosing:

make install INSTALLPATH="/bin"

If you wanna get rid of it:

make uninstall

Building

First, install Go.

Then just:

make build

bin/e6dl will magically appear. You can also just:

go run main.go

To distribute:

make dist

3 files will be spit out in the dist directory - one for Windows, one for macOS, and one for Linux.

You can also run make dist-win, make dist-macos, or make dist-linux to build them individually.

Example

Here's a situation that uses every flag:

If you wanted to download a maximum of 20 posts with the tag pokemon in random order from e926 to the directory ./posts with a maximum of 2 downloading at a time:

e6dl --tags "pokemon order:random" --out ./posts --limit 20 --concurrents 2 --sfw

Usage

Usage of e6dl:
  --concurrents int
    	Maximum amount of concurrent downloads (default 5)
  --limit int
    	Maximum amount of posts to grab from e621 (default 10)
  --out string
    	The directory to write the downloaded posts to (default "dl")
  --sfw
    	Download posts from e926 instead of e621
  --tags string
    	Tags to search for
  --pages int
    	Number of search result pages to download (default 1)

e6dl's People

Contributors

tjhorner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

e6dl's Issues

[Improvement suggestions]: Features that could be useful

Hello! I'm new to GitHub and Golang, and have no idea how to use the e621 API - which is why I'm giving suggestions rather than a pull request.
Without further ado, here are my recommendations:

Login via e621 API token

  • Would fix the issue with images that require you to be logged in to view
  • Would add user blacklist support for filtering more than 40 tags

Tag-based file naming

This one is more specific, but I currently have a need for it.

  • Would allow file names to be made from tags (such as "fox cute solo_male 17.png", where the numbers at the end are to avoid overwriting existing photos with the same name.

Random mode

  • This mode would choose random tags and save the images that meet the criteria.

As I said, I have little knowledge on how to program in Golang, with no idea on how to use the e6 API. Some may be doable, while others may not be possible.

Write tests

Since my goal with this project is to learn Go, I should probably write some tests for this.

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.