mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.97k stars 975 forks source link

[Support and Documentation] How to create a custom extractor and rebuild gallery-dl to use it? #2114

Open ralphthehacker opened 2 years ago

ralphthehacker commented 2 years ago

I'm interested in creating a custom extractor for shopify pages, mainly to change the way data is categorized and saved after scraping. In order to do so, I'd have to write my own custom Extractor, and build gallery-dl to use this new extractor.

This may be a simple question, but how can I rebuild gallery-dl so that my modifications are saved when running the command line command? In other word, once I add my custom extractor, I'd like to just execute the gallery-dl on the terminal like I normally do for existing extractors.

Is there any documentations or tutorials on how to do so?

mikf commented 2 years ago

In order to do so, I'd have to write my own custom Extractor

Or you adjust the filename and directory format strings in your config file. That's usually a lot easier.

and build gallery-dl to use this new extractor.

To build an executable, you need to have a Python interpreter and any dependencies installed, as well as the source code of the project you want to build. And at that point you can just run from source, e.g. python -m gallery_dl. To get this to work you need to be able to import the gallery_dl module with Python, which works if the gallery_dl directory is in your current working directory or if it's in PYTHONPATH.

If you want to build an exe anyway, install pyinstaller (pip install pyinstaller) and run scripts/pyinstaller.py (python pyinstaller.py)