├── CHANGELOG.md
├── LICENSE
├── README.md
├── addon.xml
├── context.py
├── default.py
├── resources
├── __init__.py
├── icon.png
├── language
│ ├── resource.language.el_gr
│ │ └── strings.po
│ ├── resource.language.en_gb
│ │ └── strings.po
│ ├── resource.language.hu_hu
│ │ └── strings.po
│ ├── resource.language.nl_nl
│ │ └── strings.po
│ ├── resource.language.ro_ro
│ │ └── strings.po
│ └── resource.language.ru_ru
│ │ └── strings.po
├── lib
│ ├── __init__.py
│ ├── functions.py
│ ├── kodilogging.py
│ ├── kodiutils.py
│ ├── modules
│ │ ├── __init__.py
│ │ ├── addon.py
│ │ ├── contextmenu.py
│ │ └── iptvsimple.py
│ └── service.py
├── screenshot01.jpg
├── screenshot02.jpg
├── screenshot03.jpg
├── screenshot04.png
├── screenshot05.png
├── screenshot06.png
└── settings.xml
└── service.py
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## [v0.2.3](https://github.com/add-ons/service.iptv.manager/tree/v0.2.3) (2021-02-04)
4 |
5 | [Full Changelog](https://github.com/add-ons/service.iptv.manager/compare/v0.2.2...v0.2.3)
6 |
7 | **Implemented enhancements:**
8 |
9 | - Make JSON-STREAMS group a list [\#77](https://github.com/add-ons/service.iptv.manager/pull/77) ([dagwieers](https://github.com/dagwieers))
10 | - Fix logging for Kodi Matrix, allow to install script.kodi.loguploader from the settings [\#75](https://github.com/add-ons/service.iptv.manager/pull/75) ([michaelarnauts](https://github.com/michaelarnauts))
11 | - Add support for resource:// logos [\#74](https://github.com/add-ons/service.iptv.manager/pull/74) ([dagwieers](https://github.com/dagwieers))
12 | - Allow to process raw M3U8 or XMLTV data [\#69](https://github.com/add-ons/service.iptv.manager/pull/69) ([michaelarnauts](https://github.com/michaelarnauts))
13 | - Add support for \#KODIPROP [\#68](https://github.com/add-ons/service.iptv.manager/pull/68) ([michaelarnauts](https://github.com/michaelarnauts))
14 |
15 | **Fixed bugs:**
16 |
17 | - Fix empty space in start and stop fields when no timezone was specified [\#70](https://github.com/add-ons/service.iptv.manager/pull/70) ([michaelarnauts](https://github.com/michaelarnauts))
18 |
19 | **Merged pull requests:**
20 |
21 | - Fix/improve the add-on description and summary [\#73](https://github.com/add-ons/service.iptv.manager/pull/73) ([dagwieers](https://github.com/dagwieers))
22 | - Make use of git archive [\#72](https://github.com/add-ons/service.iptv.manager/pull/72) ([dagwieers](https://github.com/dagwieers))
23 | - Verify xmltv output against the xmltv.dtd [\#71](https://github.com/add-ons/service.iptv.manager/pull/71) ([michaelarnauts](https://github.com/michaelarnauts))
24 | - Testing improvements [\#66](https://github.com/add-ons/service.iptv.manager/pull/66) ([michaelarnauts](https://github.com/michaelarnauts))
25 | - Add Romanian strings. [\#65](https://github.com/add-ons/service.iptv.manager/pull/65) ([tmihai20](https://github.com/tmihai20))
26 | - Initial greek translation for IPTV Manager [\#62](https://github.com/add-ons/service.iptv.manager/pull/62) ([Twilight0](https://github.com/Twilight0))
27 | - Add hungarian language translation [\#59](https://github.com/add-ons/service.iptv.manager/pull/59) ([takraj](https://github.com/takraj))
28 | - Improve tests and run tests on Windows [\#58](https://github.com/add-ons/service.iptv.manager/pull/58) ([michaelarnauts](https://github.com/michaelarnauts))
29 |
30 | ## [v0.2.2](https://github.com/add-ons/service.iptv.manager/tree/v0.2.2) (2020-12-07)
31 |
32 | [Full Changelog](https://github.com/add-ons/service.iptv.manager/compare/v0.2.1...v0.2.2)
33 |
34 | **Implemented enhancements:**
35 |
36 | - Allow passing credits with the EPG data [\#54](https://github.com/add-ons/service.iptv.manager/pull/54) ([michaelarnauts](https://github.com/michaelarnauts))
37 |
38 | **Fixed bugs:**
39 |
40 | - Rollback pvr.iptvsimple to 3.8.8 [\#57](https://github.com/add-ons/service.iptv.manager/pull/57) ([MPParsley](https://github.com/MPParsley))
41 |
42 | **Merged pull requests:**
43 |
44 | - Run tests on Python 3.9 [\#55](https://github.com/add-ons/service.iptv.manager/pull/55) ([michaelarnauts](https://github.com/michaelarnauts))
45 |
46 | ## [v0.2.1](https://github.com/add-ons/service.iptv.manager/tree/v0.2.1) (2020-11-03)
47 |
48 | [Full Changelog](https://github.com/add-ons/service.iptv.manager/compare/v0.2.0...v0.2.1)
49 |
50 | **Implemented enhancements:**
51 |
52 | - Cleanup code by removing play by airdate [\#49](https://github.com/add-ons/service.iptv.manager/pull/49) ([michaelarnauts](https://github.com/michaelarnauts))
53 |
54 | **Fixed bugs:**
55 |
56 | - Don't throw an error when no addons are installed [\#51](https://github.com/add-ons/service.iptv.manager/pull/51) ([michaelarnauts](https://github.com/michaelarnauts))
57 |
58 | **Merged pull requests:**
59 |
60 | - Add a release workflow [\#45](https://github.com/add-ons/service.iptv.manager/pull/45) ([dagwieers](https://github.com/dagwieers))
61 |
62 | ## [v0.2.0](https://github.com/add-ons/service.iptv.manager/tree/v0.2.0) (2020-10-09)
63 |
64 | [Full Changelog](https://github.com/add-ons/service.iptv.manager/compare/v0.1.0...v0.2.0)
65 |
66 | **Implemented enhancements:**
67 |
68 | - Support more than one genre for an episode [\#39](https://github.com/add-ons/service.iptv.manager/pull/39) ([dagwieers](https://github.com/dagwieers))
69 |
70 | **Merged pull requests:**
71 |
72 | - Fix pylint issues on Python 3 [\#46](https://github.com/add-ons/service.iptv.manager/pull/46) ([dagwieers](https://github.com/dagwieers))
73 | - Add dependency to 'PVR IPTV Simple Client' [\#42](https://github.com/add-ons/service.iptv.manager/pull/42) ([piejanssens](https://github.com/piejanssens))
74 | - Add russian translation [\#37](https://github.com/add-ons/service.iptv.manager/pull/37) ([vlmaksime](https://github.com/vlmaksime))
75 |
76 | ## [v0.1.0](https://github.com/add-ons/service.iptv.manager/tree/v0.1.0) (2020-06-19)
77 |
78 | [Full Changelog](https://github.com/add-ons/service.iptv.manager/compare/763657b57145c1e28a3b52923488ce427b1694ca...v0.1.0)
79 |
80 | **Implemented enhancements:**
81 |
82 | - Use direct URI to play programs from the EPG in Kodi 18 [\#34](https://github.com/add-ons/service.iptv.manager/pull/34) ([michaelarnauts](https://github.com/michaelarnauts))
83 | - Support start and stop timestamps in vod [\#33](https://github.com/add-ons/service.iptv.manager/pull/33) ([mediaminister](https://github.com/mediaminister))
84 | - Implement genre [\#31](https://github.com/add-ons/service.iptv.manager/pull/31) ([michaelarnauts](https://github.com/michaelarnauts))
85 | - Add support for Kodi Matrix [\#27](https://github.com/add-ons/service.iptv.manager/pull/27) ([michaelarnauts](https://github.com/michaelarnauts))
86 | - Create a new icon [\#22](https://github.com/add-ons/service.iptv.manager/pull/22) ([piejanssens](https://github.com/piejanssens))
87 | - Add an entry to "Program add-ons" [\#20](https://github.com/add-ons/service.iptv.manager/pull/20) ([michaelarnauts](https://github.com/michaelarnauts))
88 | - Allow playing on demand items from the PVR Guide [\#19](https://github.com/add-ons/service.iptv.manager/pull/19) ([michaelarnauts](https://github.com/michaelarnauts))
89 | - Implement refreshing logic [\#9](https://github.com/add-ons/service.iptv.manager/pull/9) ([michaelarnauts](https://github.com/michaelarnauts))
90 | - Add port to given URI [\#5](https://github.com/add-ons/service.iptv.manager/pull/5) ([dagwieers](https://github.com/dagwieers))
91 | - Assorted fixes [\#4](https://github.com/add-ons/service.iptv.manager/pull/4) ([dagwieers](https://github.com/dagwieers))
92 | - Implement socket callback [\#3](https://github.com/add-ons/service.iptv.manager/pull/3) ([michaelarnauts](https://github.com/michaelarnauts))
93 |
94 | **Fixed bugs:**
95 |
96 | - Bugfix: ContextMenu.Play Format uri string if there is a duration present. [\#32](https://github.com/add-ons/service.iptv.manager/pull/32) ([MarcelRoozekrans](https://github.com/MarcelRoozekrans))
97 | - Various fixes or cleanups [\#26](https://github.com/add-ons/service.iptv.manager/pull/26) ([michaelarnauts](https://github.com/michaelarnauts))
98 | - Various fixes [\#25](https://github.com/add-ons/service.iptv.manager/pull/25) ([michaelarnauts](https://github.com/michaelarnauts))
99 | - Properly encode XML values [\#18](https://github.com/add-ons/service.iptv.manager/pull/18) ([michaelarnauts](https://github.com/michaelarnauts))
100 | - Fix WindowsError: \[Error 183\] Can't create a file that already exists [\#16](https://github.com/add-ons/service.iptv.manager/pull/16) ([GianniDPC](https://github.com/GianniDPC))
101 |
102 | **Merged pull requests:**
103 |
104 | - Explicitly set no timeout while waiting for data [\#24](https://github.com/add-ons/service.iptv.manager/pull/24) ([michaelarnauts](https://github.com/michaelarnauts))
105 | - Update documentation [\#12](https://github.com/add-ons/service.iptv.manager/pull/12) ([michaelarnauts](https://github.com/michaelarnauts))
106 | - Add integration test [\#10](https://github.com/add-ons/service.iptv.manager/pull/10) ([michaelarnauts](https://github.com/michaelarnauts))
107 | - Add CI flows [\#8](https://github.com/add-ons/service.iptv.manager/pull/8) ([michaelarnauts](https://github.com/michaelarnauts))
108 |
109 |
110 |
111 | \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
112 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/add-ons/service.iptv.manager/releases)
2 | [](https://github.com/add-ons/service.iptv.manager/actions?query=branch%3Amaster)
3 | [](https://codecov.io/gh/add-ons/service.iptv.manager/branch/master)
4 | [](https://opensource.org/licenses/GPL-3.0)
5 | [](https://github.com/add-ons/service.iptv.manager/graphs/contributors)
6 |
7 | # IPTV Manager
8 | This Service Add-on allows supported IPTV Add-ons to integrates their Live TV and Radio Channels in the Kodi TV integration.
9 | IPTV Manager will periodically poll those Add-ons for Channels and EPG data, and generate a new M3U playlist and
10 | XMLTV file that the Kodi PVR Addon [IPTV Simple](https://github.com/kodi-pvr/pvr.iptvsimple) can use. IPTV Manager
11 | doesn't require a backend like TVHeadend since it handles all the streams inside Kodi. This is also the only way
12 | (that we know of) to play DRM protected streams with the Kodi TV integration.
13 |
14 | More information and documentation for developers can be found on our [Wiki page](https://github.com/add-ons/service.iptv.manager/wiki).
15 |
16 | ## Features
17 | * Integrates Live TV Channels with EPG data in Kodi from supported IPTV Add-ons
18 | * Allows playback of past and future programs directly from the EPG
19 |
20 | ## Screenshots
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | Skin: [Arctic: Zephyr 2](https://forum.kodi.tv/showthread.php?tid=339791)
35 |
--------------------------------------------------------------------------------
/addon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | executable
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 | Integrate IPTV channels from other add-ons in the Kodi TV and Radio menus
24 | Integreer IPTV kanalen van andere add-ons in de Kodi TV en Radio menu's
25 | Интеграция IPTV каналов из других дополнений в Kodi PVR
26 | Más kiegészítők által szolgáltatott IPTV csatornák integrációja a Kodi PVR felületbe
27 | Ενσωμάτωση καναλιών IPTV από άλλα πρόσθετα στο PVR του Kodi
28 | IPTV Manager integrates IPTV channels from other add-ons in the Kodi TV and Radio menus.
29 | IPTV Manager integreert IPTV kanalen van andere add-ons in de Kodi TV en Radio menu's.
30 | Это дополнение интегрирует IPTV каналы из других дополнений в Kodi PVR.
31 | Ez a kiegészítő lehetővé teszi más kiegészítők számára, hogy saját IPTV csatornákat publikáljanak a Kodi PVR felületébe.
32 | Το πρόσθετο αυτο ενσωματώνει τα κανάλια IPTV από άλλα πρόσθετα στο PVR του Kodi.
33 | all
34 | GPL-3.0-only
35 | v0.2.3 (2021-02-04)
36 | - Allow to process raw m3u8 or xmltv data.
37 | - Add support for #KODIPROP.
38 | - Support multiple groups for a channel.
39 | - Improvements for Kodi Matrix.
40 | - Update translations.
41 | https://github.com/add-ons/service.iptv.manager
42 |
43 | resources/icon.png
44 | resources/screenshot01.jpg
45 | resources/screenshot02.jpg
46 | resources/screenshot03.jpg
47 | resources/screenshot04.png
48 | resources/screenshot05.png
49 | resources/screenshot06.png
50 |
51 | true
52 |
53 |
54 |
--------------------------------------------------------------------------------
/context.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Context menu entry point"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | from resources.lib.functions import run
7 |
8 | run([-1, 'play_from_contextmenu'])
9 |
--------------------------------------------------------------------------------
/default.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Script entry point"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 | import sys
6 | from resources.lib.functions import run
7 |
8 | if len(sys.argv) > 1:
9 | run(sys.argv)
10 | else:
11 | run([-1, 'open_settings'])
12 |
--------------------------------------------------------------------------------
/resources/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/__init__.py
--------------------------------------------------------------------------------
/resources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/icon.png
--------------------------------------------------------------------------------
/resources/language/resource.language.el_gr/strings.po:
--------------------------------------------------------------------------------
1 | # Kodi Media Center language file
2 | # Addon Name: IPTV Manager
3 | # Addon id: service.iptv.manager
4 | msgid ""
5 | msgstr ""
6 | "Language: en\n"
7 | "Content-Type: text/plain; charset=UTF-8\n"
8 | "Content-Transfer-Encoding: 8bit\n"
9 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
10 |
11 | # CONTEXT MENU
12 | msgctxt "#30600"
13 | msgid "Play with IPTV Manager"
14 | msgstr "Αναπαραγωγή με τον διαχειριστή IPTV"
15 |
16 | # MESSAGES
17 | msgctxt "#30700"
18 | msgid "Are you sure you want to setup IPTV Simple for the use with IPTV Manager? Any existing configuration of IPTV Simple will be overwritten."
19 | msgstr "Είστε σίγουροι ότι θέλετε να ρυθμίσετε το IPTV Simple για χρήση με τον διαχειριστή IPTV; Όλες οι υπάρχουσες ρυθμίσεις του IPTV simple θα επαναγραφτούν."
20 |
21 | msgctxt "#30701"
22 | msgid "IPTV Simple is configured for use with IPTV Manager!"
23 | msgstr "Το IPTV Simple έχει ρυθμιστεί για χρήση με τον διαχειριστή IPTV!"
24 |
25 | msgctxt "#30702"
26 | msgid "The configuration of IPTV Simple has failed. Please check the log files for more information."
27 | msgstr "Η ρύθμιση του IPTV Simple έχει αποτύχει. Παρακαλώ ελέγξτε το αρχείο καταγραφής για περισσότερες πληροφορίες."
28 |
29 | msgctxt "#30703"
30 | msgid "Detecting IPTV add-ons..."
31 | msgstr "Ανίχνευση των προσθέτων IPTV..."
32 |
33 | msgctxt "#30704"
34 | msgid "Fetching channels and guide of {addon}..."
35 | msgstr "Λήψη καναλιών και οδηγού του {addon}..."
36 |
37 | msgctxt "#30705"
38 | msgid "Updating channels and guide..."
39 | msgstr "Ενημέρωση καναλιών και οδηγού..."
40 |
41 | msgctxt "#30706"
42 | msgid "This program isn't available to play."
43 | msgstr "Το πρόγραμμα αυτό είναι μη διαθέσιμο για αναπαραγωγή."
44 |
45 | # SETTINGS
46 | msgctxt "#30800"
47 | msgid "Channels"
48 | msgstr "Κανάλια"
49 |
50 | msgctxt "#30801"
51 | msgid "Refreshing"
52 | msgstr "Ανανέωση"
53 |
54 | msgctxt "#30802"
55 | msgid "Refresh interval [I](in hours)[/I]"
56 | msgstr "Διάστημα ανανέωσης [I](σε ώρες)[/I]"
57 |
58 | msgctxt "#30803"
59 | msgid "Refresh channels and guide now…"
60 | msgstr "Ανανέωση καναλιών και οδηγού τώρα…"
61 |
62 | msgctxt "#30820"
63 | msgid "IPTV Simple"
64 | msgstr "IPTV Simple"
65 |
66 | msgctxt "#30821"
67 | msgid "Configuration"
68 | msgstr "Ρυθμίσεις"
69 |
70 | msgctxt "#30822"
71 | msgid "Configure IPTV Simple automatically…"
72 | msgstr "Ρύθμιση του IPTV Simple αυτομάτως…"
73 |
74 | msgctxt "#30823"
75 | msgid "Open IPTV Simple settings…"
76 | msgstr "Άνοιγμα των ρυθμίσεων του IPTV Simple"
77 |
78 | msgctxt "#30824"
79 | msgid "Automatically restart IPTV Simple to refresh the data"
80 | msgstr "Αυτόματη ανανέωση του IPTV Simple για ανανέωση των δεδομένων"
81 |
82 | msgctxt "#30880"
83 | msgid "Expert"
84 | msgstr ""
85 |
86 | msgctxt "#30881"
87 | msgid "Logging"
88 | msgstr ""
89 |
90 | msgctxt "#30882"
91 | msgid "Enable debug logging"
92 | msgstr ""
93 |
94 | msgctxt "#30883"
95 | msgid "Install Kodi Logfile Uploader…"
96 | msgstr ""
97 |
98 | msgctxt "#30884"
99 | msgid "Open Kodi Logfile Uploader…"
100 | msgstr ""
101 |
--------------------------------------------------------------------------------
/resources/language/resource.language.en_gb/strings.po:
--------------------------------------------------------------------------------
1 | # Kodi Media Center language file
2 | # Addon Name: IPTV Manager
3 | # Addon id: service.iptv.manager
4 | msgid ""
5 | msgstr ""
6 | "Content-Type: text/plain; charset=UTF-8\n"
7 | "Content-Transfer-Encoding: 8bit\n"
8 | "Language: en\n"
9 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
10 |
11 | # CONTEXT MENU
12 | msgctxt "#30600"
13 | msgid "Play with IPTV Manager"
14 | msgstr ""
15 |
16 | # MESSAGES
17 | msgctxt "#30700"
18 | msgid "Are you sure you want to setup IPTV Simple for the use with IPTV Manager? Any existing configuration of IPTV Simple will be overwritten."
19 | msgstr ""
20 |
21 | msgctxt "#30701"
22 | msgid "IPTV Simple is configured for use with IPTV Manager!"
23 | msgstr ""
24 |
25 | msgctxt "#30702"
26 | msgid "The configuration of IPTV Simple has failed. Please check the log files for more information."
27 | msgstr ""
28 |
29 | msgctxt "#30703"
30 | msgid "Detecting IPTV add-ons..."
31 | msgstr ""
32 |
33 | msgctxt "#30704"
34 | msgid "Fetching channels and guide of {addon}..."
35 | msgstr ""
36 |
37 | msgctxt "#30705"
38 | msgid "Updating channels and guide..."
39 | msgstr ""
40 |
41 | msgctxt "#30706"
42 | msgid "This program isn't available to play."
43 | msgstr ""
44 |
45 | # SETTINGS
46 | msgctxt "#30800"
47 | msgid "Channels"
48 | msgstr ""
49 |
50 | msgctxt "#30801"
51 | msgid "Refreshing"
52 | msgstr ""
53 |
54 | msgctxt "#30802"
55 | msgid "Refresh interval [I](in hours)[/I]"
56 | msgstr ""
57 |
58 | msgctxt "#30803"
59 | msgid "Refresh channels and guide now…"
60 | msgstr ""
61 |
62 | msgctxt "#30820"
63 | msgid "IPTV Simple"
64 | msgstr ""
65 |
66 | msgctxt "#30821"
67 | msgid "Configuration"
68 | msgstr ""
69 |
70 | msgctxt "#30822"
71 | msgid "Configure IPTV Simple automatically…"
72 | msgstr ""
73 |
74 | msgctxt "#30823"
75 | msgid "Open IPTV Simple settings…"
76 | msgstr ""
77 |
78 | msgctxt "#30824"
79 | msgid "Automatically restart IPTV Simple to refresh the data"
80 | msgstr ""
81 |
82 | msgctxt "#30880"
83 | msgid "Expert"
84 | msgstr ""
85 |
86 | msgctxt "#30881"
87 | msgid "Logging"
88 | msgstr ""
89 |
90 | msgctxt "#30882"
91 | msgid "Enable debug logging"
92 | msgstr ""
93 |
94 | msgctxt "#30883"
95 | msgid "Install Kodi Logfile Uploader…"
96 | msgstr ""
97 |
98 | msgctxt "#30884"
99 | msgid "Open Kodi Logfile Uploader…"
100 | msgstr ""
--------------------------------------------------------------------------------
/resources/language/resource.language.hu_hu/strings.po:
--------------------------------------------------------------------------------
1 | # Kodi Media Center language file
2 | # Addon Name: IPTV Manager
3 | # Addon id: service.iptv.manager
4 | msgid ""
5 | msgstr ""
6 | "Language: hu\n"
7 | "Content-Type: text/plain; charset=UTF-8\n"
8 | "Content-Transfer-Encoding: 8bit\n"
9 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
10 |
11 | # CONTEXT MENU
12 | msgctxt "#30600"
13 | msgid "Play with IPTV Manager"
14 | msgstr "Lejátszás ezzel: IPTV Manager"
15 |
16 | # MESSAGES
17 | msgctxt "#30700"
18 | msgid "Are you sure you want to setup IPTV Simple for the use with IPTV Manager? Any existing configuration of IPTV Simple will be overwritten."
19 | msgstr "Biztos szeretnéd, hogy az IPTV Simple ezentúl az IPTV Manager-t használja forrásként? A teljes jelenlegi konfiguráció felülírásra kerül."
20 |
21 | msgctxt "#30701"
22 | msgid "IPTV Simple is configured for use with IPTV Manager!"
23 | msgstr "Az IPTV Simple mostantól az IPTV Manager-t használja forrásként!"
24 |
25 | msgctxt "#30702"
26 | msgid "The configuration of IPTV Simple has failed. Please check the log files for more information."
27 | msgstr "Az IPTV Simple konfigurációja sikertelen. Részletek a hibanaplóban."
28 |
29 | msgctxt "#30703"
30 | msgid "Detecting IPTV add-ons..."
31 | msgstr "IPTV kiegészítők keresése..."
32 |
33 | msgctxt "#30704"
34 | msgid "Fetching channels and guide of {addon}..."
35 | msgstr "Csatornák és műsorújság letöltése: {addon}..."
36 |
37 | msgctxt "#30705"
38 | msgid "Updating channels and guide..."
39 | msgstr "Csatornák és műsorújság frissítése..."
40 |
41 | msgctxt "#30706"
42 | msgid "This program isn't available to play."
43 | msgstr "Ezt a műsort jelenleg nem lehet lejátszani."
44 |
45 | # SETTINGS
46 | msgctxt "#30800"
47 | msgid "Channels"
48 | msgstr "Csatornák"
49 |
50 | msgctxt "#30801"
51 | msgid "Refreshing"
52 | msgstr "Frissítés"
53 |
54 | msgctxt "#30802"
55 | msgid "Refresh interval [I](in hours)[/I]"
56 | msgstr "Frissítési időköz [I](óra)[/I]"
57 |
58 | msgctxt "#30803"
59 | msgid "Refresh channels and guide now…"
60 | msgstr "Csatornák és műsorújság frissítése most…"
61 |
62 | msgctxt "#30820"
63 | msgid "IPTV Simple"
64 | msgstr "IPTV Simple"
65 |
66 | msgctxt "#30821"
67 | msgid "Configuration"
68 | msgstr "Konfiguráció"
69 |
70 | msgctxt "#30822"
71 | msgid "Configure IPTV Simple automatically…"
72 | msgstr "IPTV Simple automatikus konfigurációja…"
73 |
74 | msgctxt "#30823"
75 | msgid "Open IPTV Simple settings…"
76 | msgstr "IPTV Simple beállításainak megnyitása…"
77 |
78 | msgctxt "#30824"
79 | msgid "Automatically restart IPTV Simple to refresh the data"
80 | msgstr "IPTV Simple automatikus újraindítása, frissítés után"
81 |
82 | msgctxt "#30880"
83 | msgid "Expert"
84 | msgstr ""
85 |
86 | msgctxt "#30881"
87 | msgid "Logging"
88 | msgstr ""
89 |
90 | msgctxt "#30882"
91 | msgid "Enable debug logging"
92 | msgstr ""
93 |
94 | msgctxt "#30883"
95 | msgid "Install Kodi Logfile Uploader…"
96 | msgstr ""
97 |
98 | msgctxt "#30884"
99 | msgid "Open Kodi Logfile Uploader…"
100 | msgstr ""
101 |
--------------------------------------------------------------------------------
/resources/language/resource.language.nl_nl/strings.po:
--------------------------------------------------------------------------------
1 | # Kodi Media Center language file
2 | # Addon Name: IPTV Manager
3 | # Addon id: service.iptv.manager
4 | msgid ""
5 | msgstr ""
6 | "Language: nl\n"
7 | "MIME-Version: 1.0\n"
8 | "Content-Type: text/plain; charset=UTF-8\n"
9 | "Content-Transfer-Encoding: 8bit\n"
10 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
11 |
12 | # CONTEXT MENU
13 | msgctxt "#30600"
14 | msgid "Play with IPTV Manager"
15 | msgstr "Afspelen met IPTV Manager"
16 |
17 | # MESSAGES
18 | msgctxt "#30700"
19 | msgid "Are you sure you want to setup IPTV Simple for the use with IPTV Manager? Any existing configuration of IPTV Simple will be overwritten."
20 | msgstr "Bent u zeker om IPTV Simple in te stellen om te gebruiken met IPTV Manager? De bestaande configuratie van IPTV Simple zal worden overschreven."
21 |
22 | msgctxt "#30701"
23 | msgid "IPTV Simple is configured for use with IPTV Manager!"
24 | msgstr "IPTV SImple is geconfigureerd om te gebruiken met IPTV Manager!"
25 |
26 | msgctxt "#30702"
27 | msgid "The configuration of IPTV Simple has failed. Please check the log files for more information."
28 | msgstr "De configuratie van IPTV Simple is mislukt. Gelieve de logbestanden te bekijken voor meer informatie."
29 |
30 | msgctxt "#30703"
31 | msgid "Detecting IPTV add-ons..."
32 | msgstr "Detecteren van IPTV add-ons..."
33 |
34 | msgctxt "#30704"
35 | msgid "Fetching channels and guide of {addon}..."
36 | msgstr "Opvragen van kanalenlijst en gids van {addon}..."
37 |
38 | msgctxt "#30705"
39 | msgid "Updating channels and guide..."
40 | msgstr "Updaten van de kanalenlijst en de gids..."
41 |
42 | msgctxt "#30706"
43 | msgid "This program isn't available to play."
44 | msgstr "Dit programma is niet beschikbaar om af te spelen."
45 |
46 | # SETTINGS
47 | msgctxt "#30800"
48 | msgid "Channels"
49 | msgstr "Kanalen"
50 |
51 | msgctxt "#30801"
52 | msgid "Refreshing"
53 | msgstr "Verniewen"
54 |
55 | msgctxt "#30802"
56 | msgid "Refresh interval [I](in hours)[/I]"
57 | msgstr "Vernieuwsingsinterval [I](in uren)[/I]"
58 |
59 | msgctxt "#30803"
60 | msgid "Refresh channels and guide now…"
61 | msgstr "Vernieuw kanalenlijst en gids nu…"
62 |
63 | msgctxt "#30820"
64 | msgid "IPTV Simple"
65 | msgstr "IPTV Simple"
66 |
67 | msgctxt "#30821"
68 | msgid "Configuration"
69 | msgstr "Configuratie"
70 |
71 | msgctxt "#30822"
72 | msgid "Configure IPTV Simple automatically…"
73 | msgstr "Configureer IPTV Simple automatisch…"
74 |
75 | msgctxt "#30823"
76 | msgid "Open IPTV Simple settings…"
77 | msgstr "Open de IPTV Simple instellingen…"
78 |
79 | msgctxt "#30824"
80 | msgid "Automatically restart IPTV Simple to refresh the data"
81 | msgstr "Herstart IPTV Simple automatisch om de data te vernieuwen"
82 |
83 | msgctxt "#30880"
84 | msgid "Expert"
85 | msgstr "Expert"
86 |
87 | msgctxt "#30881"
88 | msgid "Logging"
89 | msgstr "Logboek"
90 |
91 | msgctxt "#30882"
92 | msgid "Enable debug logging"
93 | msgstr "Activeer debug logging"
94 |
95 | msgctxt "#30883"
96 | msgid "Install Kodi Logfile Uploader…"
97 | msgstr "Installeer Kodi Logfile Uploader…"
98 |
99 | msgctxt "#30884"
100 | msgid "Open Kodi Logfile Uploader…"
101 | msgstr "Open Kodi Logfile Uploader…"
102 |
--------------------------------------------------------------------------------
/resources/language/resource.language.ro_ro/strings.po:
--------------------------------------------------------------------------------
1 | # Kodi Media Center language file
2 | # Addon Name: IPTV Manager
3 | # Addon id: service.iptv.manager
4 | msgid ""
5 | msgstr ""
6 | "Language: ro\n"
7 | "Content-Type: text/plain; charset=UTF-8\n"
8 | "Content-Transfer-Encoding: 8bit\n"
9 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
10 |
11 | # CONTEXT MENU
12 | msgctxt "#30600"
13 | msgid "Play with IPTV Manager"
14 | msgstr "Redă cu IPTV Manager"
15 |
16 | # MESSAGES
17 | msgctxt "#30700"
18 | msgid "Are you sure you want to setup IPTV Simple for the use with IPTV Manager? Any existing configuration of IPTV Simple will be overwritten."
19 | msgstr "Sunteți sigur/(ă) că vreți să configurați IPTV Simple pentru a fi utilizat cu IPTV Manager? Dacă există vreo configurație a IPTV Simple, aceasta va fi suprascrisă."
20 |
21 | msgctxt "#30701"
22 | msgid "IPTV Simple is configured for use with IPTV Manager!"
23 | msgstr "IPTV Simple este configurat să fie folosit cu IPTV Manager!"
24 |
25 | msgctxt "#30702"
26 | msgid "The configuration of IPTV Simple has failed. Please check the log files for more information."
27 | msgstr "Configurarea IPTV Manager a eșuat. Vă rugăm să verificați logurile pentru mai multe informații."
28 |
29 | msgctxt "#30703"
30 | msgid "Detecting IPTV add-ons..."
31 | msgstr "Se detectează add-on-uri IPTV..."
32 |
33 | msgctxt "#30704"
34 | msgid "Fetching channels and guide of {addon}..."
35 | msgstr "Se descarcă canalele și ghidul pentru {addon}..."
36 |
37 | msgctxt "#30705"
38 | msgid "Updating channels and guide..."
39 | msgstr "Se actualizează canalele și ghidul..."
40 |
41 | msgctxt "#30706"
42 | msgid "This program isn't available to play."
43 | msgstr "Acest program nu este disponibil pentru redare."
44 |
45 | # SETTINGS
46 | msgctxt "#30800"
47 | msgid "Channels"
48 | msgstr "Canale"
49 |
50 | msgctxt "#30801"
51 | msgid "Refreshing"
52 | msgstr "Se actualizează"
53 |
54 | msgctxt "#30802"
55 | msgid "Refresh interval [I](in hours)[/I]"
56 | msgstr "Interval de actualizare [I](în ore)[/I]"
57 |
58 | msgctxt "#30803"
59 | msgid "Refresh channels and guide now…"
60 | msgstr "Actualizează canalele și ghidul acum..."
61 |
62 | msgctxt "#30820"
63 | msgid "IPTV Simple"
64 | msgstr "IPTV Simple"
65 |
66 | msgctxt "#30821"
67 | msgid "Configuration"
68 | msgstr "Configurare"
69 |
70 | msgctxt "#30822"
71 | msgid "Configure IPTV Simple automatically…"
72 | msgstr "Configurează IPTV Simple în mod automat..."
73 |
74 | msgctxt "#30823"
75 | msgid "Open IPTV Simple settings…"
76 | msgstr "Deschide setările IPTV Simple..."
77 |
78 | msgctxt "#30824"
79 | msgid "Automatically restart IPTV Simple to refresh the data"
80 | msgstr "Repornește automat IPTV Simple pentru a actualiza datele"
81 |
82 | msgctxt "#30880"
83 | msgid "Expert"
84 | msgstr ""
85 |
86 | msgctxt "#30881"
87 | msgid "Logging"
88 | msgstr ""
89 |
90 | msgctxt "#30882"
91 | msgid "Enable debug logging"
92 | msgstr ""
93 |
94 | msgctxt "#30883"
95 | msgid "Install Kodi Logfile Uploader…"
96 | msgstr ""
97 |
98 | msgctxt "#30884"
99 | msgid "Open Kodi Logfile Uploader…"
100 | msgstr ""
101 |
--------------------------------------------------------------------------------
/resources/language/resource.language.ru_ru/strings.po:
--------------------------------------------------------------------------------
1 | # Kodi Media Center language file
2 | # Addon Name: IPTV Manager
3 | # Addon id: service.iptv.manager
4 | msgid ""
5 | msgstr ""
6 | "Language: ru\n"
7 | "Content-Type: text/plain; charset=UTF-8\n"
8 | "Content-Transfer-Encoding: 8bit\n"
9 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
10 |
11 | # CONTEXT MENU
12 | msgctxt "#30600"
13 | msgid "Play with IPTV Manager"
14 | msgstr "Воспроизвести в IPTV Manager"
15 |
16 | # MESSAGES
17 | msgctxt "#30700"
18 | msgid "Are you sure you want to setup IPTV Simple for the use with IPTV Manager? Any existing configuration of IPTV Simple will be overwritten."
19 | msgstr "Вы уверены, что хотите настроить IPTV Simple для работы с IPTV Manager? Существующие параметры IPTV Simple будут перезаписаны."
20 |
21 | msgctxt "#30701"
22 | msgid "IPTV Simple is configured for use with IPTV Manager!"
23 | msgstr "IPTV Simple настроен для работы с IPTV Manager!"
24 |
25 | msgctxt "#30702"
26 | msgid "The configuration of IPTV Simple has failed. Please check the log files for more information."
27 | msgstr "Настройка IPTV Simple не удалась. Пожалуйста, проверьте файлы журнала для получения дополнительной информации."
28 |
29 | msgctxt "#30703"
30 | msgid "Detecting IPTV add-ons..."
31 | msgstr "Обнаружение дополнений IPTV..."
32 |
33 | msgctxt "#30704"
34 | msgid "Fetching channels and guide of {addon}..."
35 | msgstr "Получение каналов и программы от {addon}..."
36 |
37 | msgctxt "#30705"
38 | msgid "Updating channels and guide..."
39 | msgstr "Обновление каналов и программы..."
40 |
41 | msgctxt "#30706"
42 | msgid "This program isn't available to play."
43 | msgstr ""
44 |
45 | # SETTINGS
46 | msgctxt "#30800"
47 | msgid "Channels"
48 | msgstr "ТВ каналы"
49 |
50 | msgctxt "#30801"
51 | msgid "Refreshing"
52 | msgstr "Обновление"
53 |
54 | msgctxt "#30802"
55 | msgid "Refresh interval [I](in hours)[/I]"
56 | msgstr "Интервал обновления [I](в часах)[/I]"
57 |
58 | msgctxt "#30803"
59 | msgid "Refresh channels and guide now…"
60 | msgstr "Обновить каналы и программу сейчас…"
61 |
62 | msgctxt "#30820"
63 | msgid "IPTV Simple"
64 | msgstr "IPTV Simple"
65 |
66 | msgctxt "#30821"
67 | msgid "Configuration"
68 | msgstr "Параметры"
69 |
70 | msgctxt "#30822"
71 | msgid "Configure IPTV Simple automatically…"
72 | msgstr "Настроить IPTV Simple автоматически…"
73 |
74 | msgctxt "#30823"
75 | msgid "Open IPTV Simple settings…"
76 | msgstr "Открыть настройки IPTV Simple…"
77 |
78 | msgctxt "#30824"
79 | msgid "Automatically restart IPTV Simple to refresh the data"
80 | msgstr "Автоматически перезапускать IPTV Simple при обновлении данных"
81 |
82 | msgctxt "#30880"
83 | msgid "Expert"
84 | msgstr ""
85 |
86 | msgctxt "#30881"
87 | msgid "Logging"
88 | msgstr ""
89 |
90 | msgctxt "#30882"
91 | msgid "Enable debug logging"
92 | msgstr ""
93 |
94 | msgctxt "#30883"
95 | msgid "Install Kodi Logfile Uploader…"
96 | msgstr ""
97 |
98 | msgctxt "#30884"
99 | msgid "Open Kodi Logfile Uploader…"
100 | msgstr ""
101 |
--------------------------------------------------------------------------------
/resources/lib/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/lib/__init__.py
--------------------------------------------------------------------------------
/resources/lib/functions.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Functions code"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | import logging
7 |
8 | from resources.lib import kodilogging, kodiutils
9 | from resources.lib.modules.addon import Addon
10 | from resources.lib.modules.contextmenu import ContextMenu
11 | from resources.lib.modules.iptvsimple import IptvSimple
12 |
13 | _LOGGER = logging.getLogger(__name__)
14 |
15 |
16 | def setup_iptv_simple():
17 | """Setup IPTV Simple"""
18 | reply = kodiutils.yesno_dialog(message=kodiutils.localize(30700)) # Are you sure...
19 | if reply:
20 | if IptvSimple.setup():
21 | kodiutils.ok_dialog(message=kodiutils.localize(30701)) # The configuration of IPTV Simple is completed!
22 | else:
23 | kodiutils.ok_dialog(message=kodiutils.localize(30702)) # The configuration of IPTV Simple has failed!
24 |
25 | # Open settings again
26 | kodiutils.open_settings()
27 |
28 |
29 | def refresh():
30 | """Refresh the channels and EPG"""
31 | Addon.refresh(True)
32 |
33 | # Open settings again
34 | kodiutils.open_settings()
35 |
36 |
37 | def play_from_contextmenu():
38 | """Play an item from the Context Menu in Kodi 18"""
39 | stream = ContextMenu.get_direct_uri()
40 | if stream is None:
41 | kodiutils.ok_dialog(message=kodiutils.localize(30706))
42 | return
43 |
44 | _LOGGER.debug('Playing using direct URI: %s', stream)
45 | kodiutils.execute_builtin('PlayMedia', stream)
46 |
47 |
48 | def open_settings():
49 | """Open the settings for IPTV Manager"""
50 | kodiutils.open_settings()
51 |
52 |
53 | def run(args):
54 | """Run the function"""
55 | kodilogging.config()
56 |
57 | function = args[1]
58 | function_map = {
59 | 'setup-iptv-simple': setup_iptv_simple,
60 | 'refresh': refresh,
61 | 'play_from_contextmenu': play_from_contextmenu,
62 | 'open_settings': open_settings,
63 | }
64 | try:
65 | # TODO: allow to pass *args to the function so we can also pass arguments
66 | _LOGGER.debug('Routing to function: %s', function)
67 | function_map.get(function)()
68 | except (TypeError, IndexError):
69 | _LOGGER.error('Could not route to %s', function)
70 | raise
71 |
--------------------------------------------------------------------------------
/resources/lib/kodilogging.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Log handler for Kodi"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | import logging
7 |
8 | import xbmc
9 | import xbmcaddon
10 |
11 | from resources.lib import kodiutils
12 |
13 | ADDON = xbmcaddon.Addon()
14 |
15 |
16 | class KodiLogHandler(logging.StreamHandler):
17 | """ A log handler for Kodi """
18 |
19 | def __init__(self):
20 | logging.StreamHandler.__init__(self)
21 | formatter = logging.Formatter("[{}] [%(name)s] %(message)s".format(ADDON.getAddonInfo("id")))
22 | self.setFormatter(formatter)
23 | # xbmc.LOGNOTICE is deprecated in Kodi 19 Matrix
24 | if kodiutils.kodi_version_major() > 18:
25 | self.info_level = xbmc.LOGINFO
26 | else:
27 | self.info_level = xbmc.LOGNOTICE
28 |
29 | def emit(self, record):
30 | """ Emit a log message """
31 | levels = {
32 | logging.CRITICAL: xbmc.LOGFATAL,
33 | logging.ERROR: xbmc.LOGERROR,
34 | logging.WARNING: xbmc.LOGWARNING,
35 | logging.INFO: self.info_level,
36 | logging.DEBUG: xbmc.LOGDEBUG,
37 | logging.NOTSET: xbmc.LOGNONE,
38 | }
39 |
40 | # Map DEBUG level to info_level if debug logging setting has been activated
41 | # This is for troubleshooting only
42 | if ADDON.getSetting('debug_logging') == 'true':
43 | levels[logging.DEBUG] = self.info_level
44 |
45 | try:
46 | xbmc.log(self.format(record), levels[record.levelno])
47 | except UnicodeEncodeError:
48 | xbmc.log(self.format(record).encode('utf-8', 'ignore'), levels[record.levelno])
49 |
50 | def flush(self):
51 | """ Flush the messages """
52 |
53 |
54 | def config():
55 | """ Setup the logger with this handler """
56 | logger = logging.getLogger()
57 | logger.setLevel(logging.DEBUG) # Make sure we pass all messages, Kodi will do some filtering itself.
58 | logger.addHandler(KodiLogHandler())
59 |
--------------------------------------------------------------------------------
/resources/lib/kodiutils.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """All functionality that requires Kodi imports"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | import logging
7 |
8 | import xbmc
9 | import xbmcaddon
10 | import xbmcgui
11 | import xbmcvfs
12 |
13 | ADDON = xbmcaddon.Addon()
14 |
15 | _LOGGER = logging.getLogger(__name__)
16 |
17 |
18 | class SafeDict(dict):
19 | """A safe dictionary implementation that does not break down on missing keys"""
20 |
21 | def __missing__(self, key):
22 | """Replace missing keys with the original placeholder"""
23 | return '{' + key + '}'
24 |
25 |
26 | def to_unicode(text, encoding='utf-8', errors='strict'):
27 | """Force text to unicode"""
28 | if isinstance(text, bytes):
29 | return text.decode(encoding, errors=errors)
30 | return text
31 |
32 |
33 | def from_unicode(text, encoding='utf-8', errors='strict'):
34 | """Force unicode to text"""
35 | import sys
36 | if sys.version_info.major == 2 and isinstance(text, unicode): # noqa: F821; pylint: disable=undefined-variable
37 | return text.encode(encoding, errors)
38 | return text
39 |
40 |
41 | def addon_icon(addon=None):
42 | """Cache and return add-on icon"""
43 | return get_addon_info('icon', addon)
44 |
45 |
46 | def addon_id(addon=None):
47 | """Cache and return add-on ID"""
48 | return get_addon_info('id', addon)
49 |
50 |
51 | def addon_name(addon=None):
52 | """Cache and return add-on name"""
53 | return get_addon_info('name', addon)
54 |
55 |
56 | def addon_path(addon=None):
57 | """Cache and return add-on path"""
58 | return get_addon_info('path', addon)
59 |
60 |
61 | def addon_profile(addon=None):
62 | """Return add-on profile"""
63 | if not addon:
64 | addon = ADDON
65 | try: # Kodi 19
66 | return to_unicode(xbmcvfs.translatePath(addon.getAddonInfo('profile')))
67 | except AttributeError: # Kodi 18
68 | return to_unicode(xbmc.translatePath(addon.getAddonInfo('profile')))
69 |
70 |
71 | def ok_dialog(heading='', message=''):
72 | """Show Kodi's OK dialog"""
73 | if not heading:
74 | heading = addon_name()
75 | if kodi_version_major() < 19:
76 | # pylint: disable=unexpected-keyword-arg,no-value-for-parameter
77 | return xbmcgui.Dialog().ok(heading=heading, line1=message)
78 | return xbmcgui.Dialog().ok(heading=heading, message=message)
79 |
80 |
81 | def yesno_dialog(heading='', message='', nolabel=None, yeslabel=None, autoclose=0):
82 | """Show Kodi's Yes/No dialog"""
83 | if not heading:
84 | heading = addon_name()
85 | if kodi_version_major() < 19:
86 | # pylint: disable=unexpected-keyword-arg,no-value-for-parameter
87 | return xbmcgui.Dialog().yesno(heading=heading, line1=message, nolabel=nolabel, yeslabel=yeslabel,
88 | autoclose=autoclose)
89 | return xbmcgui.Dialog().yesno(heading=heading, message=message, nolabel=nolabel, yeslabel=yeslabel, autoclose=autoclose)
90 |
91 |
92 | class progress(xbmcgui.DialogProgress, object): # pylint: disable=invalid-name,useless-object-inheritance
93 | """Show Kodi's Progress dialog"""
94 |
95 | def __init__(self, heading='', message=''):
96 | """Initialize and create a progress dialog"""
97 | super(progress, self).__init__()
98 | if not heading:
99 | heading = ADDON.getAddonInfo('name')
100 | self.create(heading, message=message)
101 |
102 | def create(self, heading, message=''): # pylint: disable=arguments-differ
103 | """Create and show a progress dialog"""
104 | if kodi_version_major() < 19:
105 | lines = message.split('\n', 2)
106 | line1, line2, line3 = (lines + [None] * (3 - len(lines)))
107 | # pylint: disable=unexpected-keyword-arg,no-value-for-parameter
108 | return super(progress, self).create(heading, line1=line1, line2=line2, line3=line3)
109 | return super(progress, self).create(heading, message=message)
110 |
111 | def update(self, percent, message=''): # pylint: disable=arguments-differ
112 | """Update the progress dialog"""
113 | if kodi_version_major() < 19:
114 | lines = message.split('\n', 2)
115 | line1, line2, line3 = (lines + [None] * (3 - len(lines)))
116 | # pylint: disable=unexpected-keyword-arg,no-value-for-parameter
117 | return super(progress, self).update(percent, line1=line1, line2=line2, line3=line3)
118 | return super(progress, self).update(percent, message=message)
119 |
120 |
121 | def localize(string_id, **kwargs):
122 | """Return the translated string from the .po language files, optionally translating variables"""
123 | if kwargs:
124 | from string import Formatter
125 | return Formatter().vformat(ADDON.getLocalizedString(string_id), (), SafeDict(**kwargs))
126 | return ADDON.getLocalizedString(string_id)
127 |
128 |
129 | def get_setting(key, default=None):
130 | """Get an add-on setting as string"""
131 | try:
132 | value = to_unicode(ADDON.getSetting(key))
133 | except RuntimeError: # Occurs when the add-on is disabled
134 | return default
135 | if value == '' and default is not None:
136 | return default
137 | return value
138 |
139 |
140 | def get_setting_bool(key, default=None):
141 | """Get an add-on setting as boolean"""
142 | try:
143 | return ADDON.getSettingBool(key)
144 | except (AttributeError, TypeError): # On Krypton or older, or when not a boolean
145 | value = get_setting(key, default)
146 | if value not in ('false', 'true'):
147 | return default
148 | return bool(value == 'true')
149 | except RuntimeError: # Occurs when the add-on is disabled
150 | return default
151 |
152 |
153 | def get_setting_int(key, default=None):
154 | """Get an add-on setting as integer"""
155 | # ADDON.getSettingInt(key) doesn't work in Leia for settings without "number"
156 | try:
157 | return int(get_setting(key, default))
158 | except ValueError: # Occurs when not an integer
159 | return default
160 | except RuntimeError: # Occurs when the add-on is disabled
161 | return default
162 |
163 |
164 | def get_setting_float(key, default=None):
165 | """Get an add-on setting"""
166 | try:
167 | return ADDON.getSettingNumber(key)
168 | except (AttributeError, TypeError): # On Krypton or older, or when not a float
169 | value = get_setting(key, default)
170 | try:
171 | return float(value)
172 | except ValueError:
173 | return default
174 | except RuntimeError: # Occurs when the add-on is disabled
175 | return default
176 |
177 |
178 | def set_setting(key, value):
179 | """Set an add-on setting"""
180 | return ADDON.setSetting(key, from_unicode(str(value)))
181 |
182 |
183 | def set_setting_bool(key, value):
184 | """Set an add-on setting as boolean"""
185 | try:
186 | return ADDON.setSettingBool(key, value)
187 | except (AttributeError, TypeError): # On Krypton or older, or when not a boolean
188 | if value in ['false', 'true']:
189 | return set_setting(key, value)
190 | if value:
191 | return set_setting(key, 'true')
192 | return set_setting(key, 'false')
193 |
194 |
195 | def set_setting_int(key, value):
196 | """Set an add-on setting as integer"""
197 | try:
198 | return ADDON.setSettingInt(key, value)
199 | except (AttributeError, TypeError): # On Krypton or older, or when not an integer
200 | return set_setting(key, value)
201 |
202 |
203 | def set_setting_float(key, value):
204 | """Set an add-on setting"""
205 | try:
206 | return ADDON.setSettingNumber(key, value)
207 | except (AttributeError, TypeError): # On Krypton or older, or when not a float
208 | return set_setting(key, value)
209 |
210 |
211 | def open_settings():
212 | """Open the add-in settings window, shows Credentials"""
213 | ADDON.openSettings()
214 |
215 |
216 | def get_global_setting(key):
217 | """Get a Kodi setting"""
218 | result = jsonrpc(method='Settings.GetSettingValue', params=dict(setting=key))
219 | return result.get('result', {}).get('value')
220 |
221 |
222 | def set_global_setting(key, value):
223 | """Set a Kodi setting"""
224 | return jsonrpc(method='Settings.SetSettingValue', params=dict(setting=key, value=value))
225 |
226 |
227 | def get_cond_visibility(condition):
228 | """Test a condition in XBMC"""
229 | return xbmc.getCondVisibility(condition)
230 |
231 |
232 | def kodi_version():
233 | """Returns full Kodi version as string"""
234 | return xbmc.getInfoLabel('System.BuildVersion').split(' ')[0]
235 |
236 |
237 | def kodi_version_major():
238 | """Returns major Kodi version as integer"""
239 | return int(kodi_version().split('.')[0])
240 |
241 |
242 | def get_tokens_path():
243 | """Cache and return the userdata tokens path"""
244 | if not hasattr(get_tokens_path, 'cached'):
245 | get_tokens_path.cached = addon_profile() + 'tokens/'
246 | return getattr(get_tokens_path, 'cached')
247 |
248 |
249 | def get_cache_path():
250 | """Cache and return the userdata cache path"""
251 | if not hasattr(get_cache_path, 'cached'):
252 | get_cache_path.cached = addon_profile() + 'cache/'
253 | return getattr(get_cache_path, 'cached')
254 |
255 |
256 | def get_addon_info(key, addon=None):
257 | """Return addon information"""
258 | if not addon:
259 | addon = ADDON
260 | return to_unicode(addon.getAddonInfo(key))
261 |
262 |
263 | def jsonrpc(*args, **kwargs):
264 | """Perform JSONRPC calls"""
265 | from json import dumps, loads
266 |
267 | # We do not accept both args and kwargs
268 | if args and kwargs:
269 | _LOGGER.error('Wrong use of jsonrpc()')
270 | return None
271 |
272 | # Process a list of actions
273 | if args:
274 | for (idx, cmd) in enumerate(args):
275 | if cmd.get('id') is None:
276 | cmd.update(id=idx)
277 | if cmd.get('jsonrpc') is None:
278 | cmd.update(jsonrpc='2.0')
279 | return loads(xbmc.executeJSONRPC(dumps(args)))
280 |
281 | # Process a single action
282 | if kwargs.get('id') is None:
283 | kwargs.update(id=0)
284 | if kwargs.get('jsonrpc') is None:
285 | kwargs.update(jsonrpc='2.0')
286 | return loads(xbmc.executeJSONRPC(dumps(kwargs)))
287 |
288 |
289 | def execute_builtin(command, *args):
290 | """Execute a Kodi builtin function"""
291 | xbmc.executebuiltin('{command}({params})'.format(command=command, params=",".join(args)))
292 |
293 |
294 | def get_addon(name):
295 | """Return an instance of the specified Addon"""
296 | return xbmcaddon.Addon(name)
297 |
--------------------------------------------------------------------------------
/resources/lib/modules/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/lib/modules/__init__.py
--------------------------------------------------------------------------------
/resources/lib/modules/addon.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Addon Module"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | import sys
7 | import json
8 | import logging
9 | import os
10 | import re
11 | import socket
12 | import time
13 |
14 | from resources.lib import kodiutils
15 | from resources.lib.modules.iptvsimple import IptvSimple
16 |
17 | _LOGGER = logging.getLogger(__name__)
18 |
19 | CHANNELS_VERSION = 1
20 | EPG_VERSION = 1
21 |
22 |
23 | def update_qs(url, **params):
24 | """Add or update a URL query string"""
25 | try: # Python 3
26 | from urllib.parse import parse_qsl, urlencode, urlparse, urlunparse
27 | except ImportError: # Python 2
28 | from urllib import urlencode
29 |
30 | from urlparse import parse_qsl, urlparse, urlunparse
31 | url_parts = list(urlparse(url))
32 | query = dict(parse_qsl(url_parts[4]))
33 | query.update(params)
34 | url_parts[4] = urlencode(query)
35 | return urlunparse(url_parts)
36 |
37 |
38 | class Addon:
39 | """Helper class for Addon communication"""
40 |
41 | def __init__(self, addon_id, addon_obj, channels_uri, epg_uri):
42 | self.addon_id = addon_id
43 | self.addon_obj = addon_obj
44 | self.channels_uri = channels_uri
45 | self.epg_uri = epg_uri
46 |
47 | addon = kodiutils.get_addon(addon_id)
48 | self.addon_path = kodiutils.addon_path(addon)
49 |
50 | @classmethod
51 | def refresh(cls, show_progress=False):
52 | """Update channels and EPG data"""
53 | channels = []
54 | epg = []
55 |
56 | if show_progress:
57 | progress = kodiutils.progress(message=kodiutils.localize(30703)) # Detecting IPTV add-ons...
58 | else:
59 | progress = None
60 |
61 | addons = cls.detect_iptv_addons()
62 | for index, addon in enumerate(addons):
63 | _LOGGER.info('Updating IPTV data for %s...', addon.addon_id)
64 |
65 | if progress:
66 | # Fetching channels and guide of {addon}...
67 | progress.update(int(100 * index / len(addons)),
68 | kodiutils.localize(30704).format(addon=kodiutils.addon_name(addon.addon_obj)))
69 |
70 | # Fetch channels
71 | channels.append(dict(
72 | addon_id=addon.addon_id,
73 | addon_name=kodiutils.addon_name(addon.addon_obj),
74 | channels=addon.get_channels(),
75 | ))
76 |
77 | if progress and progress.iscanceled():
78 | progress.close()
79 | return
80 |
81 | # Fetch EPG
82 | epg.append(addon.get_epg())
83 |
84 | if progress and progress.iscanceled():
85 | progress.close()
86 | return
87 |
88 | # Write files
89 | if show_progress:
90 | progress.update(100, kodiutils.localize(30705)) # Updating channels and guide...
91 |
92 | IptvSimple.write_playlist(channels)
93 | IptvSimple.write_epg(epg, channels)
94 |
95 | if kodiutils.get_setting_bool('iptv_simple_restart'):
96 | if show_progress:
97 | # Restart now.
98 | IptvSimple.restart(True)
99 | else:
100 | # Try to restart now. We will schedule it if the user is watching TV.
101 | IptvSimple.restart(False)
102 |
103 | # Update last_refreshed
104 | kodiutils.set_setting_int('last_refreshed', int(time.time()))
105 |
106 | if show_progress:
107 | progress.close()
108 |
109 | @staticmethod
110 | def detect_iptv_addons():
111 | """Find add-ons that provide IPTV channel data"""
112 | result = kodiutils.jsonrpc(method="Addons.GetAddons",
113 | params={'installed': True, 'enabled': True, 'type': 'xbmc.python.pluginsource'})
114 |
115 | addons = []
116 | for row in result['result'].get('addons', []):
117 | addon = kodiutils.get_addon(row['addonid'])
118 |
119 | # Check if add-on supports IPTV Manager
120 | if addon.getSetting('iptv.enabled') != 'true':
121 | continue
122 |
123 | addons.append(Addon(
124 | addon_id=row['addonid'],
125 | addon_obj=addon,
126 | channels_uri=addon.getSetting('iptv.channels_uri'),
127 | epg_uri=addon.getSetting('iptv.epg_uri'),
128 | ))
129 |
130 | return addons
131 |
132 | def get_channels(self):
133 | """Get channel data from this add-on"""
134 | _LOGGER.info('Requesting channels from %s...', self.channels_uri)
135 | if not self.channels_uri:
136 | return []
137 |
138 | try:
139 | data = self._get_data_from_addon(self.channels_uri)
140 | _LOGGER.debug(data)
141 | except Exception as exc: # pylint: disable=broad-except
142 | _LOGGER.error('Something went wrong while calling %s: %s', self.addon_id, exc)
143 | return []
144 |
145 | # Return M3U8-format as-is without headers
146 | if not isinstance(data, dict):
147 | return data.replace('#EXTM3U\n', '')
148 |
149 | # JSON-STREAMS format
150 | if data.get('version', 1) > CHANNELS_VERSION:
151 | _LOGGER.warning('Skipping %s since it uses an unsupported version: %d', self.channels_uri,
152 | data.get('version'))
153 | return []
154 |
155 | channels = []
156 | for channel in data.get('streams', []):
157 | # Check for required fields
158 | if not channel.get('name') or not channel.get('stream'):
159 | _LOGGER.warning('Skipping channel since it is incomplete: %s', channel)
160 | continue
161 |
162 | # Fix logo path to be absolute
163 | if not channel.get('logo'):
164 | channel['logo'] = kodiutils.addon_icon(self.addon_obj)
165 | elif not channel.get('logo').startswith(('http://', 'https://', 'special://', 'resource://', '/')):
166 | channel['logo'] = os.path.join(self.addon_path, channel.get('logo'))
167 |
168 | # Ensure group is a set
169 | if not channel.get('group'):
170 | channel['group'] = set()
171 | # Accept string values (backward compatible)
172 | elif isinstance(channel.get('group'), (bytes, str)):
173 | channel['group'] = set(channel.get('group').split(';'))
174 | # Accept string values (backward compatible, py2 version)
175 | elif sys.version_info.major == 2 and isinstance(channel.get('group'), unicode): # noqa: F821; pylint: disable=undefined-variable
176 | channel['group'] = set(channel.get('group').split(';'))
177 | elif isinstance(channel.get('group'), list):
178 | channel['group'] = set(list(channel.get('group')))
179 | else:
180 | _LOGGER.warning('Channel group is not a list: %s', channel)
181 | channel['group'] = set()
182 | # Add add-on name as group, if not already
183 | channel['group'].add(kodiutils.addon_name(self.addon_obj))
184 |
185 | channels.append(channel)
186 |
187 | return channels
188 |
189 | def get_epg(self):
190 | """Get epg data from this add-on"""
191 | if not self.epg_uri:
192 | return {}
193 |
194 | _LOGGER.info('Requesting epg from %s...', self.epg_uri)
195 | try:
196 | data = self._get_data_from_addon(self.epg_uri)
197 | _LOGGER.debug(data)
198 | except Exception as exc: # pylint: disable=broad-except
199 | _LOGGER.error('Something went wrong while calling %s: %s', self.addon_id, exc)
200 | return {}
201 |
202 | # Return XMLTV-format as-is without headers and footers
203 | if not isinstance(data, dict):
204 | return re.search(r']*>(.*)', data, flags=re.DOTALL).group(1).strip()
205 |
206 | # JSON-EPG format
207 | if data.get('version', 1) > EPG_VERSION:
208 | _LOGGER.warning('Skipping EPG from %s since it uses an unsupported version: %d', self.epg_uri,
209 | data.get('version'))
210 | return {}
211 |
212 | # Check for required fields
213 | if not data.get('epg'):
214 | _LOGGER.warning('Skipping EPG from %s since it is incomplete', self.epg_uri)
215 | return {}
216 |
217 | return data['epg']
218 |
219 | def _get_data_from_addon(self, uri):
220 | """Request data from the specified URI"""
221 | # Plugin path
222 | if uri.startswith('plugin://'):
223 | # Prepare data
224 | sock = self._prepare_for_data()
225 | uri = update_qs(uri, port=sock.getsockname()[1])
226 |
227 | _LOGGER.info('Executing RunPlugin(%s)...', uri)
228 | kodiutils.execute_builtin('RunPlugin', uri)
229 |
230 | # Wait for data
231 | result = self._wait_for_data(sock)
232 |
233 | # Load data
234 | data = json.loads(result)
235 |
236 | return data
237 |
238 | # Currently, only plugin:// uris are supported
239 | raise NotImplementedError
240 |
241 | @staticmethod
242 | def _prepare_for_data():
243 | """Prepare ourselves so we can receive data"""
244 | # Bind on localhost on a free port above 1024
245 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
246 | sock.bind(('localhost', 0))
247 |
248 | _LOGGER.debug('Bound on port %s...', sock.getsockname()[1])
249 |
250 | # Listen for one connection
251 | sock.listen(1)
252 | return sock
253 |
254 | def _wait_for_data(self, sock, timeout=10):
255 | """Wait for data to arrive on the socket"""
256 | # Set a connection timeout
257 | # The remote and should connect back as soon as possible so we know that the request is being processed
258 | sock.settimeout(timeout)
259 |
260 | try:
261 | _LOGGER.debug('Waiting for a connection from %s on port %s...', self.addon_id, sock.getsockname()[1])
262 |
263 | # Accept one client
264 | conn, addr = sock.accept()
265 | _LOGGER.debug('Connected to %s:%s! Waiting for result...', addr[0], addr[1])
266 |
267 | # We have no timeout when the connection is established
268 | conn.settimeout(None)
269 |
270 | # Read until the remote end closes the connection
271 | buf = ''
272 | while True:
273 | chunk = conn.recv(4096)
274 | if not chunk:
275 | break
276 | buf += chunk.decode()
277 |
278 | if not buf:
279 | # We got an empty reply, this means that something didn't go according to plan
280 | raise Exception('Something went wrong in %s' % self.addon_id)
281 |
282 | return buf
283 |
284 | except socket.timeout:
285 | raise Exception('Timout waiting for reply on port %s' % sock.getsockname()[1])
286 |
287 | finally:
288 | # Close our socket
289 | _LOGGER.debug('Closing socket on port %s', sock.getsockname()[1])
290 | sock.close()
291 |
--------------------------------------------------------------------------------
/resources/lib/modules/contextmenu.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Context Menu Module"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | import logging
7 | import re
8 | import sys
9 |
10 | _LOGGER = logging.getLogger(__name__)
11 |
12 |
13 | class ContextMenu:
14 | """Helper class for PVR Context Menu handling"""
15 |
16 | def __init__(self):
17 | """Initialise the Context Menu Module"""
18 |
19 | @staticmethod
20 | def get_direct_uri():
21 | """Retrieve a direct URI from the selected ListItem."""
22 | # We use a clever way / ugly hack (pick your choice) to hide the direct stream in Kodi 18.
23 | # Title [COLOR green]•[/COLOR][COLOR vod="plugin://plugin.video.example/play/whatever"][/COLOR]
24 | label = sys.listitem.getLabel() # pylint: disable=no-member
25 | stream = re.search(r'\[COLOR vod="([^"]+)"\]', label)
26 | return stream.group(1) if stream else None
27 |
--------------------------------------------------------------------------------
/resources/lib/modules/iptvsimple.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """IPTV Simple Module"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | import logging
7 | import os
8 | import time
9 |
10 | import glob
11 | import shutil
12 |
13 | import xbmcvfs
14 |
15 | import dateutil.parser
16 | import dateutil.tz
17 |
18 | from resources.lib import kodiutils
19 |
20 | _LOGGER = logging.getLogger(__name__)
21 |
22 | IPTV_SIMPLE_ID = 'pvr.iptvsimple'
23 | IPTV_SIMPLE_PLAYLIST = 'playlist.m3u8'
24 | IPTV_SIMPLE_EPG = 'epg.xml'
25 |
26 |
27 | class IptvSimple:
28 | """Helper class to setup IPTV Simple"""
29 |
30 | restart_required = False
31 |
32 | def __init__(self):
33 | """Init"""
34 |
35 | @classmethod
36 | def setup(cls):
37 | """Setup IPTV Simple"""
38 | try:
39 | # Install IPTV Simple
40 | kodiutils.execute_builtin('InstallAddon', IPTV_SIMPLE_ID)
41 |
42 | # Activate IPTV Simple so we can get the addon to be able to configure it
43 | cls._activate()
44 | addon = kodiutils.get_addon(IPTV_SIMPLE_ID)
45 | except Exception as exc: # pylint: disable=broad-except
46 | _LOGGER.warning('Could not setup IPTV Simple: %s', str(exc))
47 | return False
48 |
49 | # Deactivate IPTV Simple to hide the "Needs to be restarted" messages
50 | cls._deactivate()
51 |
52 | # Configure IPTV Simple
53 | output_dir = kodiutils.addon_profile()
54 |
55 | addon.setSetting('m3uPathType', '0') # Local path
56 | addon.setSetting('m3uPath', os.path.join(output_dir, IPTV_SIMPLE_PLAYLIST))
57 |
58 | addon.setSetting('epgPathType', '0') # Local path
59 | addon.setSetting('epgPath', os.path.join(output_dir, IPTV_SIMPLE_EPG))
60 | addon.setSetting('epgCache', 'true')
61 | addon.setSetting('epgTimeShift', '0')
62 |
63 | addon.setSetting('logoPathType', '0') # Local path
64 | addon.setSetting('logoPath', '/')
65 |
66 | addon.setSetting('catchupEnabled', 'true')
67 | addon.setSetting('allChannelsCatchupMode', '1')
68 | addon.setSetting('catchupOnlyOnFinishedProgrammes', 'false')
69 |
70 | # Activate IPTV Simple
71 | cls._activate()
72 |
73 | # If iptv simple uses another name than settings.cml for the configuration file then copy the generated settings.xml to that other name
74 | path = xbmcvfs.translatePath(addon.getAddonInfo('profile'))
75 | settingsxml = path + 'settings.xml'
76 | if os.path.isfile(settingsxml):
77 | for file in glob.glob(path + "*.xml"):
78 | if os.path.basename(file) != 'settings.xml':
79 | shutil.copyfile(settingsxml, file)
80 |
81 | return True
82 |
83 | @classmethod
84 | def restart(cls, force=False):
85 | """Restart IPTV Simple"""
86 | if not force and (kodiutils.get_cond_visibility('Pvr.IsPlayingTv') or kodiutils.get_cond_visibility('Pvr.IsPlayingRadio')):
87 | # Don't restart when we are Playing TV or Radio
88 | cls.restart_required = True
89 | _LOGGER.debug('Postponing restart of Simple IPTV since it is currently in use.')
90 | return
91 |
92 | cls.restart_required = False
93 |
94 | cls._deactivate()
95 | time.sleep(1)
96 | cls._activate()
97 |
98 | @staticmethod
99 | def _activate():
100 | """Activate IPTV Simple"""
101 | kodiutils.jsonrpc(method="Addons.SetAddonEnabled", params={"addonid": IPTV_SIMPLE_ID, "enabled": True})
102 |
103 | @staticmethod
104 | def _deactivate():
105 | """Deactivate IPTV Simple"""
106 | kodiutils.jsonrpc(method="Addons.SetAddonEnabled", params={"addonid": IPTV_SIMPLE_ID, "enabled": False})
107 |
108 | @staticmethod
109 | def write_playlist(channels):
110 | """Write playlist data"""
111 | output_dir = kodiutils.addon_profile()
112 |
113 | # Make sure our output dir exists
114 | if not os.path.exists(output_dir):
115 | os.mkdir(output_dir)
116 |
117 | # Write playlist for IPTV Simple
118 | playlist_path = os.path.join(output_dir, IPTV_SIMPLE_PLAYLIST)
119 |
120 | with open(playlist_path + '.tmp', 'wb') as fdesc:
121 | m3u8_data = '#EXTM3U\n'
122 |
123 | for addon in channels:
124 | m3u8_data += '## {addon_name}\n'.format(**addon)
125 |
126 | # RAW M3U8 data
127 | if not isinstance(addon['channels'], list):
128 | m3u8_data += addon['channels']
129 | continue
130 |
131 | # JSON-STREAMS format
132 | for channel in addon['channels']:
133 | m3u8_data += '#EXTINF:-1 tvg-name="{name}"'.format(**channel)
134 | if channel.get('id'):
135 | m3u8_data += ' tvg-id="{id}"'.format(**channel)
136 | if channel.get('logo'):
137 | m3u8_data += ' tvg-logo="{logo}"'.format(**channel)
138 | if channel.get('preset'):
139 | m3u8_data += ' tvg-chno="{preset}"'.format(**channel)
140 | if channel.get('group'):
141 | m3u8_data += ' group-title="{groups}"'.format(groups=';'.join(channel.get('group')))
142 | if channel.get('radio'):
143 | m3u8_data += ' radio="true"'
144 | m3u8_data += ' catchup="vod",{name}\n'.format(**channel)
145 | if channel.get('kodiprops'):
146 | for key, value in channel.get('kodiprops').items():
147 | m3u8_data += '#KODIPROP:{key}={value}\n'.format(key=key, value=value)
148 | m3u8_data += '{stream}\n\n'.format(**channel)
149 |
150 | fdesc.write(m3u8_data.encode('utf-8'))
151 |
152 | # Move new file to the right place
153 | if os.path.isfile(playlist_path):
154 | os.remove(playlist_path)
155 |
156 | os.rename(playlist_path + '.tmp', playlist_path)
157 |
158 | @classmethod
159 | def write_epg(cls, epg_list, channels):
160 | """Write EPG data"""
161 | output_dir = kodiutils.addon_profile()
162 |
163 | # Make sure our output dir exists
164 | if not os.path.exists(output_dir):
165 | os.mkdir(output_dir)
166 |
167 | epg_path = os.path.join(output_dir, IPTV_SIMPLE_EPG)
168 |
169 | # Write XML file by hand
170 | # The reason for this is that it takes less memory to write the file line by line then to construct an
171 | # XML object in memory and writing that in one go.
172 | # We can't depend on lxml.etree.xmlfile, since that's not available as a Kodi module
173 | with open(epg_path + '.tmp', 'wb') as fdesc:
174 | fdesc.write('\n'.encode('utf-8'))
175 | fdesc.write('\n'.encode('utf-8'))
176 | fdesc.write('\n'.encode('utf-8'))
177 |
178 | # Write channel info
179 | for addon in channels:
180 | for channel in addon.get('channels'):
181 | if isinstance(channel, dict) and channel.get('id'):
182 | fdesc.write('\n'.format(id=cls._xml_encode(channel.get('id'))).encode('utf-8'))
183 | fdesc.write(' {name}\n'.format(name=cls._xml_encode(channel.get('name'))).encode('utf-8'))
184 | if channel.get('logo'):
185 | fdesc.write(' \n'.format(logo=cls._xml_encode(channel.get('logo'))).encode('utf-8'))
186 | fdesc.write('\n'.encode('utf-8'))
187 |
188 | for epg in epg_list:
189 | # RAW XMLTV data
190 | if not isinstance(epg, dict):
191 | fdesc.write(epg.encode('utf-8'))
192 | fdesc.write('\n'.encode('utf-8'))
193 | continue
194 |
195 | # Write program info
196 | for _, key in enumerate(epg):
197 | for item in epg[key]:
198 | program = cls._construct_epg_program_xml(item, key)
199 | fdesc.write(program.encode('utf-8'))
200 |
201 | fdesc.write('\n'.encode('utf-8'))
202 |
203 | # Move new file to the right place
204 | if os.path.isfile(epg_path):
205 | os.remove(epg_path)
206 |
207 | os.rename(epg_path + '.tmp', epg_path)
208 |
209 | @classmethod
210 | def _construct_epg_program_xml(cls, item, channel):
211 | """ Generate the XML for the EPG of a program. """
212 | try:
213 | start = dateutil.parser.parse(item.get('start')).strftime('%Y%m%d%H%M%S %z').rstrip()
214 | stop = dateutil.parser.parse(item.get('stop')).strftime('%Y%m%d%H%M%S %z').rstrip()
215 | title = item.get('title', '')
216 |
217 | # Add an icon ourselves in Kodi 18
218 | if kodiutils.kodi_version_major() < 19 and item.get('stream'):
219 | # We use a clever way to hide the direct URI in the label so Kodi 18 can access the it
220 | title = '%s [COLOR green]•[/COLOR][COLOR vod="%s"][/COLOR]' % (
221 | title, item.get('stream')
222 | )
223 |
224 | program = '\n'.format(
225 | start=start,
226 | stop=stop,
227 | channel=cls._xml_encode(channel),
228 | vod=' catchup-id="%s"' % cls._xml_encode(item.get('stream')) if item.get('stream') else '')
229 |
230 | program += ' {title}\n'.format(
231 | title=cls._xml_encode(title))
232 |
233 | if item.get('subtitle'):
234 | program += ' {subtitle}\n'.format(
235 | subtitle=cls._xml_encode(item.get('subtitle')))
236 |
237 | if item.get('description'):
238 | program += ' {description}\n'.format(
239 | description=cls._xml_encode(item.get('description')))
240 |
241 | if item.get('credits'):
242 | program += ' \n'
243 | for credit in item.get('credits'):
244 | # IPTV Simple only supports `actor`, `director` and `writer`, so we need to narrow the options down.
245 | # actor -> actor (with optional role)
246 | # director -> director
247 | # writer -> writer
248 | # adapter -> writer
249 | # producer -> director
250 | # composer -> writer
251 | # editor -> writer
252 | # presenter -> actor
253 | # commentator -> actor
254 | # guest -> actor
255 |
256 | if credit.get('type') == 'actor':
257 | if credit.get('role'):
258 | program += ' {name}\n'.format(role=cls._xml_encode(credit.get('role')),
259 | name=cls._xml_encode(credit.get('name')))
260 | else:
261 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
262 | elif credit.get('type') == 'director':
263 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
264 | elif credit.get('type') == 'writer':
265 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
266 | elif credit.get('type') == 'adapter':
267 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
268 | elif credit.get('type') == 'producer':
269 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
270 | elif credit.get('type') == 'composer':
271 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
272 | elif credit.get('type') == 'editor':
273 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
274 | elif credit.get('type') == 'presenter':
275 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
276 | elif credit.get('type') == 'commentator':
277 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
278 | elif credit.get('type') == 'guest':
279 | program += ' {name}\n'.format(name=cls._xml_encode(credit.get('name')))
280 |
281 | program += ' \n'
282 |
283 | if item.get('date'):
284 | program += ' {date}\n'.format(
285 | date=cls._xml_encode(item.get('date')))
286 |
287 | if item.get('genre'):
288 | if isinstance(item.get('genre'), list):
289 | for genre in item.get('genre'):
290 | program += ' {genre}\n'.format(
291 | genre=cls._xml_encode(genre))
292 | else:
293 | program += ' {genre}\n'.format(
294 | genre=cls._xml_encode(item.get('genre')))
295 |
296 | if item.get('image'):
297 | program += ' \n'.format(
298 | image=cls._xml_encode(item.get('image')))
299 |
300 | if item.get('episode'):
301 | program += ' {episode}\n'.format(
302 | episode=cls._xml_encode(item.get('episode')))
303 |
304 | program += '\n'
305 | return program
306 |
307 | except Exception as exc: # pylint: disable=broad-except
308 | # When we encounter an error, log an error, but don't error out for the other programs
309 | _LOGGER.error('Could not parse item: %s', item)
310 | _LOGGER.exception(exc)
311 | return ''
312 |
313 | @staticmethod
314 | def _xml_encode(value):
315 | """Quick and dirty encoding for XML values"""
316 | if value is None:
317 | return ''
318 | return value \
319 | .replace('&', '&') \
320 | .replace('<', '<') \
321 | .replace('>', '>') \
322 | .replace('"', '"')
323 |
--------------------------------------------------------------------------------
/resources/lib/service.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Background service code"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | import logging
7 | import time
8 |
9 | from xbmc import Monitor
10 |
11 | from resources.lib import kodilogging, kodiutils
12 | from resources.lib.modules.addon import Addon
13 | from resources.lib.modules.iptvsimple import IptvSimple
14 |
15 | _LOGGER = logging.getLogger(__name__)
16 |
17 |
18 | class BackgroundService(Monitor):
19 | """Background service code"""
20 |
21 | def __init__(self):
22 | Monitor.__init__(self)
23 | self._restart_required = False
24 |
25 | def run(self):
26 | """Background loop for maintenance tasks"""
27 | _LOGGER.debug('Service started')
28 |
29 | # Service loop
30 | while not self.abortRequested():
31 | # Check if we need to do an update
32 | if self._is_refresh_required():
33 | Addon.refresh()
34 |
35 | # Check if IPTV Simple needs to be restarted
36 | if IptvSimple.restart_required:
37 | IptvSimple.restart()
38 |
39 | # Stop when abort requested
40 | if self.waitForAbort(30):
41 | break
42 |
43 | _LOGGER.debug('Service stopped')
44 |
45 | @staticmethod
46 | def _is_refresh_required():
47 | """Returns if we should trigger an update based on the settings."""
48 | refresh_interval = kodiutils.get_setting_int('refresh_interval', 24) * 3600
49 | last_refreshed = kodiutils.get_setting_int('last_refreshed', 0)
50 | return (last_refreshed + refresh_interval) <= time.time()
51 |
52 |
53 | def run():
54 | """Run the BackgroundService"""
55 | kodilogging.config()
56 | BackgroundService().run()
57 |
--------------------------------------------------------------------------------
/resources/screenshot01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/screenshot01.jpg
--------------------------------------------------------------------------------
/resources/screenshot02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/screenshot02.jpg
--------------------------------------------------------------------------------
/resources/screenshot03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/screenshot03.jpg
--------------------------------------------------------------------------------
/resources/screenshot04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/screenshot04.png
--------------------------------------------------------------------------------
/resources/screenshot05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/screenshot05.png
--------------------------------------------------------------------------------
/resources/screenshot06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/add-ons/service.iptv.manager/382c90d40d84988b883083ca117d35e4ac34e8f7/resources/screenshot06.png
--------------------------------------------------------------------------------
/resources/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/service.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Service entry point"""
3 |
4 | from __future__ import absolute_import, division, unicode_literals
5 |
6 | from resources.lib import service
7 |
8 | service.run()
9 |
--------------------------------------------------------------------------------