GithubHelp home page GithubHelp logo

bytetopia / geektime2pdf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jjeejj/geektime2pdf

0.0 1.0 0.0 1.54 MB

极客时间专栏文章 转为 PDF 包含评论 音频

License: MIT License

JavaScript 5.83% EJS 94.17%

geektime2pdf's Introduction

极客时间专栏转换为PDF

说明:该项目仅仅只能用户个人学习使用,不能在商业中使用,若极客时间官方要求该代码仓库删除,请联系我进行删除

使用方法

配置信息

在配置文件config.js中修改配置所需要的信息

/**
 * 需要转换为 pdf 的配置信息 
 */
module.exports = {
    url: 'https://time.geekbang.org/serv/v1/article', // 该配置项不需要改动
    commentUrl: 'https://time.geekbang.org/serv/v1/comments', // 该配置项不需要改动
    columnBaseUrl: 'https://time.geekbang.org/column/article/', // 该配置项不需要改动
    columnName: '玩转VScode', // 专栏名称
    firstArticalId: 18053, //专栏第一篇文章的ID
    articalIds: [201700,202772,204472,205784],  //指定下载的articalId, 优先级更高, 配置后firstArticalId配置将失效
    isdownloadVideo: false, // 是否下载音频
    isComment: false, // 是否导出评论
    cookie: 'cookie'
};
  • 上面的配置项前三项是不需要修改的, 只需要修改后面的专栏信息

  • 会自动生成一个geektime_{{columnName}} 的文件夹来保存导出的所有pdf文件, columnName 为上面配置的

  • firstArticalId 这个参数最好配置专栏第一篇文章的 ID ,这个可以获取专栏的所有的文章,若不是第一篇文章的ID 则获取的是该文章以及之后的文章

  • articalIds 这个参数配置为需要获取的文章的所有的 ID

  • cookie 你在网页版登录后返回的cookie信息

运行

  1. git clone [email protected]:jjeejj/geektime2pdf.git 在本地克隆下来
  2. 然后执行 npm i 安装依赖
  3. 运行主程序 node columnArticleList.js 等待一段时间,生成 PDF 完成

这里可以先设置 firstArticalId 参数,获取整个专栏的内容;若中间有错误,不用管它,等运行完毕后,再设置 articalIds 参数,参数的值为上面获取失败的文章 ID,再次运行下载

导出结果

问题汇总

geektime2pdf's People

Contributors

dependabot[bot] avatar jjeejj avatar niyalishanda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.