Merge branch 'main' into 3.0-dev

# Conflicts:
#	.github/workflows/release.yml
#	src/module/manager/renamer.py
This commit is contained in:
EstrellaXD
2023-05-19 12:08:40 +08:00
4 changed files with 49 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
name: Deploy To Dockerhub(dev)
name: Build Docker(dev)
on:
push:
@@ -37,20 +37,27 @@ jobs:
working-directory: ./src
run: |
echo "VERSION = '$GITHUB_REF_NAME'" > module/__version__.py
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Build and push
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GITHUB_USERNAME }}
password: ${{ secrets.ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
@@ -58,6 +65,8 @@ jobs:
tags: |
estrellaxd/auto_bangumi:dev-latest
estrellaxd/auto_bangumi:${{ github.ref_name }}
ghcr.io/estrellaxd/auto_bangumi:dev-latest
ghcr.io/estrellaxd/auto_bangumi:${{ github.ref_name }}
file: Dockerfile
generate_release:

View File

@@ -1,4 +1,4 @@
name: Build(Docker)
name: Build Docker
on:
pull_request:
@@ -62,6 +62,14 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Login to ghcr.io
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
@@ -69,7 +77,9 @@ jobs:
builder: ${{ steps.buildx.output.name }}
platforms: linux/amd64,linux/arm64,linux/arm
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
tags: |
docker.io/estrellaxd/auto_bangumi:${{ steps.meta.outputs.tags }}
ghcr.io/estrellaxd/auto_bangumi:${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}

View File

@@ -10,9 +10,9 @@ on:
jobs:
generate_release_draft:
runs-on: ubuntu-latest
if:
- github.event.pull_request.merged == true
- github.event.pull_request.base.ref == 'main'
if: >
github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'main'
steps:
- name: Checkout code
uses: actions/checkout@v2

View File

@@ -0,0 +1,15 @@
from module.network import RequestContent
from module.conf import settings
class RSSSearcher(RequestContent):
def __search_url(self, keywords: str) -> str:
keywords.replace(" ", "+")
url = f"{settings.rss_parser.custom_url}/RSS/Search?keyword={keywords}"
return url
def search_keywords(self, keywords: str) -> list[dict]:
url = self.__search_url(keywords)
torrents = self.get_torrents(url)
return torrents