Skip to main content

A command-line tool to rescue images from Weibo by updating and using CDN information.

Project description

Weibo Image Rescue Tool

Introduction

The Weibo Image Rescue Tool is a command-line utility designed to help you rescue images from Weibo by updating and using CDN information.

Inspired by t0mbkeeper and weibo-image-hound.

80% of the code was generated by ChatGPT-4.

Features

  • Update CDN information
  • Force update CDN information and rescue image from a specific URL
  • Rescue image from a specified URL

Installation

Install from PyPI:

pip install weibo-image-rescue-tool

For local development:

git clone https://github.com/rquanx/weibo-image-rescue.git
cd weibo-image-rescue
pip install -e .

Usage

Update CDN Information

To update CDN information, use the -u flag:

weibo-image-rescue -u

Force Update CDN Information and Rescue Image

To force update CDN information and rescue an image from a specific URL, use one of:

Preferred:

weibo-image-rescue --force-update <image_url>

Backward-compatible:

weibo-image-rescue -f <image_url>

Rescue Image from a Specified URL

To rescue an image from a specified URL without updating the CDN information, simply provide the image URL:

weibo-image-rescue <image_url>

Rescue Image with different quality

weibo-image-rescue <image_url> # default quality is all
weibo-image-rescue <image_url> -q ol,l,ml,m,o,t # form large to small

Tune Concurrency and Timeout

weibo-image-rescue <image_url> --workers 30 --timeout 8

Output Directory

weibo-image-rescue <image_url> --output-dir ./images

Example

weibo-image-rescue -f https://example.com/image.jpg

Arguments

  • -u, --update-cdn : Update CDN information only.
  • --force-update : Force update CDN information before rescuing positional image_url.
  • -f <image_url> : Backward-compatible mode, force update and rescue specified URL.
  • -q : Quality list, comma-separated values, e.g. ol,l,ml,m,o,t.
  • --workers : Max concurrent probing requests.
  • --timeout : Per-request timeout in seconds.
  • -o, --output-dir : Directory for rescued image files.
  • image_url : The URL of the image to rescue.

License

This project is licensed under the terms of the GNU General Public License v3.0. See LICENSE for more details.

Acknowledgements

Special thanks to all contributors and the open-source community for their invaluable support and contributions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weibo_image_rescue_tool-2.0.0.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weibo_image_rescue_tool-2.0.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file weibo_image_rescue_tool-2.0.0.tar.gz.

File metadata

  • Download URL: weibo_image_rescue_tool-2.0.0.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for weibo_image_rescue_tool-2.0.0.tar.gz
Algorithm Hash digest
SHA256 063f84cb451286aed927a08ea4345c2f0fab91f204126b120d803545fcf4b772
MD5 7afcfe6d5e6bf24ac3e1e988d0e22590
BLAKE2b-256 6dcaa126df6d1d81a5378a25f7d5634eda5d70233f4cff28ab1e88edf1a2b1b6

See more details on using hashes here.

File details

Details for the file weibo_image_rescue_tool-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for weibo_image_rescue_tool-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 159bd227174e905bb737b7cafc6b0b8cdbbf5f1325ec47dbff5143ad36ee5772
MD5 c25ad5df4b5461dd1196ce1487e2a01e
BLAKE2b-256 548a43a8b9d18a9cbe0a19f507bb25f73d784de84eafd7f20f43f58f0f6bc80b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page