-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
162 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:3.10-slim | ||
|
||
WORKDIR /home | ||
|
||
ENV PYTHONPATH=. | ||
|
||
COPY requirements.txt /home/requirements.txt | ||
COPY youtube_downloader /home/youtube_downloader | ||
RUN pip3 install -r /home/requirements.txt | ||
|
||
EXPOSE 7860 | ||
ENV GRADIO_SERVER_NAME="0.0.0.0" | ||
|
||
CMD ["gradio", "/home/youtube_downloader/app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
services: | ||
youtube_downloader: | ||
build: | ||
context: . | ||
image: youtube_downloader | ||
container_name: youtube_downloader | ||
ports: | ||
- 7860:7860 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
pytube | ||
moviepy # make sure ffmpeg is installed on your machine! | ||
streamlit | ||
yt-dlp | ||
gradio==4.38.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import subprocess | ||
import pytest | ||
import time | ||
from tests import APP_FILE | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def start_app(): | ||
cmd = f"python {APP_FILE}" | ||
process = subprocess.Popen( | ||
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE | ||
) | ||
time.sleep(5) | ||
yield process | ||
process.terminate() | ||
process.wait() | ||
|
||
|
||
def test_streamlit(subtests, start_app): | ||
with subtests.test(msg="server up"): | ||
assert start_app.poll() is None, "app failed to start" | ||
|
||
with subtests.test(msg="streamlit down"): | ||
start_app.terminate() | ||
time.sleep(2) | ||
assert start_app.poll() is not None, "app failed to stop" | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.