Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/run_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if [ -f test/requirements.txt ]; then pip install -r test/requirements.txt; fi
- name: Check Syntax with flake8
run: |
flake8 --extend-ignore=E501 pyxtream/pyxtream.py pyxtream/rest_api.py pyxtream/schemaValidator.py pyxtream/version.py pyxtream/progress.py
flake8 --extend-ignore=E501 pyxtream/pyxtream.py pyxtream/rest_api.py pyxtream/schemaValidator.py pyxtream/version.py pyxtream/api.py
- name: Test with pytest
run: |
python3 -m pytest --cov=pyxtream test/test_pyxtream.py
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Follows the Semantic Versioning from https://semver.org/

| Date | Version | Description |
| ----------- | -----| ----------- |
| 2026-04-03 | 0.8.0 | - Added more PyTest functions<br>- Refactored index.html to better show cards<br>- Refactored pyxtream.py with types<br> - Removed cli progress bar<br>- Fixed issue with loading series [max298](https://github.com/max298)<br> - Fixed empty logo issue [max298](https://github.com/max298)
| 2025-02-17 | 0.7.3 | - Added Initial PyTest and Coverage<br>- Added timestamp field "added" to Series to match channels "added" field<br>- Added string field "url" to Series to quickly get the series download address<br>- Added new API "get_last_7days()" returns the last added streams in the last 7 days in JSON format<br>- Added new API "get_download_progress()" returns information on the current download stream in JSON format<br>- Changed internal function _load_series_info_by_id_from_provider to allow returned value to change to JSON<br>- Changed search_stream function to only search in specific collections<br>- Refactored "rest_api.py" to make it easier to extend in the future<br>- Added new rest API<br>- Changed to Poetry environment<br>- Changed Functional Test to test loading series information<br>- Changed sample index.html to test more features|
| 2024-09-02 | 0.7.2 | - Added missing request package to setup.py<br>- Refactored the search stream function and now, it can search for a specific stream type<br>- Refactored the download stream function<br>- Refactored the _get_request function and removed the call to the sleep function<br>- Added functional test to get series json output from a series_id<br>- Added functional test to get EPG for a specific stream ID<br>- Added xtream account expiration date printed on the console during authentication<br>- Improved results with the Flask HTML page and differentiating between movies and series<br>- Improved code readability|
| 2024-05-21 | 0.7.1 | - Fixed missing jsonschema package<br>- Fixed provider name in functional_test<br>- Improved print out of connection attempts<br>- Added method to read latest changes in functional_test
Expand Down
4 changes: 3 additions & 1 deletion functional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ def str2list(input_string: str) -> list:
PROVIDER_PASSWORD,
PROVIDER_URL,
reload_time_sec=60*60*8,
validate_json=False,
debug_flask=True,
enable_flask=True
enable_flask=True,
flask_port=5000
)

sleep(0.5)
Expand Down
3 changes: 1 addition & 2 deletions pyxtream/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from .progress import progress
from .pyxtream import XTream, Channel, Group, Serie, Episode
from .pyxtream import Channel, Episode, Group, Season, Serie, XTream

try:
from .rest_api import FlaskWrap
Expand Down
63 changes: 63 additions & 0 deletions pyxtream/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"""
API URL builders
"""


def get_live_categories_URL(base: str) -> str:
return f"{base}&action=get_live_categories"


def get_live_streams_URL(base: str) -> str:
return f"{base}&action=get_live_streams"


def get_live_streams_URL_by_category(category_id, base: str) -> str:
return f"{base}&action=get_live_streams&category_id={category_id}"


def get_vod_cat_URL(base: str) -> str:
return f"{base}&action=get_vod_categories"


def get_vod_streams_URL(base: str) -> str:
return f"{base}&action=get_vod_streams"


def get_vod_streams_URL_by_category(category_id, base: str) -> str:
return f"{base}&action=get_vod_streams&category_id={category_id}"


def get_series_cat_URL(base: str) -> str:
return f"{base}&action=get_series_categories"


def get_series_URL(base: str) -> str:
return f"{base}&action=get_series"


def get_series_URL_by_category(category_id, base: str) -> str:
return f"{base}&action=get_series&category_id={category_id}"


def get_series_info_URL_by_ID(series_id, base: str) -> str:
return f"{base}&action=get_series_info&series_id={series_id}"


def get_VOD_info_URL_by_ID(vod_id, base: str) -> str:
return f"{base}&action=get_vod_info&vod_id={vod_id}"


def get_live_epg_URL_by_stream(stream_id, base: str) -> str:
return f"{base}&action=get_short_epg&stream_id={stream_id}"


def get_live_epg_URL_by_stream_and_limit(stream_id, limit, base: str) -> str:
return f"{base}&action=get_short_epg&stream_id={stream_id}&limit={limit}"


def get_all_live_epg_URL_by_stream(stream_id, base: str) -> str:
return f"{base}&action=get_simple_data_table&stream_id={stream_id}"


def get_all_epg_URL(base: str, username: str, password: str) -> str:
return f"{base}/xmltv.php?username={username}&password={password}"
Loading
Loading