Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Latest commit

 

History

History
34 lines (18 loc) · 1.58 KB

README.md

File metadata and controls

34 lines (18 loc) · 1.58 KB

Python demo for uploader

English | 简体中文

This is a demo to upload files to Worker. It supports Typora.

We recommend you to use our PicGo plugin, because PicGo supports many editors like Typora and VSCode. PicGo also have a GUI version.

If you don't want to use PicGo, you can use this script or write your own.

How to use this script

Rename the example.env to .env , then fill in these fields:

  • UPLOAD_SECRET : must be exactly the same as the UPLOAD_SECRET you set when you deploy the worker.
  • REMOTE_URL : the URL you deploy your worker. For example, https://foo.bar.workers.dev/.

pip install -r requirements.txt to install requirements.

Then set the Typora upload command to python <path to main.py>. If you set proxy environment variables, the script will use them.

use in WSL

You may install python in wsl while running Typora in Windows.

In this case, the upload command is wsl python <path to main.py in wsl> --wsl.

If you have a proxy in windows and want to use it in WSL, use wsl python <path to main.py in wsl> --wsl --wsl-proxy-port <port>. It will use http://windowsip:<port> as proxy.

We use the nameserver in /etc/resolv.conf to get the IP of the windows machine. If you change it manually, the script may not work.

Other upload script

If you write a script in other languages or based on other Markdown editors, feel free to open a pull request. You can take mine as an example.