Giter VIP home page Giter VIP logo

patreon-dl's Introduction

patreon-dl: Patreon Image Downloader

Downloads AUR Package

patreon-dl lets you download images of creators you support.

Installation

If you are running Arch: patreon-dl is available as AUR package!

Otherwise: Download a release from https://github.com/PrivateGER/patreon-dl/releases.

  • Linux (64bit): patreon-dl_x.x.x_Linux_x86_64
  • Linux (32bit): patreon-dl_x.x.x_Linux_i386
  • Linux (ARM64): patreon-dl_x.x.x_Linux_arm64
  • Windows (64bit): patreon-dl_x.x.x_Windows_x86_64.exe
  • Windows (32bit): patreon-dl_x.x.x_Windows_i386.exe
  • Mac (x64): patreon-dl_x.x.x_Darwin_x86_64
  • Mac (ARM): patreon-dl_x.x.x_Darwin_arm64

The Mac builds are unsupported. I don't own a Mac and don't have access to one either. If someone finds a way to get it working, please open an issue and I'll add it to the README.

You can also compile patreon-dl yourself using go build or build for all operating systems using gorelaser with the included configuration file.

Usage

Run patreon-dl and follow the instructions.

Example:

Open https://patreon.com/creatornamehere/posts in your browser. Now start patreon-dl and open the browser console. Paste the line of code shown by patreon-dl into the console and execute it by pressing ENTER.

After a few seconds of loading, depending on how many posts the creator has, patreon-dl will start downloading all images into the images folder.

Security

patreon-dl is not distinguishable from normal use for Patreon. There is no risk of getting banned or punished for the use of this tool.

Release tags of patreon-dl after v1.0.2 are signed with a PGP key with the fingerprint CAE625C962F94C67.

patreon-dl's People

Contributors

alexanderpavlenko avatar deepsourcebot avatar privateger avatar rini-tikki 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

Watchers

 avatar

patreon-dl's Issues

subfolders?

would be awfully nice if the images werent all dumped in one folder but subfolders made with e.g. date and title of the posts.

Small typo in JS snippet

Hello,
first run shows:

...and run it with ENTER:
(async()=>{eval(await(await fetch("http://localhost:9849/gadget")).text());})();

... after finish there comes another snippet which doesn't work. One \ too much in it

You can download another set of images using the below JS snippet or exit patreon-dl:
(async()=>{eval(await(await fetch(\"http://localhost:9849/gadget")).text());})();

Running on Mac

  1. Download the correct Darwin file (x86_64 fΓΌr 64 Bit System)
  2. In the terminal go to the folder where the file is
  3. Make the file executable by running chmod 755 'file-name'
  4. Via Finder try to start program by double clicking -> A dialog is shown that the program can't be run because its not by a verified developer
  5. Go to the General tab in the Macs Security & Privacy settings -> There should be an info on the program you just tried to run
  6. Select 'Allow Anyway'
  7. Try to run the program via Finder again -> Dialog is shown again, this time you can select to open the file
  8. Program is opened and run in Terminal
  9. Have fun!

Improve interface

The current interface is not at all user friendly.
Add a small graph that shows the total number of downloads in queue and completed ones + progress in percent.

Capability to download videos?

Is your nifty little tool able to download videos as well or is it exclusively for pictures?
(I'm considering to subscribe to a creator for one or two of his videos specifically containing information about EQ modification. Since details can easily be forgotten after years I'd like to create a private copy of the videos so I can re-watch them whenever needed to make further adjustments.)

Specify file nameing format

Currently all files are downloaded into a image directory just as they are named + post id (i guess), there are a couple of problems with this:

  1. fetching from multiple creators causes their content to be mixed together
  2. not all content that is fetched are images but are still stored into a image directory
  3. in some cases the date when the content was posted is more important and files should be sorted that way

A simple solution would be to allow specifying a formatting string for the file names, where variables like authorname, post-date, filename and post-id can be used to specify where the files should be stored.

Not working on specific Patreon accounts

For some reason this is an issue that's only happening on specific Patreon accounts; it'll get stuck on "Promise { : "pending" }" and then spit out a "Error: Promised response from onMessage listener went out of scope" at me after a few seconds, and then the following:
Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON datadebugger eval code line 1 > eval:99:13
debugger eval code line 1 > eval:99
AsyncFunctionThrow self-hosted:642
(Async: async)
debugger eval code line 1 > eval:100
debugger eval code:1
AsyncFunctionNext self-hosted:638
(Async: async)
debugger eval code:1
getEvalResult resource://devtools/server/actors/webconsole/eval-with-debugger.js:243
evalWithDebugger resource://devtools/server/actors/webconsole/eval-with-debugger.js:167
evaluateJS resource://devtools/server/actors/webconsole.js:1115
evaluateJSAsync resource://devtools/server/actors/webconsole.js:1007
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103

Long filenames

I encountered some creator pages where images patreon-dl tries to download have a very long name, presumably auto-generated previews of something. If they are too long for the underlying filesystem, os.Create in DownloadWorker fails and causes an error to be printed down the road.

As a workaround, I hashed filenames over 255 characters (cf. this summary of max filename lengths) in my local copy:

--- a/DownloadManager.go
+++ b/DownloadManager.go
@@ -12,6 +12,8 @@ import (
        "strconv"
        "strings"
        "time"
+       "golang.org/x/crypto/sha3"
+       "encoding/hex"
 )
 
 var downloadDir string = "images"
@@ -87,7 +89,13 @@ func DownloadWorker(id int, jobs <-chan []string, resultCh chan<- *result, bar *
                defer resp.Body.Close()
 
                // Create the file
-               out, err := os.Create(filepath.Join(".", downloadDir, path.Base(strPath)))
+               basepath := path.Base(strPath)
+               if len(basepath) > 255 {
+                       h_basepath := sha3.New512()
+                       h_basepath.Write([]byte(basepath))
+                       basepath = hex.EncodeToString(h_basepath.Sum(nil))
+               }
+               out, err := os.Create(filepath.Join(".", downloadDir, basepath))
                if err != nil {
                        return &result{err: err}
                }

Not saying this is ideal, it's merely included as an idea.

I also wanted to thank you for writing this! Works really well, overall πŸ‘

Download posts content as well

Some creators, like authors post their content as posts on patreon, so there should probably be an option to download them as well.

Clean up code

Currently, the DownloadWorker() function has a few issues, such as converting errors into strings.

Change the function and channel handling to restore proper error messages,

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.