get-got / discord-downloader-go

A Discord bot program to download and otherwise handle files sent in Discord channels with extensive configuration. Can be used as a genuine Discord Bot or user account / self-bot
MIT License
271 stars 30 forks source link

Problem with "subfolders" and blacklist channels #112

Closed NimbusCloudVoid closed 7 months ago

NimbusCloudVoid commented 7 months ago

Hello, so i saw that divided was now dead and so i added the "subfolders" and i wrote this line (check pic) 2023-11-18  notepad++_CtAVltKGzZ_678 so that it download to the folder that already existed before the new changes except even with the change i've made, he use the default line which is

"subfolders": [ "{{fileType}}" ],

So i was wondering if i've messed up somewhere or something? Also i think the Blacklist channel setting doesn't work because i've added some channel to the blacklist and the program still download them

NimbusCloudVoid commented 7 months ago

Ok i've found my mistake. It's because in here https://github.com/get-got/discord-downloader-go/wiki/Settings i saw the subfolders settings in the channels brackets but i didn't saw it was also outside and so if you put the subfolders settings in the channel bracket it will only apply to the channels brackets and not the whole if you use Category or Server and so it will result in the default setting for subfolders "subfolders": [ "{{fileType}}" ],

So for people who will or have made the same mistake as me, DO NOT PUT the settings of the subfolders in the Server, category, channel bracket. Just put it outside and you are good to go

I still have a problem with the blacklist channel

Edit: So now it create a new folder even though i'm downloading from the same channel and the folder already exist/created from previous versions on the program

Also i wanted to add, it seems like the program ignore the history, i tried to use since but it goes way before that specified date and i'm getting error 403:forbbiden on imgur or 403/404 on cdn.discord or media.discord even tho the picture is still there on discord.

I know that's a lot to ask but thanks in advance for your effort.

get-got commented 7 months ago

The 403's and 404's aren't something I can help. It may have cached thumbnails on your Discord but if the source has since 403/404'd then there's nothing more the bot can do.

I'll look into the history since ranges. This has been a long time issue that I've tried to fix several times. The latest fixes on that seemed to resolve it for most people but I may need to add more checks.

The subfoldering should be working when placed in sources (server/category/channel). I can't really determine the issue without seeing the settings setup and a description of what did and didn't work for that setup. Same goes for the blacklisting issue.

NimbusCloudVoid commented 7 months ago

Alright i see for the 403/404

Here is my settings setup:

2023-11-18  notepad++_WeB2ppTeer_679

the subfolders was in the channel where the "divideby" was and before it was working even tho at some point it started ignoring "dividedby" idk why.. But yeah thats my settings

get-got commented 7 months ago

That's not how you use "all". "all" is basically it's own source config to apply to everything, like the groups of configs within the [ ] of servers/categories/channels. If you wanted to download absolutely everything the bot has access to, you'd use "all" within the global scope, not within servers/categories/channels, then you'd use "allBlacklistChannels" as a separate line outside of "all", not within it.

I'm not sure what you're trying to do, since you're trying to blacklist channels within a config of specific channels?

If you're trying to block channels for the server config, add a list like [ "1", "2" ] to the server group called "serverBlacklist" and the same for categories called "categoryBlacklist". Also don't have "channels" and "channel" present with each other, delete the blank "channel" line.


Given what you had said about subfoldering before, I'm thinking you're misunderstanding how these settings groups work.

You seem to be trying to put things in the "channels" section thinking that will make those settings apply to every "channel" the bot encounters, thinking that also applies to servers and categories. That's at least what I'm gathering from this setup and what you said about subfoldering.

Each { } group is an individual configuration. "servers" and "categories" and "channels" and "users" are all the same thing. They're lists of separate source configurations but they follow the same structures. The only difference between them are specifiers for "channel"/"channels", "server"/"servers"/"serverBlacklist", etc. "all" is also the exact same as this, it's just a fallback configuration for anything the bot encounters that doesn't belong to an established "servers"/"categories"/"channels"/"users" config. For most (or maybe all, idk) settings in the source config groups, there's global equivalents that act as defaults. When you don't have them specified within "servers"/"categories"/"channels"/"users", they'll use those values. That's why your subfoldering started applying to servers and categories properly once you moved it to the global scope/area.

Also don't have "channel" and "channels", "server" and "servers", "category" and "categories" present together within one config. It may not be causing issues since you have it blank but still, it should only be the IDs you're actually targeting.

This may help explain more, here's a dummy copy of a similar setup to your settings showing how they should be structured, with some random settings thrown in for demonstration:

{
    "subfolders": [ "{{serverName}}", "{{channelName}}", "{{fileType}}" ],
    "allowCommands": false,
    "sendErrorMessages": false,
    "updatePresence": false,
    "reactWhenDownloaded": false,

    // these settings will be used for ALL messages UNLESS that message belongs to a separate config below.
    // In that case, these settings aren't used, only that configs settings.
    "all": {
        "destination": "non-configured downloads",
        // Any other settings not present here will follow the global defaults at the top group
        "ignoreBots": true,
        "saveOtherFiles": false,
        "filters": {
            "blockedUsers": [ "1", "2" ]
        },
        "subfolders": [ "{{serverName}}", "{{categoryName}}", "{{channelName}}", "{{fileType}}" ]
    },
    "allBlacklistChannels": [ "5", "6" ],

    "servers": [
        {
            "servers": [ "1", "2" ],
            "serverBlacklist": [ "11", "22" ],
            "destination": "servers"
            // Any other settings not present here will follow the global defaults at the top group
        }
    ],

    "categories": [
        {
            "categories": [ "1", "2" ],
            "categoryBlacklist": [ "11", "22" ],
            "destination": "categories",
            // Any other settings not present here will follow the global defaults at the top group
            "filters": {
                "blockedUsers": [ "1", "2" ]
            }
        },
        {
            "categories": [ "3", "4" ],
            "categoryBlacklist": [ "33", "44" ],
            "destination": "categories 2"
            // Any other settings not present here will follow the global defaults at the top group
        }
    ],

    "channels": [
        {
            "channels": [ "1", "2" ],
            "destination": "channels",
            // Any other settings not present here will follow the global defaults at the top group
            "subfolders": [ "{{fileType}}" ],
            "saveVideos": false
        },
        {
            "channels": [ "3", "4" ],
            "destination": "other channels",
            // Any other settings not present here will follow the global defaults at the top group
            "reactWhenDownloaded": true
        },
        {
            "channels": [ "1", "2" ],
            "destination": "channels 3",
            // Any other settings not present here will follow the global defaults at the top group
            "filters": {
                "blockedUsers": [ "1", "2" ]
            }
        }
    ]
}
NimbusCloudVoid commented 7 months ago

Yeah basically i was putting channels and channel - servers and server - categories and category when i needed them but then i saw that sometimes i was switching between them often so i decided to let them in the config and fill the blank when i needed them but yeah i added them and i had no issue previously.

For the blacklist, basically my goal is that sometimes i take a whole category but there will be one or two channels that i didn't want to download and i wanted the bot to ignore them when i tried to download the whole category without them if not it would be adding all the channels i wanted which was annoying. And basically i thought that "serverBlacklist" and "categoryBlacklist" was only for servers IDs and categories IDs that's why i thought "allBlacklistChannels" was the one to block the channels IDs i didn't wanted to use.

I will change some of the stuff then, thanks