[koofr] refactor (#8803)

https://github.com/mikf/gallery-dl/issues/8803#issuecomment-3708215475
https://github.com/mikf/gallery-dl/issues/8803#issuecomment-3708358606

- add 'recursive' option, remove 'zip'
- recurse into subdirectories
- add 'path' metadata
- remove 'count' & 'num' metadata
- update default directory & archive format
This commit is contained in:
Mike Fährmann
2026-01-06 09:35:47 +01:00
parent 706fb752c6
commit cf96fc6ebe
4 changed files with 89 additions and 42 deletions

View File

@@ -11,7 +11,7 @@ __tests__ = (
{
"#url" : "https://k00.fr/cltf71jr",
"#class" : koofr.KoofrSharedExtractor,
"#results" : "https://app.koofr.net/content/links/923b4f56-3aaf-49ee-95e3-d85c52b687b0/files/get/wsf-form-job-application-form.json?path=%2F&force",
"#results" : "https://app.koofr.net/content/links/923b4f56-3aaf-49ee-95e3-d85c52b687b0/files/get/wsf-form-job-application-form.json?path=/&force",
"#sha1_content": "f65ccc63a99165ecb9ff2ab92302c25b245a904f",
"contentType": "application/json",
@@ -28,7 +28,7 @@ __tests__ = (
{
"#url" : "https://app.koofr.net/links/923b4f56-3aaf-49ee-95e3-d85c52b687b0",
"#class" : koofr.KoofrSharedExtractor,
"#results" : "https://app.koofr.net/content/links/923b4f56-3aaf-49ee-95e3-d85c52b687b0/files/get/wsf-form-job-application-form.json?path=%2F&force",
"#results" : "https://app.koofr.net/content/links/923b4f56-3aaf-49ee-95e3-d85c52b687b0/files/get/wsf-form-job-application-form.json?path=/&force",
"#sha1_content": "f65ccc63a99165ecb9ff2ab92302c25b245a904f",
"contentType": "application/json",
@@ -52,12 +52,12 @@ __tests__ = (
"#comment" : "individual files",
"#class" : koofr.KoofrSharedExtractor,
"#options" : {"zip": False},
"#pattern" : r"https://app\.koofr\.net/content/links/01deac62\-f5d6\-4d2b\-7043\-53b24cc0a038/files/get/smw_msu1\-\d+\.pcm\?path=%2Fsmw_msu1\-\d+\.pcm",
"#pattern" : r"https://app\.koofr\.net/content/links/01deac62\-f5d6\-4d2b\-7043\-53b24cc0a038/files/get/smw_msu1\-\d+\.pcm\?path=/smw_msu1\-\d+\.pcm",
"#count" : 18,
"contentType": "application/octet-stream",
"count" : 18,
"num" : range(1, 18),
"!count" : 18,
"!num" : range(1, 18),
"date" : "type:datetime",
"extension" : "pcm",
"filename" : r"re:smw_msu1-\d+",
@@ -68,7 +68,7 @@ __tests__ = (
"tags" : {},
"type" : "file",
"post" : {
"count" : 18,
"!count" : 18,
"date" : "dt:2023-11-19 16:27:56",
"id" : "01deac62-f5d6-4d2b-7043-53b24cc0a038",
"title" : "Church of Kondo",
@@ -79,26 +79,51 @@ __tests__ = (
"#url" : "https://app.koofr.net/links/01deac62-f5d6-4d2b-7043-53b24cc0a038",
"#comment" : ".zip container",
"#class" : koofr.KoofrSharedExtractor,
"#options" : {"zip": True},
"#results" : "https://app.koofr.net/content/links/01deac62-f5d6-4d2b-7043-53b24cc0a038/files/get/Church of Kondo?path=%2F&force",
"#options" : {"recursive": False},
"#results" : "https://app.koofr.net/content/links/01deac62-f5d6-4d2b-7043-53b24cc0a038/files/get/Church of Kondo?path=/&force",
"contentType": "",
"count" : 1,
"!count" : 1,
"!num" : 1,
"date" : "dt:2023-11-19 16:27:56",
"extension" : "",
"filename" : "Church of Kondo",
"modified" : 1700411276087,
"name" : "Church of Kondo",
"num" : 1,
"size" : 0,
"tags" : {},
"type" : "dir",
"post" : {
"count" : 1,
"!count" : 1,
"date" : "dt:2023-11-19 16:27:56",
"id" : "01deac62-f5d6-4d2b-7043-53b24cc0a038",
"title" : "Church of Kondo",
},
},
{
"#url" : "https://app.koofr.net/links/7667d857-c639-4f38-93d1-c42394492a0c",
"#comment" : "recursive directories",
"#class" : koofr.KoofrSharedExtractor,
"#pattern" : r"https://app\.koofr\.net/content/links/7667d857\-c639\-4f38\-93d1\-c42394492a0c/files/get/[\w]\.png\?path=/.*\w\.png",
"#count" : 16,
"contentType": "image/png",
"date" : "type:datetime",
"extension" : "png",
"filename" : r"re:^[1-8a-d]$",
"hash" : "hash:md5",
"modified" : range(1767688000000, 1767700000000),
"name" : r"re:^[1-8a-d]\.png",
"path" : {(), ("dir-l1-1",), ("dir-l1-2",), ("dir-l1-1", "dir-l2-1")},
"size" : range(200, 999),
"tags" : {},
"type" : "file",
"post" : {
"date" : "dt:2026-01-06 08:27:26",
"id" : "7667d857-c639-4f38-93d1-c42394492a0c",
"title": "dir",
},
},
)