-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push version v0.5.0 to Master
- Loading branch information
Showing
23 changed files
with
415 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*.pyc | ||
.vscode | ||
test\ Kopie.db | ||
_test.db | ||
test.db | ||
__pycache__ | ||
comic/* | ||
data/* | ||
kindlegen.exe | ||
.idea | ||
venv | ||
main.db | ||
log/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,9 @@ _test.db | |
test.db | ||
__pycache__ | ||
comic/* | ||
data/* | ||
kindlegen.exe | ||
.idea | ||
venv | ||
main.db | ||
log/* | ||
log/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM python:3.6-slim | ||
|
||
MAINTAINER Schemen <[email protected]> | ||
|
||
|
||
WORKDIR /usr/src/app | ||
|
||
VOLUME /usr/src/app/data | ||
|
||
ENTRYPOINT ["/usr/bin/dumb-init", "--"] | ||
|
||
COPY requirements.txt ./ | ||
RUN apt-get update && apt-get install dumb-init gcc wget -y && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install --no-cache-dir -r requirements.txt && \ | ||
apt-get purge gcc -y && apt-get autoremove -y && apt-get clean | ||
|
||
RUN wget http://kindlegen.s3.amazonaws.com/kindlegen_linux_2.6_i386_v2_9.tar.gz -O /tmp/kindlegen.tar.gz && \ | ||
tar xvf /tmp/kindlegen.tar.gz -C /tmp && mv /tmp/kindlegen /usr/bin && \ | ||
rm -r /tmp/* | ||
|
||
|
||
COPY . . | ||
|
||
CMD [ "python","m2em.py", "--daemon", "-s"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,12 @@ Not living in Japan has me not really having any readable access of weekly chapt | |
|
||
M2em let's you automatically download Mangas via RSS Feed that updates at a configurable interval (and comics in the future?), convert them into eMangas and send them off via Email (Target being the Email to Kindle function of Amazon)! | ||
|
||
## Supported Websites | ||
|
||
* Mangastream | ||
* MangaFox | ||
* Cdmnet | ||
|
||
# Setup | ||
|
||
M2em requires Python3 and I highly recommend working in a virtualenv. Some OS require the python-dev package! | ||
|
@@ -39,6 +45,24 @@ deactivate | |
|
||
Get Kindlegen here: https://www.amazon.com/gp/feature.html?docId=1000765211 | ||
|
||
## Docker Setup | ||
You can use the Dockerfile or the image schemen/m2em. All options in the config.ini are available as environment variable. Make sure you write the exactly the same! | ||
|
||
Example Compose file: | ||
``` | ||
version: '2' | ||
services: | ||
m2em: | ||
image: schemen/m2em:latest | ||
environment: | ||
- SMTPServer=mail.example.com | ||
- [email protected] | ||
- EmailAddressPw=verysecurepassword | ||
volumes: | ||
- <DATA_DIRECTORY>:/usr/src/app/data | ||
``` | ||
|
||
## Concept | ||
As a concept, M2em has different workers that run in a loop. All Chapter/user data is saved in a SQLite3 Database. | ||
* RssParser - Parsing the RSS feed and saving the information of each chapter | ||
|
@@ -64,15 +88,16 @@ Example: if you wish to download all chapters you have saved in your database, y | |
You can directly apply an action to one chapter with the options --download, --convert or --send. You need to pass | ||
the ID of said chapter, you can find that out with "-Lc" or "-lc". | ||
You can pass multiple IDs. | ||
Example: | ||
|
||
Also, you can process N chapters with the "--process/-p" option: | ||
``` | ||
./m2em.py --download 100 #Downloads chapter with ID 100 | ||
./m2em.py -p 100 #Downloads, Converts and Sends chapter with ID 100 | ||
``` | ||
|
||
|
||
## Supported Websites | ||
* Mangastream | ||
* MangaFox | ||
``` | ||
./m2em.py --download 100 #Downloads chapter with ID 100 | ||
``` | ||
|
||
# Usage | ||
|
||
|
@@ -81,9 +106,10 @@ Example: | |
usage: m2em.py [-h] [-af ADD_FEED] [-au] [-lm [LIST_MANGA]] [-lc] [-Lc] [-lf] | ||
[-lu] [-cd] [-s] [--send [SEND [SEND ...]]] | ||
[--convert [CONVERT [CONVERT ...]]] | ||
[--download [DOWNLOAD [DOWNLOAD ...]]] [-a ACTION] | ||
[-ss SWITCH_SEND] [-sc SWITCH_CHAPTER] [-dc DELETE_CHAPTER] | ||
[-du DELETE_USER] [-df DELETE_FEED] [--daemon] [-d] [-v] | ||
[--download [DOWNLOAD [DOWNLOAD ...]]] | ||
[-p [PROCESS [PROCESS ...]]] [-a ACTION] [-ss SWITCH_SEND] | ||
[-dc DELETE_CHAPTER] [-du DELETE_USER] [-df DELETE_FEED] | ||
[--daemon] [-d] [-v] | ||
Manga to eManga - m2em | ||
|
@@ -112,13 +138,14 @@ optional arguments: | |
--download [DOWNLOAD [DOWNLOAD ...]] | ||
Downloads Chapter directly by chapter ID. Multiple IDs | ||
can be given | ||
-p [PROCESS [PROCESS ...]], --process [PROCESS [PROCESS ...]] | ||
Processes chapter(s) by chapter ID, Download, convert, | ||
send. Multiple IDs can be given | ||
-a ACTION, --action ACTION | ||
Start action. Options are: rssparser (collecting feed | ||
data), downloader, converter or sender | ||
-ss SWITCH_SEND, --switch-send SWITCH_SEND | ||
Pass ID of User. Switches said user Send eBook status | ||
-sc SWITCH_CHAPTER, --switch-chapter SWITCH_CHAPTER | ||
Pass ID of Chapter. Switches said Chapter Sent status | ||
-dc DELETE_CHAPTER, --delete-chapter DELETE_CHAPTER | ||
Pass ID of Chapter. Deletes said Chapter | ||
-du DELETE_USER, --delete-user DELETE_USER | ||
|
@@ -147,7 +174,7 @@ For the sending to work, you need to have an email account so the program can se | |
``` | ||
[CONFIG] | ||
# Location relative to the code position | ||
SaveLocation = comic/ | ||
SaveLocation = data/ | ||
# Database name | ||
Database = main.db | ||
# Duration the program sleeps after one run is finished in seconds | ||
|
@@ -203,7 +230,6 @@ If you wish to disable/enable sending status of a user, use the -ss command | |
``` | ||
|
||
|
||
|
||
### A complete run with nothing happening: | ||
``` | ||
Starting Loop at 2017-11-15 18:13:05 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
import configparser | ||
import os | ||
|
||
def load_config(location='config.ini'): | ||
config = {} | ||
config_reader = configparser.ConfigParser() | ||
config_reader.optionxform = str | ||
config_reader.read(location) | ||
|
||
for key, value in config_reader.items("CONFIG"): | ||
if key in os.environ: | ||
config[key] = os.environ[key] | ||
else: | ||
config[key] = value | ||
|
||
return config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.