Skip to content

how to use this within my code #5792

Closed Answered by mikf
terfani asked this question in Q&A
Discussion options

You must be logged in to vote

Set all necessary options with config.set() and run job.DownloadJob(url).run() to download files.

Example:

from gallery_dl import config, job, output

def init():
    config.set((), "base-directory", "/target/dir/")
    config.set((), "directory", ())
    config.set(("extractor", "twitter"), "username", "MY_USER")
    config.set(("extractor", "twitter"), "password", "MY_PASS")

def download(url):
    return job.DownloadJob(url).run()

avoiding logging in repeatedly

Login sessions get cached in memory and cache.file

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mikf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants