A tool for downloading theses from Peking University's copyright protection system.
Modified from the original PKU Copyleft
repository.
This software is free and belongs to the public domain. The author provides no warranties or guarantees. Users must assume all responsibilities for using this software; any consequences resulting from its use are borne by the users.
- Required dependencies:
fish
(version >=3.0.0
),curl
,jq
,pup
,img2pdf
. - Optional dependencies:
parallel
(to enhance download speed),ocrmypdf
(for OCR on downloaded PDFs. Limited support for Chinese).
sudo pacman --sync --refresh --sysupgrade && sudo pacman --sync fish curl jq img2pdf parallel
pup
(or pup-git
, pup-bin
), ocrmypdf
need to be installed from AUR.
sudo apt-add-repository ppa:fish-shell/release-3
sudo apt update && sudo apt install fish curl jq img2pdf parallel ocrmypdf
pup
needs to be installed manually.
apt update && apt install fish curl jq pup parallel
img2pdf
and ocrmypdf
needs to be installed manually.
Install with Homebrew๏ผ
brew install fish curl jq pup parallel ocrmypdf
img2pdf
needs to be installed manually.
- Connect to Peking University's campus network or use the Peking University VPN.
- Go to the Peking University Thesis Database, and search for the thesis you want.
- Click on the title of the thesis in the search results, go to the "View Thesis Information" page, and click "View Full Text" at the top right corner.
- A page with a URL like "https://drm.lib.pku.edu.cn/pdfindex1.jsp?fid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" will pop up, where you can view the thesis. Note down the
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
part afterfid=
in the URL. - In your browser, press
F12
(orCtrl
+Shift
+I
on Windows,Option
+Command
+I
on MacOS) to open Developer Tools, select the Storage tab, choose Cookies, and find the row with Name asJSESSIONID
. Note down the valueYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
in the Value column. - Open a command line tool, navigate to the folder where
pku_copyleft.fish
is located, and run the following command to download the thesis PDF to that folder.
./pku_copyleft.fish -c 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY' -f 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
This software is free and belongs to the public domain. See Unlicense.txt
for details.