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

Initial release #1

Merged
merged 28 commits into from
Apr 7, 2024
Merged
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
46 changes: 46 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build & Test

on:
push:
branches:
- '*'

jobs:
build_and_test:
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel

- name: Install Pytest
run: |
pip install pytest

- name: Build Package
run: |
python setup.py sdist

- name: Get Package File Name
run: |
$latestFile = Get-ChildItem -Path 'dist\' | Sort-Object LastWriteTime -Descending | Select-Object -First 1
echo "Latest file: $latestFile"
echo "PACKAGE_NAME=$latestFile" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Install Package
run: |
pip install ${{ env.PACKAGE_NAME }}

- name: Run Tests
run: |
pytest tests -vv -rEPW -o pytest_collection_order=alphabetical --cache-clear --color=yes
137 changes: 137 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Release

on:
release:
types: [ published ]
branches:
- '*'

jobs:
release_windows:
permissions: write-all
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller

- name: Build Installer
run: |
pyinstaller --onefile --windowed --name M3U8Downloader-${{ github.event.release.tag_name }}-Windows.exe ./src/__init__.py

- name: Upload Installer
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/M3U8Downloader-${{ github.event.release.tag_name }}-Windows.exe
asset_name: M3U8Downloader-${{ github.event.release.tag_name }}-Windows.exe
asset_content_type: application/octet-stream

- name: Publish Release
if: ${{ steps.upload-release-asset.outcome == 'success' }}
run: |
$json = @{
draft = $false
} | ConvertTo-Json
$header = @{
Authorization = "Bearer ${{ secrets.GITHUB_TOKEN }}"
Accept = "application/vnd.github.v3+json"
}
Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}" -Method Patch -ContentType "application/json" -Headers $header -Body $json

release_ubuntu:
permissions: write-all
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller

- name: Build Installer
run: |
pyinstaller --onefile --windowed --name M3U8Downloader-${{ github.event.release.tag_name }}-debian.deb ./src/__init__.py

- name: Upload Installer
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/M3U8Downloader-${{ github.event.release.tag_name }}-debian.deb
asset_name: M3U8Downloader-${{ github.event.release.tag_name }}-debian.deb
asset_content_type: application/octet-stream

- name: Publish Release
if: ${{ steps.upload-release-asset.outcome == 'success' }}
run: |
curl -X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"draft": false}' \
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"

release_rhel:
permissions: write-all
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller

- name: Build Installer
run: |
pyinstaller --onefile --windowed --name M3U8Downloader-${{ github.event.release.tag_name }}-linux.rpm ./src/__init__.py

- name: Upload Installer
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/M3U8Downloader-${{ github.event.release.tag_name }}-linux.rpm
asset_name: M3U8Downloader-${{ github.event.release.tag_name }}-linux.rpm
asset_content_type: application/octet-stream

- name: Publish Release
if: ${{ steps.upload-release-asset.outcome == 'success' }}
run: |
curl -X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"draft": false}' \
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Version History

- 0.1.0: Initial Release (latest)
64 changes: 62 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,62 @@
# pym3u8downloaderui
M3U8 Downloader UI is a Python UI designed to download and concatenate video files using pym3u8downloader package.
# M3U8 Downloader

M3U8 Downloader UI is a Python-based graphical user interface (GUI) application designed to simplify the process of downloading and concatenating video files using the [pym3u8downloader](https://github.com/coldsofttech/pym3u8downloader) package.
This application streamlines the task of downloading and merging video files from M3U8 playlists.

## Supported Operating Systems
The M3U8 Downloader UI is compatible with the following operating systems:
- **Windows**: Executable files (.exe) are provided for seamless integration and usage on Windows platforms.
- **RHEL (Red Hat Enterprise Linux) and SUSE**: RPM packages (.rpm) are available for convenient installation on these distributions.
- **Ubuntu**: Debian packages (.deb) are provided for easy installation and integration with Ubuntu systems.

Please note that at this time, the application exclusively supports the aforementioned operating systems.

## Packages
For the latest release and executable packages for various operating systems, please refer to the `Releases` section.

# Guide
Refer below for comprehensive instructions on how to use the application and common troubleshooting scenarios.

**Important Notes:**
- Internet connectivity is required for various operations such as startup and downloading video files from M3U8 playlists.
- Ensure your system has at least twice the size of the video file available for download and output video preparation. The required space depends on the size of the video file specified in the input .m3u8 playlist. The application checks for available space and warns if it's insufficient.
- Exiting the application during a download is not possible.

**Additional Information:**
- The following steps are demonstrated using the Windows executable. Procedures are similar for other supported operating systems, except for how to launch the application.
- For detailed user guidance, navigate to **Help > Help** within the application (this document).
- Find additional information, including licensing details, under **Help > About**.

**Step 1:** Launch **M3U8 Downloader** UI by either right-clicking and selecting 'Open' or double-clicking the executable.

![img.png](doc_images/doc_image_executable.png)

**Step 2:** Enter the URL of the .m3u8 playlist file you wish to download into the **Input URL (.m3u8)** field.
**Step 3:** Specify the destination folder for the downloaded file by clicking the **...** button.

![img.png](doc_images/doc_image_app_window.png)

**Step 4:** Once both the input URL and output file are specified, click the **Download** button.
**Step 5:** Track the download progress within the application.

![img.png](doc_images/doc_image_download_progress.png)

**Step 6:** Upon successful completion of the download, a confirmation message will be displayed.

![img.png](doc_images/doc_image_download_complete.png)

**Step 8:** To initiate a new download and reset the controls, go to **File > New**. This action resets the controls and allows you to input a new URL and select a new output file.

## General Issues & Resolutions
### Invalid Input URL
![img.png](doc_images/doc_image_invalid_url.png)

The above message appears when the provided input URL is not a valid .m3u8 playlist file. Ensure that the URL ends with the _'.m3u8'_ file format.

### Download In Progress
![img.png](doc_images/doc_image_download_in_progress_warning.png)

This warning appears when attempting to exit the application while a download is in progress. You cannot exit the application during an ongoing download.

# Limitations
For more information, refer to the limitations of [pym3u8downloader](https://github.com/coldsofttech/pym3u8downloader/blob/main/README.md).
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Release Information

This document outlines the step-by-step process for releasing a new version of the application.
It provides detailed instructions on leveraging the provided release workflow to generate executables for various supported operating systems and publish them as release assets.

## Prerequisites
Before initiating the release process, ensure the following prerequisites are met:
- Access to the repository containing the application code.
- Familiarity with Git and GitHub workflows.
- Understanding of how to generate release notes.
- The 'pipeline.yml' for build and test should successfully pass for the pull request associated with the release.

## Release Workflow Overview
The release process is automated through the provided **release.yml** file, which orchestrates the following actions:
- **Trigger**: The release workflow is automatically triggered whenever a new release is published.
- **Build**: Upon triggering, the workflow initiates the build process using **Pyinstaller** to generate executables tailored to each supported operating system.
- **Upload**: Once the builds are successfully generated, the workflow uploads the executables as release assets.
- **Publish**: Finally, the release assets are published, making the new version of the application available to users.
26 changes: 26 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
def pytest_collection_modifyitems(config, items):
"""
Custom pytest hook to modify the collection of test items.
This function sorts test items to execute specific tests first.
"""

def test_order(test_name):
# Define the desired order of execution for specific test names
order_mapping = {
'test_write': 1,
'test_write_multiple': 2,
'test__load_config_no_file': 3,
'test__load_config_skip_space_check': 4,
'test__load_config_debug': 5,
'test__load_config_invalid': 6,
'test__select_output_button_callback': 7,
'test__new_callback': 8,
'test__exit_callback_download_thread_running': 9,
'test__exit_callback_download_thread_not_running': 10,
'test__help_callback': 11,
'test_disable_controls': 12,
'test_enable_controls': 13
}
return order_mapping.get(test_name, float('inf')) # Default to infinity for tests not in the mapping

items.sort(key=lambda item: (test_order(item.nodeid.split("::")[-1]), item.fspath, item.originalname))
Binary file added doc_images/doc_image_app_window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc_images/doc_image_download_complete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc_images/doc_image_download_progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc_images/doc_image_executable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc_images/doc_image_invalid_url.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
markers =
sequential_order

addopts = -o pytest_collection_order=alphabetical
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pym3u8downloader@ git+https://github.com/coldsofttech/pym3u8downloader.git
pytest~=7.4.0
setuptools~=69.2.0
requests~=2.31.0
22 changes: 22 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from setuptools import setup

from src import Constants

setup(
name='pym3u8downloaderui',
version=Constants.APP_VERSION,
package_dir={'': 'src'},
url='https://github.com/coldsofttech/pym3u8downloaderui',
license='MIT',
author='coldsofttech',
description='',
entry_points={
'console_scripts': [
'pym3u8downloaderui = src.__init__:main'
]
},
install_requires=[
'requests',
'pym3u8downloader@ git+https://github.com/coldsofttech/pym3u8downloader.git'
]
)
Binary file added src/Resources/Images/icon.ico
Binary file not shown.
Binary file added src/Resources/Images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading