mikf / gallery-dl

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

[furaffinity][warning] no 'a' and 'b' session cookies set #3931

Closed callybug closed 1 year ago

callybug commented 1 year ago

Hello! I had seen this issue reported by a few users here already, but I'm still not having any luck. Here's what appears on the terminal:

~$ gallery-dl --verbose https://www.furaffinity.net/user/scoopybanoopy/
[gallery-dl][debug] Version 1.25.3-dev
[gallery-dl][debug] Python 3.10.6 - Linux-5.15.0-60-generic-x86_64-with-glibc2.35
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.5
[gallery-dl][debug] Configuration Files ['${HOME}/.config/gallery-dl/config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://www.furaffinity.net/user/scoopybanoopy/'
[furaffinity][debug] Using FuraffinityUserExtractor for 'https://www.furaffinity.net/user/scoopybanoopy/'
[furaffinity][debug] Using FuraffinityGalleryExtractor for 'https://www.furaffinity.net/gallery/scoopybanoopy/'
[furaffinity][warning] no 'a' and 'b' session cookies set
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.furaffinity.net:443
[urllib3.connectionpool][debug] https://www.furaffinity.net:443 "GET /gallery/scoopybanoopy/1/ HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.furaffinity.net:443 "GET /view/51820185/ HTTP/1.1" 200 None
/mnt/Extra2022/IMAGES/gallery-dl/furaffinity/scoopybanoopy/51820185 sona selfie.png
[urllib3.connectionpool][debug] https://www.furaffinity.net:443 "GET /view/51820163/ HTTP/1.1" 200 None
/mnt/Extra2022/IMAGES/gallery-dl/furaffinity/scoopybanoopy/51820163 cowgirl.png
[urllib3.connectionpool][debug] https://www.furaffinity.net:443 "GET /view/51809637/ HTTP/1.1" 200 None
^C
KeyboardInterrupt

And here's my config:

{
    "part": false,
    "extractor": {
        "base-directory": "/mnt/Extra2022/IMAGES/gallery-dl/"
    },
    "furaffinity": {
        "filename": "{date:%Y_%m_%d_%H_%M}_{title}_{filename}.{extension}",
        "directory": ["{category}", "{user}"],
        "include": "gallery,scraps",
        "skip": "abort:5",
        "cookies": {
            "a": "a5d8XXXX-XXXX-XXXX-XXXX-XXXXXXXX4616",
            "b": "f8d6XXXX-XXXX-XXXX-XXXX-XXXXXXXX8bfe"
        }
    },
    "instagram": {
        "filename": "{date:%Y_%m_%d_%H_%M}_{filename}.{extension}",
        "directory": ["{category}", "{user}"],
        "skip": "abort:5",
        "include": "posts",
        "sleep-request": "2-10",
        "sleep": "2-10",
        "cookies": "/mnt/Extra2022/IMAGES/gallery-dl/instagram/cookies-instagram-com.txt",
        "postprocessors": [
            { "name": "metadata", "event": "post", "filename": "{user}_main.json" }
        ]
    }
}

(edit: indentation)

I've tried referencing a .txt file created by an extension (like I have with Instagram, which works fine), using a bare minimum config of just the cookies, and confirmed "a" and "b" are in the right order.. It was working when I had used it a few months ago. I'm using the legacy FA theme with the SFW filter disabled. Cheers!

mikf commented 1 year ago

You need to put the furaffinity and instagram blocks inside extractor for them to have any effect. It seems like you somehow moved }, from to end of the file to line 4.

{
    "part": false,
    "extractor": {
        "base-directory": "/mnt/Extra2022/IMAGES/gallery-dl/"
        "furaffinity": {
            "filename": "{date:%Y_%m_%d_%H_%M}_{title}_{filename}.{extension}",
            "directory": ["{category}", "{user}"],
            "include": "gallery,scraps",
            "skip": "abort:5",
            "cookies": {
                "a": "a5d8XXXX-XXXX-XXXX-XXXX-XXXXXXXX4616",
                "b": "f8d6XXXX-XXXX-XXXX-XXXX-XXXXXXXX8bfe"
            }
        },
        "instagram": {
            "filename": "{date:%Y_%m_%d_%H_%M}_{filename}.{extension}",
            "directory": ["{category}", "{user}"],
            "skip": "abort:5",
            "include": "posts",
            "sleep-request": "2-10",
            "sleep": "2-10",
            "cookies": "/mnt/Extra2022/IMAGES/gallery-dl/instagram/cookies-instagram-com.txt",
            "postprocessors": [
                { "name": "metadata", "event": "post", "filename": "{user}_main.json" }
            ]
        }
    }
}
mikf commented 1 year ago

Also your metadata post processor with "event": "post" will overwrite "{user}_main.json" for every post since {user} does not change. You should probably use "event": "init" to have this file written only once.

callybug commented 1 year ago

Ahh! Apologies for the stupidly easy fix. I'll try this metadata modification too; I didn't know why there wasn't any noticeable effect with any of these configs, but now I know. Thank you!