mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-11-22 08:46:15 +00:00
Added blacklist_extensions to skip some file types completely from being downloaded.
This commit is contained in:
parent
bce5996643
commit
223a0fdde3
@ -261,6 +261,8 @@ class DownloadManager(val client: TelegramClient, val prog: DownloadProgressInte
|
||||
prog.onMediaSkipped()
|
||||
} else if (settings.max_file_size>0 && settings.max_file_size*1024*1024 > m.size) {
|
||||
prog.onMediaSkipped()
|
||||
} else if (settings.blacklist_extensions.contains(m.extension)) {
|
||||
prog.onMediaSkipped()
|
||||
} else {
|
||||
try {
|
||||
val result = m.download(prog)
|
||||
|
@ -29,6 +29,7 @@ class Settings(val file_base: String, val database: Database, val cli_settings:
|
||||
val blacklist_channels = sf.getStringList("blacklist_channels", default=LinkedList<String>())
|
||||
val max_file_age = sf.getInt("max_file_age", default=-1)
|
||||
val max_file_size = sf.getInt("max_file_size", default=-1)
|
||||
val blacklist_extensions = sf.getStringList("blacklist_extensions", default=LinkedList<String>())
|
||||
|
||||
private fun get_setting_list(name: String): List<String>? {
|
||||
return ini_settings[name]
|
||||
|
@ -26,6 +26,10 @@
|
||||
## Leave unset to download media files regardless of their size.
|
||||
# max_file_size = 5
|
||||
|
||||
## Don't download media files having these extensions.
|
||||
## You can add this line multiple times to blacklist more than one extension.
|
||||
# blacklist_extensions = jpg
|
||||
# blacklist_extensions = avi
|
||||
|
||||
## Downloads of channels and supergroups
|
||||
## Here you can specify which channels and supergroups
|
||||
|
Loading…
Reference in New Issue
Block a user