diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 709dec6..408e9b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: executable: StreamingCommunity_linux_latest separator: ':' - - os: ubuntu-20.04 + - os: ubuntu-22.04 artifact_name: StreamingCommunity_linux_previous executable: StreamingCommunity_linux_previous separator: ':' diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 76d431a..fbf001a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -48,4 +48,46 @@ jobs: - name: Run osPath test run: | - PYTHONPATH=$PYTHONPATH:$(pwd) python -m Test.Util.osPath \ No newline at end of file + PYTHONPATH=$PYTHONPATH:$(pwd) python -m Test.Util.osPath + + test-hls-download: + name: Test HLS Download + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Run HLS download test + run: | + PYTHONPATH=$PYTHONPATH:$(pwd) python -m unittest Test.Download.HLS + + test-mp4-download: + name: Test MP4 Download + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Run MP4 download test + run: | + PYTHONPATH=$PYTHONPATH:$(pwd) python -m unittest Test.Download.MP4 \ No newline at end of file diff --git a/Test/Download/HLS.py b/Test/Download/HLS.py index ec35166..e5629fc 100644 --- a/Test/Download/HLS.py +++ b/Test/Download/HLS.py @@ -1,5 +1,7 @@ # 23.06.24 +import unittest + # Fix import import sys import os @@ -16,10 +18,31 @@ from StreamingCommunity.Util.logger import Logger from StreamingCommunity.Lib.Downloader import HLS_Downloader -# Test -start_message() +"""start_message() logger = Logger() -print("Return: ", HLS_Downloader( - output_path="test.mp4", +result = HLS_Downloader( + output_path=".\\Video\\test.mp4", m3u8_url="https://acdn.ak-stream-videoplatform.sky.it/hls/2024/11/21/968275/master.m3u8" -).start()) \ No newline at end of file +).start() + +thereIsError = result['error'] is not None +print(thereIsError)""" + + +class TestHLSDownloader(unittest.TestCase): + def setUp(self): + os_summary.get_system_summary() + start_message() + self.logger = Logger() + + def test_hls_download(self): + result = HLS_Downloader( + output_path=".\\Video\\test.mp4", + m3u8_url="https://acdn.ak-stream-videoplatform.sky.it/hls/2024/11/21/968275/master.m3u8" + ).start() + + thereIsError = result['error'] is not None + self.assertFalse(thereIsError, "HLS download resulted in an error") + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/Test/Download/MP4.py b/Test/Download/MP4.py index f2bc65c..3cf437c 100644 --- a/Test/Download/MP4.py +++ b/Test/Download/MP4.py @@ -1,5 +1,7 @@ # 23.06.24 +import unittest + # Fix import import sys import os @@ -16,10 +18,30 @@ from StreamingCommunity.Util.logger import Logger from StreamingCommunity.Lib.Downloader import MP4_downloader -# Test -start_message() +"""start_message() logger = Logger() -print("Return: ", MP4_downloader( +path, kill_handler = MP4_downloader( url="https://148-251-75-109.top/Getintopc.com/IDA_Pro_2020.mp4", - path=r".\Video\undefined.mp4" -)) + path=r".\\Video\\undefined.mp4" +) + +thereIsError = path is None +print(thereIsError)""" + +class TestMP4Downloader(unittest.TestCase): + def setUp(self): + os_summary.get_system_summary() + start_message() + self.logger = Logger() + + def test_mp4_download(self): + path, kill_handler = MP4_downloader( + url="https://148-251-75-109.top/Getintopc.com/IDA_Pro_2020.mp4", + path=r".\\Video\\undefined.mp4" + ) + + thereIsError = path is None + self.assertFalse(thereIsError, "MP4 download resulted in an error") + +if __name__ == '__main__': + unittest.main() \ No newline at end of file