Full Code of gregcw11/CHDL for AI

master 46cc3508f150 cached
4 files
3.0 KB
936 tokens
5 symbols
1 requests
Download .txt
Repository: gregcw11/CHDL
Branch: master
Commit: 46cc3508f150
Files: 4
Total size: 3.0 KB

Directory structure:
gitextract_aggy6toa/

├── Min/
│   ├── README.md
│   ├── background.js
│   └── manifest.json
└── README.md

================================================
FILE CONTENTS
================================================

================================================
FILE: Min/README.md
================================================
# CHDL
Course Hero File Downloader. Free.


================================================
FILE: Min/background.js
================================================
function init(){chrome.tabs.executeScript({allFrames:!0,code:"document.documentElement.outerHTML"},function(a){parseHTML(a[0])})}function parseHTML(a){var b="document/",c="ratings/",d=a.indexOf(b),e=a.indexOf(c),f=a.substring(d+b.length,e-1);req(uUrl),req(fUrl+f),fLink=bUrl+fUrl+dUrl+f}function req(a){var b=new XMLHttpRequest;b.open("GET",bUrl+a,!0),b.onload=function(){if(b.status>=200||b.status<=400){var a=JSON.parse(b.responseText);console.log(a),manageData(a)}else console.log("Bad response from server.")},b.send()}function manageData(a){a.user_id?uInfo=a:a.db_filename?(fInfo=a,cID=fInfo.course_id,getAll?req(cUrl+cID+limit):download()):getAll&&(cInfo=a,download())}function download(){if(getAll){var a=bUrl+fUrl+dUrl;console.log("Trying cID"+cID);for(file in cInfo)console.log(file,a+cInfo[file].db_filename,cInfo[file].title),chrome.downloads.download({url:a+cInfo[file].db_filename})}else console.log(fLink,fInfo.title,fInfo.course.dept_acro,fInfo.course.course_num),chrome.downloads.download({url:fLink})}var bUrl="https://www.coursehero.com/api/v1/",uUrl="users/",fUrl="documents/",dUrl="download/",cUrl="documents/course/",fLink,uInfo,fInfo,cInfo,limit="/?limit=1000",getAll=!1;chrome.runtime.onInstalled.addListener(function(){chrome.contextMenus.create({title:"Download this file.",id:"getOne",contexts:["all"]}),chrome.contextMenus.create({title:"Download all files from this course.",id:"getAll",contexts:["all"]})}),chrome.contextMenus.onClicked.addListener(function(a,b){"getOne"===a.menuItemId?getAll=!1:"getAll"===a.menuItemId&&(getAll=!0),init()});

================================================
FILE: Min/manifest.json
================================================
{
    "name": "CHDL",
    "description": "Don't tell your friendsgiving staff.",
    "version": "1.0",
    "permissions": [
        "tabs",
        "contextMenus",
        "downloads",
        "http://coursehero.com/*",
        "https://coursehero.com/*",
        "http://www.coursehero.com/*",
        "https://www.coursehero.com/*"
    ],
    "background": {
        "scripts": ["background.js"],
        "persistent": false
    },
    "browser_action": {
        "default_title": "Right click to see options."
    },
    "icons": {
        "48": "icon48.jpeg"
    },
    "manifest_version": 2
}


================================================
FILE: README.md
================================================
# CHDL
Course Hero File Downloader. Free.

![](https://puu.sh/mnFsH/d2b9af6b23.png)

This script was hastily concocted. CHDL is a Chrome Extension that attempts to download full (unblurred) documents from Course Hero.

## Installation
The extension must be installed in Chrome's developer mode.

## Usage
You must be on a document page on CourseHero to use the extension from either the toolbar or the right-click context menu, and you must be signed in on the CourseHero website.

The extension works due to a weird permission error on CourseHero's end that fails to check what files users should be able to access.

Singular file downloads seem to have a very high success rate when the entire document is shown (even if most pages are blurred).

Try out the "Download all files from this course." option to start downloading relevant files - it shouldn't be more than a handful. 
Download .txt
gitextract_aggy6toa/

├── Min/
│   ├── README.md
│   ├── background.js
│   └── manifest.json
└── README.md
Download .txt
SYMBOL INDEX (5 symbols across 1 files)

FILE: Min/background.js
  function init (line 1) | function init(){chrome.tabs.executeScript({allFrames:!0,code:"document.d...
  function parseHTML (line 1) | function parseHTML(a){var b="document/",c="ratings/",d=a.indexOf(b),e=a....
  function req (line 1) | function req(a){var b=new XMLHttpRequest;b.open("GET",bUrl+a,!0),b.onloa...
  function manageData (line 1) | function manageData(a){a.user_id?uInfo=a:a.db_filename?(fInfo=a,cID=fInf...
  function download (line 1) | function download(){if(getAll){var a=bUrl+fUrl+dUrl;console.log("Trying ...
Condensed preview — 4 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3K chars).
[
  {
    "path": "Min/README.md",
    "chars": 42,
    "preview": "# CHDL\nCourse Hero File Downloader. Free.\n"
  },
  {
    "path": "Min/background.js",
    "chars": 1572,
    "preview": "function init(){chrome.tabs.executeScript({allFrames:!0,code:\"document.documentElement.outerHTML\"},function(a){parseHTML"
  },
  {
    "path": "Min/manifest.json",
    "chars": 598,
    "preview": "{\n    \"name\": \"CHDL\",\n    \"description\": \"Don't tell your friendsgiving staff.\",\n    \"version\": \"1.0\",\n    \"permissions\""
  },
  {
    "path": "README.md",
    "chars": 883,
    "preview": "# CHDL\nCourse Hero File Downloader. Free.\n\n![](https://puu.sh/mnFsH/d2b9af6b23.png)\n\nThis script was hastily concocted. "
  }
]

About this extraction

This page contains the full source code of the gregcw11/CHDL GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 4 files (3.0 KB), approximately 936 tokens, and a symbol index with 5 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.

Copied to clipboard!