├── run_tests.sh ├── pyxtream ├── version.py ├── __init__.py ├── progress.py ├── rest_api.py ├── schemaValidator.py └── html │ └── index.html ├── docs ├── index.html ├── pyxtream │ ├── version.html │ └── progress.html └── pyxtream.html ├── .gitignore ├── test ├── requirements.txt └── test_pyxtream.py ├── pyproject.toml ├── PYPI.md ├── .github └── workflows │ └── run_pytest.yml ├── functional_test.py ├── README.md └── LICENSE /run_tests.sh: -------------------------------------------------------------------------------- 1 | poetry run pytest --cov=pyxtream test/test_pyxtream.py -------------------------------------------------------------------------------- /pyxtream/version.py: -------------------------------------------------------------------------------- 1 | 2 | __version__ = '0.7.3' 3 | __author__ = 'Claudio Olmi' 4 | __author_email__ = 'superolmo2@gmail.com' 5 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pyxtream/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from .progress import progress 3 | from .pyxtream import XTream, Channel, Group, Serie, Episode 4 | 5 | try: 6 | from .rest_api import FlaskWrap 7 | USE_FLASK = True 8 | except ImportError: 9 | USE_FLASK = False 10 | from .version import __author__, __author_email__, __version__ 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | 3 | # Packages 4 | /dist/* 5 | 6 | # Unit test / coverage reports 7 | .coverage 8 | .pytest_cache 9 | 10 | .DS_Store 11 | .idea/* 12 | .python-version 13 | .vscode/* 14 | 15 | /docs/site/* 16 | .mypy_cache 17 | 18 | .venv 19 | /poetry.toml 20 | 21 | # Distribution / packaging 22 | build/ 23 | dist/ 24 | *.egg-info/ 25 | tmp/ -------------------------------------------------------------------------------- /test/requirements.txt: -------------------------------------------------------------------------------- 1 | attrs==25.1.0 ; python_version >= "3.9" 2 | certifi==2025.1.31 ; python_version >= "3.9" 3 | charset-normalizer==3.4.1 ; python_version >= "3.9" 4 | idna==3.10 ; python_version >= "3.9" 5 | jsonschema-specifications==2024.10.1 ; python_version >= "3.9" 6 | jsonschema==4.23.0 ; python_version >= "3.9" 7 | referencing==0.36.2 ; python_version >= "3.9" 8 | requests==2.32.3 ; python_version >= "3.9" 9 | rpds-py==0.22.3 ; python_version >= "3.9" 10 | typing-extensions==4.12.2 ; python_version < "3.13" and python_version >= "3.9" 11 | urllib3==2.3.0 ; python_version >= "3.9" 12 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "pyxtream" 3 | version = "0.7.3" 4 | requires-python = ">=3.9" 5 | description = "xtream IPTV loader" 6 | authors = [{name = "Claudio Olmi", email = "1from .progress import progress 54 | 2from .pyxtream import XTream, Channel, Group, Serie, Episode 55 | 3 56 | 4try: 57 | 5 from .rest_api import FlaskWrap 58 | 6 USE_FLASK = True 59 | 7except ImportError: 60 | 8 USE_FLASK = False 61 | 9from .version import __author__, __author_email__, __version__ 62 |
1# The MIT License (MIT) 58 | 2# Copyright (c) 2016 Vladimir Ignatev 59 | 3# 60 | 4# Permission is hereby granted, free of charge, to any person obtaining 61 | 5# a copy of this software and associated documentation files (the "Software"), 62 | 6# to deal in the Software without restriction, including without limitation 63 | 7# the rights to use, copy, modify, merge, publish, distribute, sublicense, 64 | 8# and/or sell copies of the Software, and to permit persons to whom the Software 65 | 9# is furnished to do so, subject to the following conditions: 66 | 10# 67 | 11# The above copyright notice and this permission notice shall be included 68 | 12# in all copies or substantial portions of the Software. 69 | 13# 70 | 14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 71 | 15# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 72 | 16# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 73 | 17# FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 74 | 18# OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 75 | 19# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 76 | 20import sys 77 | 21 78 | 22 79 | 23def progress(count, total, status=''): 80 | 24 bar_len = 60 81 | 25 filled_len = int(round(bar_len * count / float(total))) 82 | 26 83 | 27 percents = round(100.0 * count / float(total), 1) 84 | 28 bar_filled = '=' * filled_len + '-' * (bar_len - filled_len) 85 | 29 86 | 30 sys.stdout.write(f'[{bar_filled}] {percents}% ...{status}\r') 87 | 31 sys.stdout.flush() # As suggested by Rom Ruben (see: http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console/27871113#comment50529068_27871113) 88 |
24def progress(count, total, status=''): 104 | 25 bar_len = 60 105 | 26 filled_len = int(round(bar_len * count / float(total))) 106 | 27 107 | 28 percents = round(100.0 * count / float(total), 1) 108 | 29 bar_filled = '=' * filled_len + '-' * (bar_len - filled_len) 109 | 30 110 | 31 sys.stdout.write(f'[{bar_filled}] {percents}% ...{status}\r') 111 | 32 sys.stdout.flush() # As suggested by Rom Ruben (see: http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console/27871113#comment50529068_27871113) 112 |