pyxtream 0.7.2__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,20 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: pyxtream
3
- Version: 0.7.2
3
+ Version: 0.8.0
4
4
  Summary: xtream IPTV loader
5
5
  License: GPL3
6
6
  Author: Claudio Olmi
7
- Author-email: superolmo2@gmail.com
7
+ Author-email: <superolmo2@gmail.com>
8
8
  Requires-Python: >=3.9
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Environment :: Console
11
11
  Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3 :: Only
12
13
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
- Classifier: License :: Other/Proprietary License
14
- Classifier: Natural Language :: English
15
14
  Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: 3.13
22
- Classifier: Programming Language :: Python :: 3 :: Only
23
- Requires-Dist: flask (>=2.2.2)
15
+ Classifier: Natural Language :: English
16
+ Provides-Extra: flask
17
+ Requires-Dist: flask (>=3.1.0,<4.0.0) ; extra == "flask"
24
18
  Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
25
19
  Requires-Dist: requests (>=2.32.3,<3.0.0)
26
20
  Description-Content-Type: text/markdown
@@ -29,7 +23,7 @@ Description-Content-Type: text/markdown
29
23
 
30
24
  PyXtream loads the xtream IPTV content from a provider server. Groups, Channels, Series are all organized in dictionaries. Season and Episodes are retrieved as needed. It includes functions for searching streams and downloading.
31
25
 
32
- This library was originally designed to work with Hypnotix at https://github.com/linuxmint/hypnotix
26
+ This library was originally designed to work with Hypnotix at https://github.com/linuxmint/hypnotix, so its compatibility with Hypnotix takes precedence.
33
27
 
34
28
  # Installing
35
29
 
@@ -61,19 +55,17 @@ else:
61
55
  print("Could not connect")
62
56
  ```
63
57
 
64
- Once completed, all the data can be found in xTream.groups, xTream.channels, xTream.movies, xTream.series. Series do not contains the information for all the Seasons and Episodes. Those are loaded separately when needed by calling the following function using a Series object from xTream.series array of dictionaries.
58
+ Once completed, all the data can be found in `xTream.groups`, `xTream.channels`, `xTream.movies`, `xTream.series`. Series do not contains the information for all the Seasons and Episodes. Those are loaded separately when needed by calling the following function using a Series object from `xTream.series` array of dictionaries.
65
59
 
66
60
  ```python
67
61
  xt.get_series_info_by_id(series_obj)
68
62
  ```
69
63
 
70
- At this point, the series_obj will have both Seasons and Episodes populated.
71
-
72
- If you have installed Flask, the REST Api will be turned ON automatically. At this point, there is no method to turn it off. Maybe in a future version.
64
+ At this point, the `series_obj` will have both Seasons and Episodes populated.
73
65
 
74
66
  ## Functional Test
75
67
 
76
- Please modify the functional_test.py file with your provider information, then start the application.
68
+ Please modify the `functional_test.py` file with your provider information, then start the application.
77
69
 
78
70
  ```shell
79
71
  python3 functional_test.py
@@ -81,21 +73,15 @@ python3 functional_test.py
81
73
 
82
74
  The functional test will allow you to authenticate on startup, load and search streams. If Flask is installed, a simple website will be available at http://localhost:5000 to allow you to search and play streams.
83
75
 
84
- ## Interesting Work by somebody else
85
-
86
- - xtreamPOC - https://github.com/sght500/xtreamPOC - Project is a Proof of Concept (POC) that leverages pyxtream, MPV, and NiceGUI to demonstrate the use of Xtream Portal Codes.
87
-
88
- So far there is no ready to use Transport Stream library for playing live stream.
76
+ ## Applications using PyXtream
89
77
 
90
- - This is the library to convert TS to MP4
91
- - https://github.com/videojs/mux.js/
78
+ Applications using PyXtream PYPI package
92
79
 
93
- - More on above, but same problem. XMLHttpRequest waits until the whole TS file is completely loaded. It does not work for live video streams
94
- - https://developpaper.com/play-ts-video-directly-on-the-web/
80
+ - xtreamPOC - https://github.com/sght500/xtreamPOC - Project is a Proof of Concept (POC) that leverages pyxtream, MPV, and NiceGUI to demonstrate the use of Xtream Portal Codes.
95
81
 
96
- - This below will allow me to process chunks of data
97
- - https://stackoverflow.com/questions/37402716/handle-xmlhttprequest-response-with-large-data
82
+ Applications using PyXtream files
98
83
 
84
+ - Hypnotix - https://github.com/linuxmint/hypnotix - Hypnotix is an IPTV streaming application with support for live TV, movies and series.
99
85
 
100
86
  # API
101
87
 
@@ -133,6 +119,7 @@ xTream.movies[{},{},...]
133
119
  - xTream.allEpg()
134
120
 
135
121
  # Versioning
122
+ Follows the Semantic Versioning from https://semver.org/
136
123
  - Increment the MAJOR version when you make incompatible API changes.
137
124
  - Increment the MINOR version when you add functionality in a backwards-compatible manner.
138
125
  - Increment the PATCH version when you make backwards-compatible bug fixes.
@@ -141,6 +128,8 @@ xTream.movies[{},{},...]
141
128
 
142
129
  | Date | Version | Description |
143
130
  | ----------- | -----| ----------- |
131
+ | 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)
132
+ | 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|
144
133
  | 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|
145
134
  | 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
146
135
  | 2023-11-08 | 0.7.0 | - Added Schema Validator<br>- Added Channel Age<br>- Added list of movies added in the last 30 and 7 days<br>- Updated code based on PyLint<br>- Fixed Flask package to be optional [richard-de-vos](https://github.com/richard-de-vos)|
@@ -154,3 +143,16 @@ xTream.movies[{},{},...]
154
143
  | 2021-06-04 | 0.1.1 | - Updated README.md |
155
144
  | 2021-06-04 | 0.1.0 | - Initial Release |
156
145
 
146
+ ## Interesting content that could be used for future development
147
+
148
+ So far there is no ready to use Transport Stream library for playing live stream.
149
+
150
+ - This is the library to convert TS to MP4
151
+ - https://github.com/videojs/mux.js/
152
+
153
+ - More on above, but same problem. XMLHttpRequest waits until the whole TS file is completely loaded. It does not work for live video streams
154
+ - https://developpaper.com/play-ts-video-directly-on-the-web/
155
+
156
+ - This below will allow me to process chunks of data
157
+ - https://stackoverflow.com/questions/37402716/handle-xmlhttprequest-response-with-large-data
158
+
@@ -2,7 +2,7 @@
2
2
 
3
3
  PyXtream loads the xtream IPTV content from a provider server. Groups, Channels, Series are all organized in dictionaries. Season and Episodes are retrieved as needed. It includes functions for searching streams and downloading.
4
4
 
5
- This library was originally designed to work with Hypnotix at https://github.com/linuxmint/hypnotix
5
+ This library was originally designed to work with Hypnotix at https://github.com/linuxmint/hypnotix, so its compatibility with Hypnotix takes precedence.
6
6
 
7
7
  # Installing
8
8
 
@@ -34,19 +34,17 @@ else:
34
34
  print("Could not connect")
35
35
  ```
36
36
 
37
- Once completed, all the data can be found in xTream.groups, xTream.channels, xTream.movies, xTream.series. Series do not contains the information for all the Seasons and Episodes. Those are loaded separately when needed by calling the following function using a Series object from xTream.series array of dictionaries.
37
+ Once completed, all the data can be found in `xTream.groups`, `xTream.channels`, `xTream.movies`, `xTream.series`. Series do not contains the information for all the Seasons and Episodes. Those are loaded separately when needed by calling the following function using a Series object from `xTream.series` array of dictionaries.
38
38
 
39
39
  ```python
40
40
  xt.get_series_info_by_id(series_obj)
41
41
  ```
42
42
 
43
- At this point, the series_obj will have both Seasons and Episodes populated.
44
-
45
- If you have installed Flask, the REST Api will be turned ON automatically. At this point, there is no method to turn it off. Maybe in a future version.
43
+ At this point, the `series_obj` will have both Seasons and Episodes populated.
46
44
 
47
45
  ## Functional Test
48
46
 
49
- Please modify the functional_test.py file with your provider information, then start the application.
47
+ Please modify the `functional_test.py` file with your provider information, then start the application.
50
48
 
51
49
  ```shell
52
50
  python3 functional_test.py
@@ -54,21 +52,15 @@ python3 functional_test.py
54
52
 
55
53
  The functional test will allow you to authenticate on startup, load and search streams. If Flask is installed, a simple website will be available at http://localhost:5000 to allow you to search and play streams.
56
54
 
57
- ## Interesting Work by somebody else
58
-
59
- - xtreamPOC - https://github.com/sght500/xtreamPOC - Project is a Proof of Concept (POC) that leverages pyxtream, MPV, and NiceGUI to demonstrate the use of Xtream Portal Codes.
60
-
61
- So far there is no ready to use Transport Stream library for playing live stream.
55
+ ## Applications using PyXtream
62
56
 
63
- - This is the library to convert TS to MP4
64
- - https://github.com/videojs/mux.js/
57
+ Applications using PyXtream PYPI package
65
58
 
66
- - More on above, but same problem. XMLHttpRequest waits until the whole TS file is completely loaded. It does not work for live video streams
67
- - https://developpaper.com/play-ts-video-directly-on-the-web/
59
+ - xtreamPOC - https://github.com/sght500/xtreamPOC - Project is a Proof of Concept (POC) that leverages pyxtream, MPV, and NiceGUI to demonstrate the use of Xtream Portal Codes.
68
60
 
69
- - This below will allow me to process chunks of data
70
- - https://stackoverflow.com/questions/37402716/handle-xmlhttprequest-response-with-large-data
61
+ Applications using PyXtream files
71
62
 
63
+ - Hypnotix - https://github.com/linuxmint/hypnotix - Hypnotix is an IPTV streaming application with support for live TV, movies and series.
72
64
 
73
65
  # API
74
66
 
@@ -106,6 +98,7 @@ xTream.movies[{},{},...]
106
98
  - xTream.allEpg()
107
99
 
108
100
  # Versioning
101
+ Follows the Semantic Versioning from https://semver.org/
109
102
  - Increment the MAJOR version when you make incompatible API changes.
110
103
  - Increment the MINOR version when you add functionality in a backwards-compatible manner.
111
104
  - Increment the PATCH version when you make backwards-compatible bug fixes.
@@ -114,6 +107,8 @@ xTream.movies[{},{},...]
114
107
 
115
108
  | Date | Version | Description |
116
109
  | ----------- | -----| ----------- |
110
+ | 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)
111
+ | 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|
117
112
  | 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|
118
113
  | 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
119
114
  | 2023-11-08 | 0.7.0 | - Added Schema Validator<br>- Added Channel Age<br>- Added list of movies added in the last 30 and 7 days<br>- Updated code based on PyLint<br>- Fixed Flask package to be optional [richard-de-vos](https://github.com/richard-de-vos)|
@@ -126,3 +121,16 @@ xTream.movies[{},{},...]
126
121
  | 2021-06-05 | 0.1.2 | - Fixed Server Name |
127
122
  | 2021-06-04 | 0.1.1 | - Updated README.md |
128
123
  | 2021-06-04 | 0.1.0 | - Initial Release |
124
+
125
+ ## Interesting content that could be used for future development
126
+
127
+ So far there is no ready to use Transport Stream library for playing live stream.
128
+
129
+ - This is the library to convert TS to MP4
130
+ - https://github.com/videojs/mux.js/
131
+
132
+ - More on above, but same problem. XMLHttpRequest waits until the whole TS file is completely loaded. It does not work for live video streams
133
+ - https://developpaper.com/play-ts-video-directly-on-the-web/
134
+
135
+ - This below will allow me to process chunks of data
136
+ - https://stackoverflow.com/questions/37402716/handle-xmlhttprequest-response-with-large-data
@@ -1,11 +1,13 @@
1
- [tool.poetry]
1
+ [project]
2
2
  name = "pyxtream"
3
- version = "0.7.2"
3
+ version = "0.8.0"
4
+ requires-python = ">=3.9"
4
5
  description = "xtream IPTV loader"
5
- authors = ["Claudio Olmi <superolmo2@gmail.com>"]
6
+ authors = [{name = "Claudio Olmi", email = "<superolmo2@gmail.com>"}]
6
7
  license = "GPL3"
7
8
  readme = "README.md"
8
- classifiers=[
9
+ homepage = "https://github.com/superolmo/pyxtream"
10
+ classifiers = [
9
11
  "Development Status :: 4 - Beta",
10
12
  "Environment :: Console",
11
13
  "Intended Audience :: Developers",
@@ -14,16 +16,18 @@ classifiers=[
14
16
  "Operating System :: OS Independent",
15
17
  "Natural Language :: English"
16
18
  ]
19
+ dependencies = [
20
+ "requests (>=2.32.3,<3.0.0)",
21
+ "jsonschema (>=4.23.0,<5.0.0)",
22
+ ]
17
23
 
18
- [tool.poetry.dependencies]
19
- python = ">=3.9"
20
- flask = ">=2.2.2"
21
- requests = "^2.32.3"
22
- jsonschema = "^4.23.0"
23
-
24
+ [project.optional-dependencies]
25
+ flask = ["flask>=3.1.0,<4.0.0"]
24
26
 
25
27
  [tool.poetry.group.dev.dependencies]
26
28
  pdoc = "^15.0.1"
29
+ pytest = "^8.3.4"
30
+ pytest-cov = "^6.0.0"
27
31
 
28
32
  [build-system]
29
33
  requires = ["poetry-core"]
@@ -1,6 +1,5 @@
1
1
 
2
- from .progress import progress
3
- from .pyxtream import XTream
2
+ from .pyxtream import Channel, Episode, Group, Season, Serie, XTream
4
3
 
5
4
  try:
6
5
  from .rest_api import FlaskWrap
@@ -0,0 +1,63 @@
1
+ """
2
+ API URL builders
3
+ """
4
+
5
+
6
+ def get_live_categories_URL(base: str) -> str:
7
+ return f"{base}&action=get_live_categories"
8
+
9
+
10
+ def get_live_streams_URL(base: str) -> str:
11
+ return f"{base}&action=get_live_streams"
12
+
13
+
14
+ def get_live_streams_URL_by_category(category_id, base: str) -> str:
15
+ return f"{base}&action=get_live_streams&category_id={category_id}"
16
+
17
+
18
+ def get_vod_cat_URL(base: str) -> str:
19
+ return f"{base}&action=get_vod_categories"
20
+
21
+
22
+ def get_vod_streams_URL(base: str) -> str:
23
+ return f"{base}&action=get_vod_streams"
24
+
25
+
26
+ def get_vod_streams_URL_by_category(category_id, base: str) -> str:
27
+ return f"{base}&action=get_vod_streams&category_id={category_id}"
28
+
29
+
30
+ def get_series_cat_URL(base: str) -> str:
31
+ return f"{base}&action=get_series_categories"
32
+
33
+
34
+ def get_series_URL(base: str) -> str:
35
+ return f"{base}&action=get_series"
36
+
37
+
38
+ def get_series_URL_by_category(category_id, base: str) -> str:
39
+ return f"{base}&action=get_series&category_id={category_id}"
40
+
41
+
42
+ def get_series_info_URL_by_ID(series_id, base: str) -> str:
43
+ return f"{base}&action=get_series_info&series_id={series_id}"
44
+
45
+
46
+ def get_VOD_info_URL_by_ID(vod_id, base: str) -> str:
47
+ return f"{base}&action=get_vod_info&vod_id={vod_id}"
48
+
49
+
50
+ def get_live_epg_URL_by_stream(stream_id, base: str) -> str:
51
+ return f"{base}&action=get_short_epg&stream_id={stream_id}"
52
+
53
+
54
+ def get_live_epg_URL_by_stream_and_limit(stream_id, limit, base: str) -> str:
55
+ return f"{base}&action=get_short_epg&stream_id={stream_id}&limit={limit}"
56
+
57
+
58
+ def get_all_live_epg_URL_by_stream(stream_id, base: str) -> str:
59
+ return f"{base}&action=get_simple_data_table&stream_id={stream_id}"
60
+
61
+
62
+ def get_all_epg_URL(base: str, username: str, password: str) -> str:
63
+ return f"{base}/xmltv.php?username={username}&password={password}"