PicGo plugin for 123pan image hosting
npm install picgo-plugin-123panbash
npm install picgo -g
`
2. Install the Plugin:
- PicGo-Core (CLI):
`bash
picgo install 123pan
`
- PicGo GUI Manual Installation:
- Download the latest release package
- In PicGo, go to "Plugin Settings"
- Click "Install from local file"
- Select the downloaded package
Configuration
$3
To use this plugin, you need:
1. A 123pan account with OpenAPI access (currently only available for VIP members)
2. Your clientID and clientSecret from the 123pan OpenAPI management interface
$3
1. Open PicGo
2. Go to "Image Uploader" in the sidebar
3. Select "123pan" as the uploader
4. Enter your credentials:
- Client ID: Your 123pan API client ID
- Client Secret: Your 123pan API client secret
- Parent Folder Name (Optional): The name of a folder to store your images
$3
Edit your PicGo configuration file (usually located at ~/.picgo/config.json on Linux/macOS or %USERPROFILE%\.picgo\config.json on Windows):
`json
{
"picBed": {
"uploader": "123pan",
"current": "123pan",
"123pan": {
"clientID": "your_client_id",
"clientSecret": "your_client_secret",
}
},
"picgoPlugins": {
"picgo-plugin-123pan": true
}
}
`
Usage
$3
1. Upload via Clipboard:
- Copy an image to your clipboard
- Click the PicGo tray icon
- Select "Upload from Clipboard"
2. Upload from File:
- Click the PicGo tray icon
- Select "Upload from Files"
- Choose image(s) to upload
3. Upload from Screenshot (if you have screenshot plugin):
- Use your configured screenshot shortcut
- The image will be automatically uploaded
4. Using Plugin Menu Options:
- In PicGo, navigate to the 123pan plugin settings
- Use additional options like "Upload from URL" or "Configure API settings"
$3
1. Configure Typora:
- Open Typora
- Go to File > Preferences > Image
- Select "Upload image" for Image insertion
- Choose "PicGo-Core (command line)" or "Custom Command" with path to PicGo
- Click "Test Uploader" to verify the setup
2. Using with Typora:
- Paste an image directly from clipboard (Ctrl+V)
- Typora will automatically upload via PicGo
$3
Upload an image using the command line:
`bash
picgo upload /path/to/your/image.jpg
`
Troubleshooting
$3
1. "PreuploadID cannot be empty" Error:
- This can occur during first-time uploads with Typora
- Solution: The plugin will automatically retry. If it fails, try manually uploading by right-clicking the image in Typora.
2. Upload Hanging in Typora:
- If an upload seems to hang indefinitely in Typora
- Solution: The plugin has a built-in 60-second timeout that will force completion. You can try again if needed.
3. Authentication Errors:
- Check that your Client ID and Client Secret are correct
- Verify your 123pan VIP subscription is active
- Try regenerating your API credentials from the 123pan website
4. Folder Creation Failures:
- If specified parent folder can't be created
- Solution: The plugin will default to uploading to the root directory
$3
For advanced troubleshooting, you can enable debug logging:
- PicGo GUI: Go to "PicGo Settings" > Enable "Log Level - Debug"
- PicGo-Core: Set the debug environment variable: DEBUG=picgo* picgo upload /path/to/image.jpg
Advanced Features
$3
In PicGo GUI, you can use Ctrl+Alt+1` as a shortcut for quick uploads from clipboard.