Added Version

This commit is contained in:
ArabCoders 2023-12-01 00:36:52 +03:00
parent 12130b33d9
commit 8832231284
6 changed files with 64 additions and 12 deletions

View file

@ -14,16 +14,16 @@ on:
- debug - debug
push: push:
branches: branches:
- '*' - "*"
paths-ignore: paths-ignore:
- '**.md' - "**.md"
- '.github/**' - ".github/**"
pull_request: pull_request:
branches: branches:
- 'master' - "master"
paths-ignore: paths-ignore:
- '**.md' - "**.md"
- '.github/ISSUE_TEMPLATE/**' - ".github/ISSUE_TEMPLATE/**"
env: env:
PLATFORMS: linux/amd64 PLATFORMS: linux/amd64
@ -36,10 +36,19 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Update Version File
uses: ArabCoders/write-version-to-file@master
with:
filename: "/src/version.py"
placeholder: "dev-master"
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Docker meta - name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
@ -52,6 +61,7 @@ jobs:
type=raw,value={{branch}}{{base_ref}}-{{date 'YYYYMMDD'}}-{{sha}} type=raw,value={{branch}}{{base_ref}}-{{date 'YYYYMMDD'}}-{{sha}}
flavor: | flavor: |
latest=false latest=false
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
@ -69,3 +79,9 @@ jobs:
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }} cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }} cache-to: type=gha, scope=${{ github.workflow }}
- uses: actions/delete-package-versions@v4
with:
package-name: "ytptube"
package-type: "container"
min-versions-to-keep: 5

View file

@ -4,7 +4,29 @@
Web GUI for [yt-dlp](https://github.com/yt-dlp/yt-dlp) with playlist & channel support. Allows you to download videos from YouTube and [dozens of other sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md). Web GUI for [yt-dlp](https://github.com/yt-dlp/yt-dlp) with playlist & channel support. Allows you to download videos from YouTube and [dozens of other sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).
YTPTube is a fork of [meTube](https://github.com/alexta69/metube) project by alexta69. YTPTube started as a fork of [meTube](https://github.com/alexta69/metube) project by alexta69. Since then it went under heavy changes, and it supports many new features.
# YTPTube Features compared to meTube.
* A built in video player that can play any video file regardless of the format.
* New `/add_batch` endpoint that allow multiple links to be sent.
* Re-Imagined the frontend and re-wrote the code in VueJS.
* Switched out of binary file storage in favor of SQLite.
* Handle live streams.
### Tips
Your `yt-dlp` config should include the following options for optimal working conditions.
```json
{
"windowsfilenames": true,
"continue_dl": true,
"live_from_start": true,
"format_sort": [
"codec:avc:m4a"
]
}
```
* Note, the `format_sort`, forces YouTube to use x264 instead of vp9 codec, you can ignore it if you want. i prefer the media in x264.
[![Short screenshot](/sc_short.png)](/sc_full.png) [![Short screenshot](/sc_short.png)](/sc_full.png)

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import asyncio
import os import os
from src.Config import Config from src.Config import Config
from version import APP_VERSION
from src.Notifier import Notifier from src.Notifier import Notifier
from src.DownloadQueue import DownloadQueue from src.DownloadQueue import DownloadQueue
from src.Utils import ObjectSerializer from src.Utils import ObjectSerializer
@ -27,6 +27,7 @@ class Main:
def __init__(self): def __init__(self):
self.config = Config() self.config = Config()
self.config.version = APP_VERSION
try: try:
if not os.path.exists(self.config.download_path): if not os.path.exists(self.config.download_path):
@ -92,7 +93,8 @@ class Main:
self.app, self.app,
host=self.config.host, host=self.config.host,
port=self.config.port, port=self.config.port,
reuse_port=True reuse_port=True,
print=lambda _: print(f'YTPTube v{self.config.version} - listening on http://{self.config.host}:{self.config.port}')
) )
async def connect(self, sid, environ): async def connect(self, sid, environ):
@ -214,7 +216,8 @@ class Main:
segmenter = Segments( segmenter = Segments(
config=self.config, config=self.config,
segment_index=int(segment), segment_index=int(segment),
segment_duration=float('{:.6f}'.format(float(sd if sd else M3u8.segment_duration))), segment_duration=float('{:.6f}'.format(
float(sd if sd else M3u8.segment_duration))),
vconvert=True if vc == 1 else False, vconvert=True if vc == 1 else False,
aconvert=True if ac == 1 else False aconvert=True if ac == 1 else False
) )

1
app/version.py Normal file
View file

@ -0,0 +1 @@
APP_VERSION = "dev-master"

View file

@ -13,7 +13,7 @@
</div> </div>
<button class="modal-close is-large" aria-label="close" @click="video_link = ''"></button> <button class="modal-close is-large" aria-label="close" @click="video_link = ''"></button>
</div> </div>
<PageFooter /> <PageFooter :app_version="config?.app?.version" />
</template> </template>
<script setup> <script setup>

View file

@ -1,7 +1,7 @@
<template> <template>
<div class="columns is-multiline mt-3"> <div class="columns is-multiline mt-3">
<div class="column has-text-left"> <div class="column has-text-left">
{{Year}} © YTPtube {{ Year }} © YTPtube - {{ app_version }}
</div> </div>
<div class="column has-text-right"> <div class="column has-text-right">
<a href="https://github.com/ArabCoders/ytptube" target="_blank"> <a href="https://github.com/ArabCoders/ytptube" target="_blank">
@ -12,5 +12,15 @@
</template> </template>
<script setup> <script setup>
import { defineProps } from 'vue'
const Year = new Date().getFullYear() const Year = new Date().getFullYear()
defineProps({
app_version: {
type: String,
required: true,
},
})
</script> </script>