Skip to main content

PageSaver

Python version PyPI package PyPI download GitHub GitHub last commit (by committer)

Archive your web page.

Requirements

  • Python >= 3.8

Install

pip
pip install pagesaver
✨🍰✨

Or you can use pip install git+https://github.com/ZhaoQi99/PageSaver.git install latest version.

docker
docker run -d --name pagesaver -p 8001:8001 zhaoqi99/pagesaver

Quick Start

HTTP API

  1. Init PageSaver: pagesaver init
  2. Start HTTP Server: pagesaver server

    nohup pagesaver server >> server.log 2>&1 &

  3. Examples:
~$ curl http://127.0.0.1:8001/api/record/https://www.baidu.com/?format=MHTML&format=PDF -H 'Authorization: <API_TOKEN>'
~$ curl http://127.0.0.1:8001/api/record/notion/https://www.baidu.com/?format=MHTML&format=PDF&api_token=api_token&database_id=1&token_v2=token_v2&title=test -H 'Authorization: <API_TOKEN>'

CLI

pagesaver export https://www.baidu.com -o . -f MHTML,PDF

HTTP Usage

Authorization

Using the Authorization header, format is: Authorization: <API_TOKEN>

Record API

  • GET api/record/{url}?format=MHTML&format=PDF

Query Params

Parameter Type Required Description
format string No Storage format, can be MHTML or PDF, defaults to all.

Notion Push API

  • GET api/record/notion/{url}?format=MHTML&format=PDF&api_token=<NOTION_API_TOKEN>&database_id=<NOTION_DATABASE_ID>&token_v2=<NOTION_TOKEN_V2>&title=test
  • Notion API Token
  • Notion Token V2: F12 -> Application -> Cookies -> token_v2
  • Database ID: https://www.notion.so/{USERNAME}/{DATABASE_ID}
  • Connection with: Notion ->Top right corner -> More -> Connections -> Connect to -> Your Integration

Automations

IOS Shortcut

Query Params

Parameter Type Required Description
format string No Storage format, can be MHTML or PDF, defaults to all.
api_token* string Yes Notion API Token
database_id* string Yes Notion Database ID
title string No Title stored in Notion.
token_v2 string No Obtained from Browser->Cookies->token_v2.To store files in Notion, this parameter is required.

CLI Usage

Export

~$ pagesaver export -h
Usage: pagesaver export [OPTIONS] URL

  Export page to the output file

Options:
  -f, --format [MHTML,PDF]  Format which you want to export  [required]
  -o, --output DIRECTORY    Output directory of the file  [required]
  -n, --name TEXT           Name of the exported file  [default: exported]
  -h, --help                Show this message and exit.

Server

~$ pagesaver init
~$ pagesaver server -h
Usage: pagesaver server [OPTIONS]

  Run PageSaver HTTP server

Options:
  -h, --help       Show this message and exit.
  -b, --bind TEXT  The TCP host/address to bind to.  [default: 0.0.0.0:8001]

Configuration

PageSaver will read the configuration from config.py automatically.

STORAGE

  • type: storage type. Currently supported values are "local".
  • path: path of storage.This is only used when type is set to "local".

SERVER_BIND

The TCP host/address to bind to.

Default: 0.0.0.0:8001

TITLE_PROPERTY

The property name in Notion to use for the title of a page.

Default: title

The property name in Notion to use for the link of a page.

Default: link

MHTML_PROPERTY

The property name in Notion to use for the MHTML file of a page.

Default: mhtml

License

GNU General Public License v3.0

Author

Metadata

Release files for pagesaver 0.1.0

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

Source distribution (sdist)

Source distribution for pagesaver 0.1.0
File Size Uploaded Provenance
pagesaver-0.1.0.tar.gz 31.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pagesaver 0.1.0
File Interpreter ABI Platform
pagesaver-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.3 kB

Release files / pagesaver-0.1.0.tar.gz

Download URL pagesaver-0.1.0.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0c05c9d0192761a2850439f455be8e594ef8cafd618201b800bd8b28de2dd790
BLAKE2b-256 checksum
How to use checksums
d6c6fb384f68553962e33315e2231cb7b4a87660ac2ae6e855b29932785aca4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Release files / pagesaver-0.1.0-py3-none-any.whl

Download URL pagesaver-0.1.0-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab76e6ddaec0dc04f35f27727e301d4de7b3d92e74e3cc77faac18c06429a540
BLAKE2b-256 checksum
How to use checksums
adf69164f5b2d7747e4c81bc3337c83c79c45136e79f9bd3562e5b1211fbe7b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Security for pagesaver 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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