gallery-dl icon indicating copy to clipboard operation
gallery-dl copied to clipboard

".." in directory does not work (at least not on Windows)

Open fireattack opened this issue 6 months ago • 1 comments

Test with config.json:

{
    "extractor": {
        "postprocessors": [
            {
                "name": "metadata",
                "event": "after",
                "directory": [".."],
                "filename": "!metadata.jsonl",
                "mode": "jsonl",
                "open": "a"
            }
        ]
    }
}

Prior to https://github.com/mikf/gallery-dl/commit/1bdb0f7a49eb3643262b1b1818c3439592294535, use .. will unexpectedly change the dir to root drive. After that fix, it straightly up throws errors on Windows:

>python -m gallery_dl -c config.json --config-ignore "https://en.wikipedia.org/wiki/File:Malabar_pied_hornbill_(Anthracoceros_coronatus)_male.jpg"
.\gallery-dl\wikipedia\File_Malabar_pied_hornbill_(Anthracoceros_coronatus)_male.jpg\Malabar pied hornbill (Anthracoceros coronatus) male (4a77f077).jpg
[wikimedia][error] Unable to download data:  OSError: [Errno 22] Invalid argument: '\\\\?\\C:\\files\\repo\\gallery-dl_og\\gallery-dl\\wikipedia\\File_Malabar_pied_hornbill_(Anthracoceros_coronatus)_male.jpg\\..\\!metadata.jsonl'

Related: https://github.com/mikf/gallery-dl/issues/5262#issuecomment-2267507931

fireattack avatar Aug 05 '24 01:08 fireattack