https://github.com/adrianlois/redshelf-bypass-drm-pdfdownload
RedShelf Virdocs - Bypass DRM protection PDF Download. Download ePub/eReader documents to PDF when downloading and printing is not allowed.
https://github.com/adrianlois/redshelf-bypass-drm-pdfdownload
bypass bypass-drm drm drm-protection ebook epub ereader pdf pdf-download redshelf virdocs
Last synced: about 1 month ago
JSON representation
RedShelf Virdocs - Bypass DRM protection PDF Download. Download ePub/eReader documents to PDF when downloading and printing is not allowed.
- Host: GitHub
- URL: https://github.com/adrianlois/redshelf-bypass-drm-pdfdownload
- Owner: adrianlois
- License: gpl-3.0
- Created: 2023-11-05T13:11:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-19T19:22:09.000Z (8 months ago)
- Last Synced: 2025-03-24T22:51:14.121Z (about 2 months ago)
- Topics: bypass, bypass-drm, drm, drm-protection, ebook, epub, ereader, pdf, pdf-download, redshelf, virdocs
- Language: Python
- Homepage:
- Size: 96.7 KB
- Stars: 27
- Watchers: 4
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RedShelf Virdocs - Bypass DRM protection PDF Download
In the web platform "**RedShelf Virdocs**" you are allowed to print in PDF your ePub/eReader documents, but sometimes the contributors or owners add DRM *(Digital Rights Management)* protection for do not allow the downloading and printing of these eBooks to avoid possible leaks or unauthorized third party distributions.
This is not a vulnerability or something not legitimate, simply an exploitation of how these eBooks published on this platform are being offered. Although the direct download or print functionality is not allowed for some eBooks by the contributor or owner, it is possible to "download" them in this alternative way.
This python script allows us to "bypass" DRM this protection and download ePub/eReader documents and export them to PDF format. First all pages are downloaded in jpg image format, resized to A4 size and finally a PDF document output is generated.
### Requirements
```python
pip install requests
pip install reportlab
```### Get URL ePub/eReader images
Inside the RedShelf Virdocs ePub/eReader viewer. We inspect the web and look for the iframe corresponding to the current page, in the body we will see a div containing the internal URL inside an img src tag. There we can copy the absolute path and substitute it in the variable "url_base".
### Variables
- Indicates the directory where the jpg images will be saved and the name of the exported PDF file.
- Replace XXXXXXX with the value of the URL.
- Replace the numpag variable with the number of jpg URL pages contained in the document.```python
target_directory_img = "TARGET_DIRECTORY_IMG"
base_url = "https://platform.virdocs.com/rscontent/epub/XXXXXXX/XXXXXXX/OEBPS/images/page-{}.jpg"
pdf_file = "EXPORT_PDF_FILE.pdf"
numpag = 350
```### Cookies
Replace session cookie settings. Use any browser addon for editing and exporting cookies.
```json
{
"session_id": "value1",
"csrftoken": "value2"
}
```### Usage
```python
python3 RedShelf-BypassDRM-PDFDownload.py
```
### Path to download without using the `img` tag
- Erikas Taroza: https://github.com/erikas-taroza/redshelf_downloader
```
https://platform.virdocs.com/spine/XXXXXXX/{}
```