Skip to main content

cloudreveimport

Import your existing files into Cloudreve!

一键将外部文件导入Cloudreve中。

Install

Build executable file

git clone https://github.com/yindaheng98/cloudreveimport
cd cloudreveimport
go build

Then you shall get an executable file cloudreveimport, you can try it:

./cloudreveimport -h
Usage of D:\Documents\MyPrograms\cloudreveimport\cloudreveimport.exe:
  -c string
        Path to the config file. (default "D:\\Documents\\MyPrograms\\cloudreveimport\\conf.ini")
  -m string
        A folder to be imported.
  -t string
        Import the folder to which folder in cloudreve.
  -u string
        Email of the target user. (default "admin@cloudreve.org")

Usage

Command line

Just run it in the device where the Cloudreve is installed:

Assume your Cloudreve config file is /root/conf.ini, and you want to import a folder /mnt/gallery into the user me@cloudreve.org's my/gallery folder in Cloudreve. Just run:

./cloudreveimport -c "/root/conf.ini" -u "me@cloudreve.org" -m "/mnt/gallery" -t "my/gallery"

Then open me@cloudreve.org's my/gallery folder in Cloudreve, and you will see those files in /mnt/gallery here.

Note: 上述文件操作是直接对数据库进行修改,会导致用户已用空间与实际不符,所以在完成文件的导入或文件大小修改后需要执行数据库脚本校准用户容量。

Python

使用Python,你的导入过程可以更加灵活。 比如,在有大量文件需要定期导入而你的存储设备列出文件列表的速度较慢时,一次导入可能会花费很长时间; 或者,在自动定期导入时不希望目录中的某些文件被导入。 这时,你可以编写自己的Python程序选择要导入哪些文件、删除哪些文件,还能修改文件或文件夹的创建和修改时间。

This project also provides a Python package for advanced usage:

pip install cloudreveimport

You can write your scripts in Python:

import time
from cloudreveimport import Invoker
invoker = Invoker(
    execuable="./cloudreveimport",
    config="/root/conf.ini",
    email="me@cloudreve.org"
)
invoker.start()
invoker.import_file(
    source_name="path to the file on your disk",
    dst_path=["path", "you", "want", "to", "import", "to", "in", "cloudreve"],
    size=100, # filesize in Bytes
)
invoker.update_file_stat(
    dst_path=["path", "to", "file", "in", "cloudreve"],
    ctime=int(time.time()), # created time
    mtime=int(time.time()), # updated time
    size=100, # filesize in Bytes
)
invoker.update_file_meta(
    dst_path=["path", "to", "file", "in", "cloudreve"],
    thumb_sidecar="true",
    thumb_status="exist"
)
invoker.delete_file(
    dst_path=["path", "to", "file", "in", "cloudreve"],
)
invoker.update_folder_time(
    dst_path=["path", "to", "folder", "in", "cloudreve"],
    ctime=int(time.time()), # created time
    mtime=int(time.time()), # updated time
)

Metadata

Release files for cloudreveimport 1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudreveimport 1.6
File Size Uploaded
cloudreveimport-1.6.tar.gz 4.8 kB Details

Release files / cloudreveimport-1.6.tar.gz

Download URL cloudreveimport-1.6.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
49e2635e6755e5bd10cea98b77b49566c2fa6c1e9f7b510eb96473995b6df8f5
BLAKE2b-256 checksum
How to use checksums
27752d64d8854f05e3d59fee3c25bc0350929d8ab52a516a32363df7d8aef1a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

1.6 This release

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4

1 release file

1.3.1

1 release file

1.3

1 release file

1.2.1

1 release file

1.2

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page