前不久遇到了这样一个问题,简单说一下情况。
A可以通过网络访问超星电子图书馆。
B无法通过网络访问超星电子图书馆,且笔记本为mac,但又需要得到超星电子图书馆中的一本电子书。
推断超星阅读器故意干扰了虚拟打印的结果。
并不想,也没有这个实力和时间去二进制逆向,转而思考网页上不是可以直接阅读电子书么,那直接抓下来不就行了。
网页分析的基础是当前网络可以访问超星电子图书馆
可以看到有规律的书籍图片的url地址
(也可以通过[右键图片]-[复制图片地址]来查看)
图片url规律总结如下:
前缀:
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE
书名:前缀/bok001?zoom=0
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE/bok001?zoom=0
版权:前缀/leg001?zoom=0
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE/leg001?zoom=0
前言:前缀/fow001?zoom=0
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE/fow001?zoom=0
目录:前缀/!00001?zoom=0
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE/!00001?zoom=0
正文:前缀/000001?zoom=0
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE/000001?zoom=0
封面:前缀/cov001?zoom=0
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE/cov001?zoom=0
封底:前缀/cov002?zoom=0
http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC169856008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A454CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D434D72ACFCB52C416057BE/cov002?zoom=0
注:
1. 000001或001等后缀中的数字为页码,可以更改
2. 前缀并不是固定的,同一本书的前缀会不断改变,以每次浏览器访问后检查的元素URL为准
写个脚本或程序调用wget来保存即可,代码示例:
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#define BOOL int
#define TRUE 1
#define FALSE 0
#define BUF_LEN 65536
char prefix[BUF_LEN];
void sslibrary_downloader(const char *description, const char *format)
{
char postfix[BUF_LEN];
char cmd[BUF_LEN];
int start_page;
int end_page;
printf("===================================================================\n");
printf("正在下载-%s页\n", description);
printf("请输入起始页码:");
scanf("%d", &start_page);
printf("请输入结束页码:");
scanf("%d", &end_page);
for (int i = start_page; i <= end_page; i++)
{
sprintf(postfix, format, i);
sprintf(cmd, "wget %s/%s?zoom=0 -O %s.png -q", prefix, postfix, postfix);
printf("正在下载 %s.png\n", postfix);
system(cmd);
}
}
int main()
{
printf("===================================================================\n");
printf("超星电子书下载器\n");
printf("===================================================================\n");
printf("前缀示例:中括号内为前缀\n");
printf("[http://img.sslibrary.com/n/69c532416a7a4d5e016edea664c881caMC16985\n");
printf("6008608/img0/29B073859CC81DEA5F67C63E8AB223EE74244D42FADA201AF884A4\n");
printf("54CC5B3439E5889A5BA66DDCA585F791C41C5B8EC739FE28DD7133B5DD56BA71C37\n");
printf("191540D3FB2D67277853A3E72841D9B61F23BED10C99C1540B13BE28E42F72DED0B\n");
printf("4255EB715B88AE7FC96E5D28885BD89A924D7ADA/bf1/qw/10952256/D45713A60D\n");
printf("434D72ACFCB52C416057BE]/000001?zoom=0\n");
printf("\n");
printf("请输入前缀:");
scanf("%s", prefix);
sslibrary_downloader("书名", "bok%03d");
sslibrary_downloader("版权", "leg%03d");
sslibrary_downloader("前言", "fow%03d");
sslibrary_downloader("目录", "!%05d");
sslibrary_downloader("正文", "%06d");
sslibrary_downloader("封面", "cov%03d");
system("pause");
return 0;
}
接下来用 Adobe Acrobat XI Pro 等软件将png图片转为pdf即可,直接浏览png图片也可以
windows下编译好的二进制程序我上传到csdn上了
http://download.csdn.net/detail/xbj1108_25/9831675
打开sslibrary_downloader.exe即可,依赖wget.exe
2017年7月4日
感谢网友wfc5582563的评论,经他测试后发现
zoom=2是原始尺寸, zoom=0是缩略尺寸