gallery-dl | line program to download image galleries | Download Utils library
kandi X-RAY | gallery-dl Summary
kandi X-RAY | gallery-dl Summary
Command-line program to download image galleries and collections from several image hosting sites
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse command line options .
- Build argument parser .
- Main entry point .
- Generic download implementation .
- Get pagination tweets
- Parse a JSURL string .
- Build the configuration file .
- List of images .
- Initialize the instance .
- Build the main gallery .
gallery-dl Key Features
gallery-dl Examples and Code Snippets
Community Discussions
Trending Discussions on gallery-dl
QUESTION
I use gallery-dl to download pics from Pixiv.com. All of the below are run from Windows' .bat files.
I manually create a folder with only {user[id]}.
Example: Pixiv - Temp\24517
I then copy gallery-dl.bat (which calls on gallery-dl.exe and the related gallery-dl.conf, elsewhere) and a number of assisting .jpg files into that folder.
Example: Pixiv-Temp\24517\gallery-dl.bat
I've done this for over 5,000 users.
Running gallery-dl.bat from within folder configured for the below, passing a variable of the folder name will download the pics as well as saving a *.sqlite3 file to the folder 24517.
gallery-dl.conf
...ANSWER
Answered 2022-Jan-08 at 08:46When I understood your question right, this should help:
QUESTION
BACKGROUND: Have the following code. Lines 5 & 6 are the most important here:
@echo off
setlocal EnableExtensions DisableDelayedExpansion
pushd "%~dp0" || exit /B
move /Y "Folder2.jpg" "Folder.jpg"
This line 5 for %%I in (.) do set "FOLDER=%%~nxI"
This line 6 "%ProgramFiles(x86)%\gallery-dl\gallery-dl.exe" -d "U:\11Web\gallery-dl" --download-archive "%~dp0zzzGDB.sqlite3" "https://www.pixiv.net/en/users/%FOLDER%/illustrations"
if not errorlevel 1 if exist "zzzGDB.sqlite3" del "Folder.jpg"
popd
endlocal
In Windows Explorer I create a folder (for example) named "18604150". Any folders I create will have a folder name of varying lengths. The code above is in a .bat file within that folder. Upon executing the code, line 5 assigns folder name "18604150" to the variable and line 6 inserts/calls it as part of the hyperlink:
https://www.pixiv.net/en/users/%FOLDER%/illustrations
equates to
https://www.pixiv.net/en/users/18604150/illustrations
All is well.
PROBLEM: I want to be able to ALWAYS name folders as with the aforementioned numerical string at the beginning but IN SOME CASES also manually append artist name and/or other details to the folder name. Problem is I need to do this without "breaking" the variable and making it unusable for the hyperlink. Folder names could take on many shapes but will always begin with an unbroken first string of numbers. Examples:
18604150 -59 Bob Marley-
4839 Dan the Man
19374759394727 Scooby Snack 43443
I need to pare the variable down to only the digits left of any first SPACE, when present.
18604150
4839
19374759394727
I'm guessing whatever the solution will likely have to be in Line 5, but I do not know what this would look like.
for %%I in (.) do set "FOLDER=%%~nxI"
ANSWER
Answered 2020-Jul-28 at 03:31A little trial and error got my answer. Thanks goes to https://www.dostips.com/DtTipsStringManipulation.php
@echo off
setlocal EnableExtensions DisableDelayedExpansion
pushd "%~dp0" || exit /B
move /Y "Folder2.jpg" "Folder.jpg"
for %%I in (.) do set "FOLDER=%%~nxI"
for /f "tokens=1 delims= " %%a in ("%FOLDER%") do set FOLDER=%%a
"%ProgramFiles(x86)%\gallery-dl\gallery-dl.exe" -d "U:\11Web\gallery-dl" --download-archive "%~dp0zzzGDB.sqlite3" "https://www.pixiv.net/en/users/%FOLDER%/illustrations"
if not errorlevel 1 if exist "zzzGDB.sqlite3" del "Folder.jpg"
popd
endlocal
pause
QUESTION
Background: OS: win10. A single root folder: "U:\11Web\gallery-dl".
Within the root I have 1400+ sub-folders (there are no sub-folders beneath those (and never will be)). (There are also no individual/extraneous files in root (and never will be)).
Each sub-folder has its own .bat file, aGallery-dl.bat.
...ANSWER
Answered 2020-Jun-04 at 04:10Sometimes it's right in front of my face... Works one folder at a time, but works. 1400+ folders later I should be good... Thanks for your help Stephan!!
QUESTION
This question is related to Test IF file exist, ELSE xcopy these two files.
Background: On occasion I choose to run aGallery-dl.bat
in a given folder (just one in each of 100's of folders). It first deletes Folder.jpg
then renames Folder2.jpg
to Folder.jpg
. This has the effect of a red X being replaced by a yellow ! when viewing the folder with parent folder selected in File Explorer. Secondly, it calls gallery-dl.exe
. I use going from red X to yellow ! to let me know I've run aGallery-dl.bat
at least once. If aGallery-dl.bat
completes successfully, it finally deletes the Folder.jpg
(currently yellow !), and now the representative contents of the folder (usually DeviantArt .jpg's) are visible. All is well.
ANSWER
Answered 2020-May-31 at 12:03I suggest to use following lines for aGallery-dl.bat
.
QUESTION
Morning all.
So I've been up hours trying to cobble together -a variety of replies to other posts- into my own code in order to see if I could get something usable. No-go. I'm sufficiently lost in the sauce that I've now got to ask for some help from you.
Background: OS: Windows 10 I use the program text2folders.exe to create 20-30 new folders on a secondary drive every night. Primarily, I have a base file "aGallery-dl.bat" that I populate each folder with using an xcopy batch file. Secondarily, from time to time I update the source file "aGallery-dl.bat" using the same xcopy and this overwrites the older target file, populating all folders with the newest "aGallery-dl.bat" (whether they need it or not). All is well.
...ANSWER
Answered 2020-May-30 at 10:59The command for copying a file is COPY. It is an internal command of Windows command processor cmd.exe
. XCOPY is an eXtended file and directory copying executable in directory %SystemRoot%\System32
which is deprecated since Windows Vista as there is even more powerful ROBOCOPY which is with full qualified file name %SystemRoot%\System32\robocopy.exe
.
There is no need to use XCOPY or ROBOCOPY for this simple file copying task. COPY is enough on source files aGallery-dl.bat
, Folder.jpg
and Folder2.jpg
don't have hidden attribute set and the same files in the target directories don't have read-only attribute set.
.\
references the current directory which can be any directory. Windows Explorer sets the directory of the batch file as current directory on double clicking on a batch file. But this is nearly the only method to run a batch file on which the directory of the executed batch file is set automatically as current directory (except the batch file is stored on a network resource accessed using UNC path).
There is %~dp0
to reference the path of the batch file. This path always ends with a backslash which means that no additional backslash is needed on concatenating the batch file path with a file or folder name. The usage of %~dp0
makes it possible to reference files in same directory as the executed batch file independent on which directory is the current directory on execution of the batch file.
The batch file needed for your task is:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gallery-dl
You can use gallery-dl like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page