Compare commits

...

10 Commits

Author SHA1 Message Date
21f1da5cce Merge pull request 'Update python Docker tag to v3.13.6' (#3) from renovate/python-3.x into master
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 18s
Build and Push Docker Image / deploy-on-green (push) Successful in 9s
Reviewed-on: #3
2025-08-08 07:50:28 +00:00
2cb60ef696 Update python Docker tag to v3.13.6 2025-08-07 19:00:41 +00:00
c0a9422fbd exclude all untested formats
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 2m15s
Build and Push Docker Image / deploy-on-green (push) Successful in 10s
2025-08-02 15:43:53 -04:00
dbcc948239 Merge pull request 'Update dependency yt-dlp to v2025.7.21' (#2) from renovate/yt-dlp-2025.x into master
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 3m31s
Build and Push Docker Image / deploy-on-green (push) Successful in 7s
Reviewed-on: #2
2025-07-22 00:13:58 +00:00
a4a6941453 Update dependency yt-dlp to v2025.7.21 2025-07-22 00:00:40 +00:00
bffe801da5 correct workflow
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 19s
Build and Push Docker Image / deploy-on-green (push) Successful in 8s
2025-07-16 23:10:05 -04:00
82304688b8 implement deploy on green
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 19s
Build and Push Docker Image / deploy-on-green (push) Successful in 8s
2025-07-16 23:00:35 -04:00
3ffb2e4640 add error reporting to download process
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 2m53s
2025-07-12 16:51:39 -04:00
4986ab5e8d Merge pull request 'Configure Renovate' (#1) from renovate/configure into master
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 24s
Reviewed-on: #1
2025-07-12 12:12:39 +00:00
f5edccae1a Add renovate.json 2025-07-12 03:00:30 +00:00
6 changed files with 57 additions and 9 deletions

View File

@@ -9,6 +9,8 @@ jobs:
build-and-push:
runs-on: ubuntu-latest # Use a runner with Docker support
container: ghcr.io/catthehacker/ubuntu:act-latest # Image with Docker pre-installed
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
steps:
# Checkout the repository code
- name: Checkout repository
@@ -32,7 +34,7 @@ jobs:
with:
registry: git.dubyatp.xyz
username: williamp
password: ${{ secrets.REGISTRY_TOKEN }} # Personal Access Token for authentication
password: ${{ secrets.ACTIONS_TOKEN }} # Personal Access Token for authentication
# Build and push the Docker image
- name: Build and Push Docker Image
@@ -45,4 +47,34 @@ jobs:
tags: |
git.dubyatp.xyz/williamp/yt-dlp-bot:latest
git.dubyatp.xyz/williamp/yt-dlp-bot:${{steps.vars.outputs.sha_short }}
# Tags the image with 'latest' and the commit SHA
# Tags the image with 'latest' and the commit SHA
deploy-on-green:
needs: build-and-push
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Checkout target repository
uses: actions/checkout@v4
with:
repository: infrastructure/core-apps
token: ${{ secrets.ACTIONS_TOKEN }}
ref: main
- name: Update image tag in deployment.yaml
uses: mikefarah/yq@master
with:
cmd: yq eval '.spec.template.spec.containers[0].image = "git.dubyatp.xyz/williamp/yt-dlp-bot:${{ needs.build-and-push.outputs.sha_short }}"' -i yt-dlp-bot/deployment.yaml
- name: Commit changes
run: |
git config --local user.email "actions@noreply.dubyatp.xyz"
git config --local user.name "actions[bot]"
git commit -a -m "yt-dlp-bot: deploy update to ${{ needs.build-and-push.outputs.sha_short }}"
- name: Push changes
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ secrets.ACTIONS_TOKEN }}
repository: infrastructure/core-apps
branch: main

View File

@@ -1,4 +1,4 @@
FROM python:3.13.5-alpine3.22
FROM python:3.13.6-alpine3.22
COPY ./app /app
WORKDIR /app
RUN apk add ffmpeg

View File

@@ -126,16 +126,29 @@ class DownloadVideo(ui.View):
worker_task = asyncio.create_task(progress_worker(msg))
error = None
async def progress_callback(percent):
await progress_queue.put(percent)
await asyncio.to_thread(
ytdlp.download_video, self.url, format_string, out_path, temp_path, progress_callback, asyncio.get_event_loop()
)
loop = asyncio.get_running_loop()
def threaded_download():
nonlocal error
try:
ytdlp.download_video(
self.url, format_string, out_path, temp_path, progress_callback, loop
)
except Exception as e:
error = e
await asyncio.to_thread(threaded_download)
stop_event.set()
await worker_task
if error:
await msg.edit(content=f"❌ Download failed: {error}")
return
# Show completion and summary
await msg.edit(content="✅ Download complete!\n"
)

View File

@@ -1,3 +1,3 @@
discord.py==2.5.2
python-dotenv==1.1.1
yt-dlp==2025.6.30
yt-dlp==2025.7.21

View File

@@ -10,7 +10,7 @@ def get_formats(url: str):
for fmt in info['formats']:
# Video-only
if fmt.get('vcodec') != 'none' and fmt.get('acodec') == 'none':
if fmt.get('vcodec') != 'none' and fmt.get('acodec') == 'none' and fmt.get('__needs_testing') == None:
video_options.append({
'height': fmt.get('height'),
'resolution': fmt.get('resolution'),
@@ -19,7 +19,7 @@ def get_formats(url: str):
'tbr': fmt.get('tbr'),
})
# Audio-only
elif fmt.get('acodec') != 'none' and fmt.get('vcodec') == 'none':
elif fmt.get('acodec') != 'none' and fmt.get('vcodec') == 'none' and fmt.get('__needs_testing') == None:
audio_options.append({
'format': fmt.get('format'),
'format_id': fmt.get('format_id'),

3
renovate.json Normal file
View File

@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}