diff --git a/Dockerfile b/Dockerfile index cb66ce0..0946968 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,16 @@ -FROM python:3-alpine +FROM python:3.8-alpine WORKDIR /app COPY requirements.txt ./ -RUN apk update && apk add mkvtoolnix && apk add --no-cache tzdata -RUN pip install --no-cache-dir -r requirements.txt +RUN apk --update-cache add --no-cache tzdata mkvtoolnix +RUN apk --update-cache add --no-cache build-base && pip install -r requirements.txt && apk del build-base ENV TZ Europe/Berlin COPY main.py ./ RUN crontab -l | { cat; echo "15 03 * * * cd /app && python -u /app/main.py"; } | crontab - +RUN crontab -l | { cat; echo "@reboot cd /app && python -u /app/main.py"; } | crontab - VOLUME ["/download"] diff --git a/main.py b/main.py index d95846a..62633f3 100755 --- a/main.py +++ b/main.py @@ -52,9 +52,9 @@ def get_episod_info(season_id, name): def build_filename(name: str, titel_dict: dict): - if titel_dict == {}: + if not titel_dict: return None -q if titel_dict['episod'].isdigit(): + if titel_dict['episod'].isdigit(): filename = '{name} S{season:>02}E{episod:>02} {title}'.format( name=name, **titel_dict) else: @@ -115,6 +115,9 @@ def parse_feed(series_name): titel_dict = groups[0] if season_id is not None: titel_dict = get_episod_info(season_id, titel_dict['title']) + if not titel_dict: + logging.warning('skip %s', title) + continue filename = build_filename(series_name, titel_dict) if filename not in episodes: episodes[filename] = dict() diff --git a/requirements.txt b/requirements.txt index 97758a0..dec8c3d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ feedparser==5.2.1 requests==2.24.0 pymkv==1.0.5 fuzzywuzzy==0.18.0 +python-Levenshtein==0.12.0 tvdbsimple==1.0.6 diff --git a/seasons.ini b/seasons.ini index ea0503f..14629e6 100644 --- a/seasons.ini +++ b/seasons.ini @@ -13,7 +13,6 @@ languages = ger ger = ^(?P