mikf / gallery-dl

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

I encountered an error running deviantart.com #6375

Open FErDaiif opened 4 hours ago

FErDaiif commented 4 hours ago

PS C:\Users\username> gallery-dl --verbose "https://www.deviantart.com/supahblonde50"

gallery-dl: Version 1.27.0
gallery-dl: Python 3.12.3 - Windows-10-10.0.19045-SP0
gallery-dl: requests 2.32.3 - urllib3 2.2.1
gallery-dl: Configuration Files ['%USERPROFILE%\\gallery-dl\\config.json']
gallery-dl: Starting DownloadJob for 'https://www.deviantart.com/supahblonde50'
deviantart: Using DeviantartUserExtractor for 'https://www.deviantart.com/supahblonde50'
deviantart: Using DeviantartGalleryExtractor for 'https://www.deviantart.com/supahblonde50/gallery'
deviantart: Using default API credentials (client-id 5388)
urllib3.connectionpool: Starting new HTTPS connection (1): www.deviantart.com:443
urllib3.connectionpool: https://www.deviantart.com:443 "GET /api/v1/oauth2/user/profile/supahblonde50 HTTP/1.1" 200 383
urllib3.connectionpool: https://www.deviantart.com:443 "GET /api/v1/oauth2/gallery/all?username=supahblonde50&offset=0&limit=24&mature_content=true HTTP/1.1" 200 None
deviantart: Switching to private access token
urllib3.connectionpool: https://www.deviantart.com:443 "GET /api/v1/oauth2/gallery/all?username=supahblonde50&offset=0&limit=24&mature_content=true HTTP/1.1" 200 None
deviantart: An unexpected error occurred: KeyError - 'category'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
deviantart:
Traceback (most recent call last):
  File "C:\Program Files\Python312\Lib\site-packages\gallery_dl\job.py", line 150, in run
    for msg in extractor:
  File "C:\Program Files\Python312\Lib\site-packages\gallery_dl\extractor\deviantart.py", line 150, in items
    self.prepare(deviation)
  File "C:\Program Files\Python312\Lib\site-packages\gallery_dl\extractor\deviantart.py", line 249, in prepare
    deviation["da_category"] = deviation["category"]
                               ~~~~~~~~~^^^^^^^^^^^^
KeyError: 'category'

The settings in the my config.json

{
    "extractor":
        {
        "base-directory": "~/gallery-dl/",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0",
        "cookies": ["firefox"],
        "cookies-update": true,
        "verify": true,
        "fallback": true,
        "sleep": 0,
        "sleep-request": 0,
        "sleep-extractor": 0,
        "path-restrict": "auto",
        "path-replace": "_",
        "path-remove": "\\u0000-\\u001f\\u007f",
        "path-strip": "auto",
        "path-extended": true,
        "skip": true
        },
    "deviantart":
        {
        "client-id": "11111",
        "client-secret": "1111111111111111111111111",
        "refresh-token": "cache",
        "auto-watch": false,
        "auto-unwatch": false,
        "comments": false,
        "extra": false,
        "flat": true,
        "folders": false,
        "group": true,
        "include": "gallery,scraps",
        "journals": "html",
        "jwt": false,
        "mature": true,
        "metadata": false,
        "original": true,
        "pagination": "api",
        "public": true,
        "quality": 100,
        "wait-min": 1,
        "cookies": "C:\\Users\\username\\gallery-dl\\deviantart\\816b044f-1c2d-4cb6-9016-a70ec9404697.txt",
        "cookies-update": true
        },
    "downloader":
        {
        "rate": "1M",
        "progress": 2.0,
        "mtime": false,
         "ytdl":
            {
            "module": "yt_dlp"
            }
        },
    "output":
        {
        "log": 
            {
            "level": "info",
            "format": {
                "debug"  : "\u001b[0;37m{name}: {message}\u001b[0m",
                "info"   : "\u001b[1;37m{name}: {message}\u001b[0m",
                "warning": "\u001b[1;33m{name}: {message}\u001b[0m",
                "error"  : "\u001b[1;31m{name}: {message}\u001b[0m"
                }
            },
        "shorten": "eaw",
        "ansi": true,
        "logfile": 
            {
            "path": "~/gallery-dl/log.txt",
            "mode": "w",
            "level": "debug"
            },
        "unsupportedfile": 
            {
            "path": "~/gallery-dl/unsupported.txt",
            "mode": "a",
            "format": "{asctime} {message}",
            "format-date": "%Y-%m-%d-%H-%M-%S"
            }
        },
    "postprocessor":
        {
        "content":
            {
            "name" : "metadata",
            "#": "write data for every post instead of each individual file",
            "event": "post",
            "filename": "{post_id|tweet_id|id}.txt",
            "mode" : "custom",
            "format": "{content|description}\n"
            },
        "cbz":
            {
            "name": "zip",
            "extension": "cbz"
            },
        "ugoira-webm":
            {
            "name": "ugoira",
            "extension": "webm",
            "ffmpeg-args": ["-c:v", "libvpx-vp9", "-an", "-b:v", "0", "-crf", "30"],
            "ffmpeg-twopass": true,
            "ffmpeg-demuxer": "image2"
            },
        "ugoira-mp4":
            {
            "name": "ugoira",
            "extension": "mp4",
            "ffmpeg-args": ["-c:v", "libx264", "-an", "-b:v", "4M", "-preset", "veryslow"],
            "ffmpeg-twopass": true,
            "libx264-prevent-odd": true
            },
        "ugoira-gif":
            {
            "name": "ugoira",
            "extension": "gif",
            "ffmpeg-args": ["-filter_complex", "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse"]
            },
        "ugoira-copy": 
            {
            "name": "ugoira",
            "extension": "mkv",
            "ffmpeg-args": ["-c", "copy"],
            "libx264-prevent-odd": false,
            "repeat-last-frame": false
            }
        },
    "cache": 
        {
        "file": "~/gallery-dl/cache.sqlite3"
        }
}
mikf commented 56 minutes ago

gallery-dl: Version 1.27.0

KeyError: 'category'

This was fixed in v1.27.3 (269b2808).