Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed the problem of m4a audio download bit rate being too low #457

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
.venv
ui/.angular
ui/node_modules
/.idea/*
*.bak
*.dat
*.dir
84 changes: 33 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,47 @@
name: build

on:
push:
branches:
- 'master'
workflow_dispatch:
# push:
# branches:
# - 'master'

jobs:
dockerhub-build-push:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
-
name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
ghcr.io/${{ github.repository }}

- name: Build and push Docker images
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_REPOSITORY }}:latest
${{ secrets.DOCKERHUB_REPOSITORY }}:${{ steps.date.outputs.date }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.date.outputs.date }}

dockerhub-sync-readme:
needs: dockerhub-build-push
runs-on: ubuntu-latest
steps:
- name: Sync README
uses: docker://lsiodev/readme-sync:latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
GIT_REPOSITORY: ${{ github.repository }}
DOCKER_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
GIT_BRANCH: master
with:
entrypoint: node
args: /opt/docker-readme-sync/sync
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
5 changes: 3 additions & 2 deletions .github/workflows/update-yt-dlp.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: update-yt-dlp

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *'

jobs:
update-yt-dlp :
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ Thumbs.db

__pycache__
.venv
/.idea/*
*.bak
*.dat
*.dir
2 changes: 1 addition & 1 deletion app/dl_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_format(format: str, quality: str) -> str:

if format in AUDIO_FORMATS:
# Audio quality needs to be set post-download, set in opts
return f"bestaudio[ext={format}]/bestaudio/best"
return f"bestaudio/best"

if format in ("mp4", "any"):
if quality == "audio":
Expand Down
18 changes: 10 additions & 8 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env python3
# pylint: disable=no-member,method-hidden

import json
import logging
import os
import pathlib
import sys
from aiohttp import web
import platform

import socketio
import logging
import json
import pathlib
from aiohttp import web

from ytdl import DownloadQueueNotifier, DownloadQueue

Expand Down Expand Up @@ -238,4 +237,7 @@ async def on_prepare(request, response):
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
log.info(f"Listening on {config.HOST}:{config.PORT}")
web.run_app(app, host=config.HOST, port=int(config.PORT), reuse_port=True)
if platform.system() == 'Windows':
web.run_app(app, host=config.HOST, port=int(config.PORT))
else:
web.run_app(app, host=config.HOST, port=int(config.PORT), reuse_port=True)
6 changes: 4 additions & 2 deletions ui/e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
import {describe, it} from 'node:test';
import {AppPage} from './app.po';
// @ts-ignore
import {browser, logging} from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;
Expand Down