Skip to content

Instantly share code, notes, and snippets.

@jcahill
Last active April 17, 2024 01:13
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcahill/741000002a0c6b656a0641c96d751d35 to your computer and use it in GitHub Desktop.
Save jcahill/741000002a0c6b656a0641c96d751d35 to your computer and use it in GitHub Desktop.
Sci-Hub and Libgen bookmarklets

Sci-Hub and Libgen Bookmarklets

Usage

  1. Add a bookmark in your browser toolbar
  2. Name: something memorable
  3. URL: paste the code snippet
  4. On a paper's publisher page, or another page with the content's DOI, click on the bookmarklet.

If a DOI is found, your window will be sent to the corresponding sci-hub or libgen result page, respectively.
If no DOI is found, you won't go anywhere. An alert will tell you of the failure.

Bookmarklets

Sci-Hub

javascript:(function() { var body = document.documentElement.innerHTML; var re = /\b10\.[^\s\%"#\?,']+\/[^\s\%"#\?,']+/g; var matches = body.match(re); if (matches === null) { alert("DOI not found"); return undefined; } doi = matches[0]; window.location = "http://sci-hub.tw/" + doi; })();

Libgen Scimag (sci-hub mirrors)

javascript:(function() { var body = document.documentElement.innerHTML; var re = /\b10\.[^\s\%"#\?,']+\/[^\s\%"#\?,']+/g; var matches = body.match(re); if (matches === null) { alert("DOI not found"); return undefined; } doi = matches[0]; window.location = "http://libgen.io/scimag/index.php?s=" + doi; })();
@jcahill
Copy link
Author

jcahill commented Dec 17, 2017

WIP: will add in comprehensive tabled data on IPs, domains, types of mirrors, completeness of mirrors

Address Status Lifespan Note
sci-hub.ac down seized
sci-hub.bz down seized
sci-hub.cc down seized
sci-hub.hk up
sci-hub.io down
sci-hub.la up
sci-hub.mn up
sci-hub.name up
sci-hub.tw up
sci-hub.tv up
scihub22266oqcxt.onion up
80.82.77.83 up
80.82.77.84 up
80.82.78.170

@seongyher
Copy link

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment