Skip to content

IsolatedClutch/mgsimagesourcesaver

Repository files navigation

AIDM's Image Source Saver (for e621)

I created a program called "Image Source Saver".

If a source url becomes rotten (HTTP 404), the image url id/hash might still be available or accessible in an archive collection.

However, it can be difficult (if not impossible) to get the image url after the source dies. Having the image url in the sources of an e621 post makes it super easy to find and use for any purpose.

After adding these manually with miniscule results for a while, I wanted an easier way to get this done.

The program goes down a list of posts. It gets the image url from a source in a post and adds it to the source list of that post.

If the post contains multiple images, it uses Fluffle to check which image goes to the correct e621 post ID.

There is a cooldown of 60 to 90 seconds after each post in the list (+45 seconds if Fluffle was used).

Future plans of finding post sources for posts with no sources is being considered...

How to use

  1. Install requirements via pip -r requirements.txt
  2. Setup gallery-dl.conf (including setting up pixiv via gallery-dl oauth:pixiv)
    1. If you cannot use some platforms, comment out any wrappers you don't want to use in all of the root scripts.
  3. Run get_e621_posts.py to get a list of posts without an image source for a platform
  4. Run add_image_sources.py to go though the post cache

Be street smart and responsible; do dumb shit with this program and editing values to something stupid (going too quick, adding fake sources, way too low fluffle thresholds) on purpose and watch your account get banned.

License

This has been licensed under The Unlicense. For more information, please refer to https://unlicense.org.

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>