Skip to content

Commit

Permalink
Version 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas committed Sep 12, 2020
1 parent ad8b8b6 commit a90a75a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.8-slim AS onetz

LABEL maintainer="[email protected]"

VOLUME /config
VOLUME /newspaper

RUN pip install --no-cache-dir requests beautifulsoup4 fake-useragent workalendar

ADD newspaper.py /

CMD [ "python", "./newspaper.py", "-c", "/config/newspaper.json" ]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Ist ein Wert bei *current_epaper_filename* hinterlegt und *current_epaper_symlin

## Changelog

#### 12.09.2020
- Dockerfile zum Ausführen des Scripts in einem Container
- Kleine Codeoptimierungen

#### 01.02.2020
- Kompatibilität zu Redesign des Onetz E-Paper-Bereichs

Expand Down
6 changes: 3 additions & 3 deletions newspaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


# Interne Konstanten
VERSION = '2.0'
VERSION = '2.1'
LOGIN_URL_PREFIX = 'https://epapersso.onetz.de/auth/authorize'
LOGIN_URL = LOGIN_URL_PREFIX + '?client_id=epaper' # Onetz Login-URL
EPAPER_ARCHIVE_URL = 'https://zeitung.onetz.de/shelfDisplay.act?dateTo=%s&widgetIdStr=1040&region=%s' # Pfad zum Abholen der verfügbaren E-Paper
Expand Down Expand Up @@ -139,7 +139,7 @@ def download(configFile, timestamp, overwrite):
return

# Prüfen, ob PDF schon vorhanden ist
pdfFile = config['pdf_base'] + timestamp + '.pdf'
pdfFile = os.path.join(config['pdf_base'], timestamp + '.pdf')
if not overwrite and os.path.isfile(pdfFile):
print('E-Paper für ' + timestamp + ' wurde bereits heruntergeladen -> Abbruch')
return
Expand Down Expand Up @@ -232,7 +232,7 @@ def tryGetEPaper(href, title, timestamp, edition):
m = A_HREF_PATTERN.match(href)
if m is None:
return None

# Auslesen der JS-Paramter
issueId = m.group(1)
mutation = m.group(2)
Expand Down

0 comments on commit a90a75a

Please sign in to comment.