Skip to content

Commit

Permalink
feat: add emby metadata downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Apr 27, 2024
1 parent b0203d6 commit 703f630
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build_emby_metadata_downloader.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: emby metadata downloader

on:
workflow_dispatch:
push:
branches:
- master
paths:
- "emby_metadata_downloader/**"
- ".github/workflows/build_emby_metadata_downloader.yml"

jobs:
build:
runs-on: ubuntu-latest
name: Build Docker Image
steps:
-
name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_USERNAME }}/xiaoya-emd
tags: |
type=raw,value=latest
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v3

-
name: Set Up Buildx
uses: docker/setup-buildx-action@v3

-
name: Login DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

-
name: Build Image
uses: docker/build-push-action@v5
with:
context: ./emby_metadata_downloader
file: emby_metadata_downloader/Dockerfile
platforms: |
linux/amd64
linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

-
name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ secrets.DOCKER_USERNAME }}/xiaoya-emd
short-description: 小雅Alist的相关周边
readme-filepath: ./emby_metadata_downloader/README.md
19 changes: 19 additions & 0 deletions emby_metadata_downloader/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.12-alpine3.19

ENV TZ=Asia/Shanghai \
CYCLE=86400

RUN set -ex && \
apk add --no-cache \
bash \
git \
tzdata && \
git clone -b main https://github.com/Rik-F5/xiaoya_db.git /app && \
python3 -m pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /app/requirements.txt

COPY --chmod=755 entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]

CMD --media /media --db true
15 changes: 15 additions & 0 deletions emby_metadata_downloader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 小雅同步元数据

高速异步爬虫从 https://emby.xiaoya.pro/ 同步小雅元数据

## Run

```shell
docker run -d \
--name=xiaoya-emd \
--restart=always \
--net=host \
-v 媒体库目录:/media \
-e CYCLE=86400 \
ddsderek/xiaoya-emd:latest
```
10 changes: 10 additions & 0 deletions emby_metadata_downloader/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# shellcheck shell=bash
# shellcheck disable=SC2068

cd /app || exit

while true; do
python3 solid.py $@
sleep "${CYCLE}"
done

0 comments on commit 703f630

Please sign in to comment.