Skip to content

Example Config.json and Options

AmaanAnsari edited this page May 10, 2023 · 8 revisions

Example Config

Almost everything in the configuration can be changed, accompanied by a wizard.
All you have to do is run moodle-dl -c in the same folder as the configuration file.

  • To change the mail settings use moodle-dl -cm
  • To change the telegram settings use moodle-dl -ct
  • To generate a new token use moodle-dl -nt
  • To initiate the configuration use moodle-dl -i

A complete config.json can look like this:

{
    "token": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
    "privatetoken": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
    "moodle_domain": "moodle.ruhr-uni-bochum.de",
    "use_http": false,
    "moodle_path": "/m/",
    "download_path": "C:\PATH\TO\DOWNLOAD\LOCATION",
    "misc_files_path": "C:\PATH\TO\FILES_LIKE_moodle_state.db_and_Cookies.txt",
    "write_url_link": false,
    "write_webloc_link": false,
    "write_desktop_link": false,
    "write_link": true,
    "userid": 49408,
    "version": 2021051701,
    "telegram": {
        "token": "127123404:AAGc0KoobPAABBCgUgrUY5KiRMkUbn4vdE",
        "chat_id": "910011480",
        "send_error_msg": true
    },
    "sentry_dsn": "https://5255f8d83fabc4abaea979dea0294030@sentry.io/135128",
    "mail": {
        "sender": "yourmail@provider.de",
        "server_host": "smtp.provider.de",
        "server_port": "587",
        "username": "yourmail@provider.de",
        "password": "verysecurepassword",
        "target": "yourmail@provider.de",
        "send_error_msg": false
    },
    "download_course_ids": [
        25685,
        27288,
        23569
    ],
    "download_public_course_ids": [
        123,
    ],
    "options_of_courses": {
        "27288": {
            "original_name": "Netzsicherheit 2 (141243-SoSe20)",
            "overwrite_name_with": "NetzSec 2",
            "create_directory_structure": true
        },
        "23569": {
            "original_name": "Einf\u00fchrung in die Kryptographie (141022-WiSe19/20)",
            "overwrite_name_with": "EK 2",
            "create_directory_structure": true
        },
        "26528": {
            "original_name": "Deep Learning (150332-SoSe20)",
            "overwrite_name_with": "Deep Learning",
            "create_directory_structure": true
        },
        "26505": {
            "original_name": "Boolesche Funktionen mit Anwendungen in der Kryptographie (150357-SoSe20)",
            "overwrite_name_with": "BF",
            "create_directory_structure": true
        },
        "26398": {
            "original_name": "Quantenalgorithmen (150318-SoSe20)",
            "overwrite_name_with": "Quantenalgorithmen",
            "create_directory_structure": true
        },
        "25685": {
            "original_name": "Diskrete Mathematik II und Einf\u00fchrung in die theoretische Informatik (150310-SS 2020)",
            "overwrite_name_with": "Dima 2",
            "create_directory_structure": false
        }
    },
    "download_submissions": true,
    "download_descriptions": true,
    "download_links_in_descriptions": true,
    "download_linked_files": true,
    "download_also_with_cookie": true,
    "download_domains_whitelist": [
         "ruhr-uni-bochum.de",
         "sciebo.de",
         "rub.de"
    ],
    "download_domains_blacklist": [
         "youtube.com",
         "twitch.tv"
    ],
    "download_databases": true,
    "restricted_filenames": false,
    "youtube_dl_options": {
        "noplaylist": true
    },
    "exclude_file_extensions": [
        "png",
        "mkv"
    ],
    "videopasswords": {
        "ruhr-uni-bochum.sciebo.de": [
            "test",
            "password"
        ],
        "secret.service.fbi": "12345"
    },
    "external_file_downloaders" : {
        "bbb.rub.de" : "bbb-dl --add-webcam %U",
        "bbb-cluster.di.unito.it": "curl -L -O %U"
    }
}

Options documentation

The following snippet provides the above config file with comments for each option. Please note, that this commented snippet will not work, as JSON does not allow comments. If you need an example config to begin with, use the example config in the section above.

Clone this wiki locally