Repository: laxyapahuja/bunken
Branch: main
Commit: 2be1c35fc41c
Files: 4
Total size: 6.0 KB
Directory structure:
gitextract_4v1j_yh4/
├── README.md
├── manifest.json
└── support/
└── goodreads/
├── content.js
└── script.js
================================================
FILE CONTENTS
================================================
================================================
FILE: README.md
================================================
# bunken (文献)
A chrome extension to download ebooks directly from Goodreads. Fetches ebooks from [LibGen](http://libgen.is), [LibGen Fiction](http://libgen.is/fiction), [Memory Of The World](http://library.memoryoftheworld.org) & [OpenLibrary](https://openlibrary.org).
⚠️ Users are advised to exercise caution and use this Chrome extension at their own risk, as I disclaim any liability for the outcomes or actions resulting from its utilization.

## How to install
1. Clone this repository.
2. Open chrome extensions panel by visiting `chrome://extensions`.
3. Turn developer mode on.
4. Click on Load Unpacked.
5. Select the folder containing the repository with the root directory.
6. Visit any books' page on Goodreads. The ebooks should load under Related Books section.
7. Choose different sources according to your needs.
## How to contribute
Help contribute by using it, finding bugs and opening issues. Pull requests are also appreciated!
API repository available at [laxyapahuja/bunken-api](https://github.com/laxyapahuja/bunken-api).
================================================
FILE: manifest.json
================================================
{
"name": "bunken",
"version": "3.1",
"manifest_version": 3,
"action": {
"default_icon": "./icon.png",
"default_title": "bunken"
},
"icons": {
"300": "./icon.png"
},
"content_scripts": [{
"matches": ["https://www.goodreads.com/book/show/*"],
"js": ["support/goodreads/content.js"],
"run_at": "document_end"
}],
"web_accessible_resources": [{ "resources": ["support/goodreads/script.js"], "matches": ["*://*.goodreads.com/*"] }],
"permissions": [
"tabs"
],
"host_permissions": [
"*://libgen.is/*",
"*://goodreads.com/*",
"*://api.bunken.tk/*"
]
}
================================================
FILE: support/goodreads/content.js
================================================
let s = document.createElement('script');
s.src = chrome.runtime.getURL('support/goodreads/script.js');
document.head.appendChild(s);
================================================
FILE: support/goodreads/script.js
================================================
const API = 'https://api.bunken.tk/'
let isRedesign = !document.querySelector("[property='books:isbn']")
let bookJSON = isRedesign ? JSON.parse(document.querySelector('[type="application/ld+json"]').innerText) : {}
let ebookElement = document.createElement('div')
let ebookResultsElement;
let relatedElement = isRedesign ? document.querySelector('.BookActions') : document.querySelector('[id^="relatedWorks-"]')
let bookTitle = document.querySelector("[property='og:title']").getAttribute("content");
let ISBNCode = isRedesign ? bookJSON.isbn : document.querySelector("[property='books:isbn']").getAttribute("content");
let authorName = isRedesign ? bookJSON.author[0].name : document.getElementsByClassName('authorName')[0].innerText
function insertAfter(referenceNode, newNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
function ebookElementInflator(results) {
ebookResultsElement.innerHTML = ''
results.forEach(book => {
let resultElement = document.createElement('div')
resultElement.className = 'elementList'
let bookElement = document.createElement('div')
let bookLinkElement = document.createElement('a')
bookLinkElement.href = book.link
bookLinkElement.textContent = book.title
bookLinkElement.className = 'actionLinkLite bookPageGenreLink'
bookLinkElement.target = "_blank"
bookElement.appendChild(bookLinkElement)
resultElement.appendChild(bookElement)
if (book.downloads != null) {
book.downloads.forEach(download => {
let downloadElement = document.createElement('div')
let downloadLinkElement = document.createElement('a')
downloadLinkElement.href = download.link
downloadLinkElement.textContent = download.format
downloadLinkElement.style.color = 'blue'
downloadElement.appendChild(downloadLinkElement)
resultElement.appendChild(downloadElement)
})
}
let authorElement = document.createElement('div')
authorElement.textContent = book.author
resultElement.appendChild(authorElement)
let clearElement = document.createElement('div')
clearElement.className = 'clear'
resultElement.appendChild(clearElement)
ebookResultsElement.appendChild(resultElement)
})
}
function sourceSelect() {
let e = document.getElementById("source");
let value = e.options[e.selectedIndex].value;
search(value)
}
function setupUI() {
let template = `<div class="h2Container gradientHeaderContainer">
<h2 class="brownBackground">E-Books</h2>
</div>
<select id="source" onchange="sourceSelect()">
<option value="libgen/fiction">Source: LibGen Fiction</option>
<option value="libgen">Source: LibGen</option>
<option value="motw">Source: Memory Of The World</option>
<option value="audiobookbay">Source: AudioBookBay</option>
<option value="openlibrary">Source: OpenLibrary</option>
</select>
<div id="ebookResults" class="bigBoxContent containerWithHeaderContent" style="overflow-y: auto; max-height: 300px;" id="resultsDiv">Searching...</div>`
ebookElement.innerHTML = template
ebookElement.className = 'bigBox'
ebookElement.innerHTML += `<h4>made by <a target="_blank" href="https://laxya.co">laxyapahuja</a></h4><h4>extension not working? message me on <a target="_blank" href="https://discord.gg/GwDraJjMga">discord</a>.</h4>`
insertAfter(relatedElement, ebookElement)
ebookResultsElement = document.getElementById('ebookResults')
}
function search(source) {
ebookResultsElement.innerHTML = 'Searching...'
fetch(`${API}${source}?title=${encodeURIComponent(bookTitle)}&isbn=${encodeURIComponent(ISBNCode)}&author=${encodeURIComponent(authorName)}`).then(response => {
response.json().then(res => {
ebookElementInflator(res)
})
})
}
setupUI();
search('libgen/fiction')
gitextract_4v1j_yh4/
├── README.md
├── manifest.json
└── support/
└── goodreads/
├── content.js
└── script.js
SYMBOL INDEX (6 symbols across 1 files)
FILE: support/goodreads/script.js
constant API (line 1) | const API = 'https://api.bunken.tk/'
function insertAfter (line 12) | function insertAfter(referenceNode, newNode) {
function ebookElementInflator (line 16) | function ebookElementInflator(results) {
function sourceSelect (line 54) | function sourceSelect() {
function setupUI (line 60) | function setupUI() {
function search (line 79) | function search(source) {
Condensed preview — 4 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (7K chars).
[
{
"path": "README.md",
"chars": 1169,
"preview": "# bunken (文献)\n\nA chrome extension to download ebooks directly from Goodreads. Fetches ebooks from [LibGen](http://libgen"
},
{
"path": "manifest.json",
"chars": 681,
"preview": "{\n \"name\": \"bunken\",\n \"version\": \"3.1\",\n \"manifest_version\": 3,\n \"action\": {\n \"default_icon\": \"./icon"
},
{
"path": "support/goodreads/content.js",
"chars": 135,
"preview": "let s = document.createElement('script');\n\ns.src = chrome.runtime.getURL('support/goodreads/script.js');\n\ndocument.head."
},
{
"path": "support/goodreads/script.js",
"chars": 4188,
"preview": "const API = 'https://api.bunken.tk/'\n\nlet isRedesign = !document.querySelector(\"[property='books:isbn']\")\nlet bookJSON ="
}
]
About this extraction
This page contains the full source code of the laxyapahuja/bunken GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 4 files (6.0 KB), approximately 1.5k tokens, and a symbol index with 6 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.