Skip to content

Instantly share code, notes, and snippets.

@tuxskar
tuxskar / packtpub_get_your_library_books.js
Last active July 23, 2019 15:06 — forked from juzim/packtpub_get_dl_links.js
Create wget commands for all claimed books on packtpub
/*
== Adapted from the code over at https://gist.github.com/graymouser/a33fbb75f94f08af7e36 ==
Log into your account at packtpub.com and save the cookies with the "cookies.txt" Chrome extension or the "Export cookies" Firefox extension into the file cookies.txt.
Then open the console in your browsers dev tools and paste the following code.
You will get a list of wget commands that you can copy and paste as a whole into a terminal to download all books.
Example: wget --load-cookies=cookies.txt --content-disposition "https://packtpub.com//ebook_download/20217/mobi" -O "R Data Visualization Cookbook.mobi"
If you only want some filetypes, edit the "pattern" vaiable accordingly.