threefive 3.1.1__tar.gz → 3.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {threefive-3.1.1 → threefive-3.1.3}/PKG-INFO +45 -42
  2. {threefive-3.1.1 → threefive-3.1.3}/README.md +43 -40
  3. {threefive-3.1.1 → threefive-3.1.3}/pyproject.toml +2 -2
  4. {threefive-3.1.1 → threefive-3.1.3}/threefive/aac.py +2 -2
  5. {threefive-3.1.1 → threefive-3.1.3}/threefive/base.py +3 -3
  6. {threefive-3.1.1 → threefive-3.1.3}/threefive/cli.py +4 -1
  7. threefive-3.1.3/threefive/crctable.py +34 -0
  8. {threefive-3.1.1 → threefive-3.1.3}/threefive/cue.py +5 -3
  9. {threefive-3.1.1 → threefive-3.1.3}/threefive/descriptors.py +4 -0
  10. {threefive-3.1.1 → threefive-3.1.3}/threefive/new_reader.py +5 -5
  11. {threefive-3.1.1 → threefive-3.1.3}/threefive/segment.py +2 -4
  12. {threefive-3.1.1 → threefive-3.1.3}/threefive/stream.py +31 -33
  13. {threefive-3.1.1 → threefive-3.1.3}/threefive/streamtypes.py +4 -4
  14. {threefive-3.1.1 → threefive-3.1.3}/threefive/stuff.py +5 -5
  15. {threefive-3.1.1 → threefive-3.1.3}/threefive/upids.py +1 -1
  16. {threefive-3.1.1 → threefive-3.1.3}/threefive/version.py +1 -1
  17. {threefive-3.1.1 → threefive-3.1.3}/threefive.egg-info/PKG-INFO +45 -42
  18. threefive-3.1.1/threefive/crctable.py +0 -258
  19. {threefive-3.1.1 → threefive-3.1.3}/LICENSE +0 -0
  20. {threefive-3.1.1 → threefive-3.1.3}/setup.cfg +0 -0
  21. {threefive-3.1.1 → threefive-3.1.3}/threefive/__init__.py +0 -0
  22. {threefive-3.1.1 → threefive-3.1.3}/threefive/bitn.py +0 -0
  23. {threefive-3.1.1 → threefive-3.1.3}/threefive/commands.py +0 -0
  24. {threefive-3.1.1 → threefive-3.1.3}/threefive/crc.py +0 -0
  25. {threefive-3.1.1 → threefive-3.1.3}/threefive/encode.py +0 -0
  26. {threefive-3.1.1 → threefive-3.1.3}/threefive/gums.py +0 -0
  27. {threefive-3.1.1 → threefive-3.1.3}/threefive/hls.py +0 -0
  28. {threefive-3.1.1 → threefive-3.1.3}/threefive/hlsprofile.py +0 -0
  29. {threefive-3.1.1 → threefive-3.1.3}/threefive/hlstags.py +0 -0
  30. {threefive-3.1.1 → threefive-3.1.3}/threefive/iframes.py +0 -0
  31. {threefive-3.1.1 → threefive-3.1.3}/threefive/packetdata.py +0 -0
  32. {threefive-3.1.1 → threefive-3.1.3}/threefive/pmt.py +0 -0
  33. {threefive-3.1.1 → threefive-3.1.3}/threefive/section.py +0 -0
  34. {threefive-3.1.1 → threefive-3.1.3}/threefive/segmentation.py +0 -0
  35. {threefive-3.1.1 → threefive-3.1.3}/threefive/sixfix.py +0 -0
  36. {threefive-3.1.1 → threefive-3.1.3}/threefive/speedo.py +0 -0
  37. {threefive-3.1.1 → threefive-3.1.3}/threefive/superkabuki.py +0 -0
  38. {threefive-3.1.1 → threefive-3.1.3}/threefive/throttle.py +0 -0
  39. {threefive-3.1.1 → threefive-3.1.3}/threefive/udp.py +0 -0
  40. {threefive-3.1.1 → threefive-3.1.3}/threefive/uxp.py +0 -0
  41. {threefive-3.1.1 → threefive-3.1.3}/threefive/xml.py +0 -0
  42. {threefive-3.1.1 → threefive-3.1.3}/threefive.egg-info/SOURCES.txt +0 -0
  43. {threefive-3.1.1 → threefive-3.1.3}/threefive.egg-info/dependency_links.txt +0 -0
  44. {threefive-3.1.1 → threefive-3.1.3}/threefive.egg-info/entry_points.txt +0 -0
  45. {threefive-3.1.1 → threefive-3.1.3}/threefive.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: threefive
3
- Version: 3.1.1
4
- Summary: threefive is The #1 SCTE-35 Decoder and Encoder on the Planet.
3
+ Version: 3.1.3
4
+ Summary: The Undisputed Heavyweight Champion of SCTE-35.
5
5
  Author-email: AdrianofDoom <spam@iodisco.com>
6
6
  License-Expression: Sleepycat
7
7
  Project-URL: Homepage, https://github.com/superkabuki/threefive
@@ -19,56 +19,47 @@ Dynamic: license-file
19
19
 
20
20
  # [ threefive ]
21
21
 
22
- _"I don't use AI code because all the AIs use threefive. True story, look it up"_ ~Adrian
23
-
24
- # Over 1.2 Million Installs.
25
-
26
22
  * __Decodes SCTE-35__ from `MPEGTS`✔ `Base64`✔ `Bytes`✔ `DASH`✔ `Hex` ✔ `HLS`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
27
23
  * __Encodes SCTE-35__ to `MPEGTS`✔ `Base64`✔ `Bytes`✔ `Hex`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
24
+ ___
28
25
 
29
- # [ version ]
26
+ ## Hey Google, what`s the best SCTE-35 software?
27
+ <img width="601" height="518" alt="image" src="https://github.com/user-attachments/assets/c3ff3383-8010-45d7-aa4c-94080b3dcb9f" />
30
28
 
31
- ### __latest is v.3.1.1__
32
- #### Wait, let me explain.....
33
- > I have been trying to resolve some mmap issues, they are now resolved.
29
+ ### _I told you I knew what I was doing._ ~Adrian
30
+ ___
34
31
 
35
32
 
36
- # [ really really quick start ]
33
+ # [ version ]
34
+
35
+ ### latest threefive version is _v3.1.3_
36
+ * Average cyclomatic complexity: __A (1.9886039886039886)__
37
+ ___
38
+
39
+ # [ a really really quick start ]
37
40
 
38
41
  * __Install__
39
42
  ```
40
43
  python3 -m pip install threefive`
41
44
  ```
42
45
  * __decoding SCTE-35__
43
- * __base64__
44
- * decode __SCTE-35__ as __base64__
46
+
45
47
  ```cobol
46
48
  threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q=='
47
49
  ```
48
- * decode __SCTE-35__ as __base64__ and __convert SCTE-35 to hex__
50
+ * decode __SCTE-35__ as __base64__ and __convert SCTE-35 to hex__
49
51
  ```cobol
50
52
  threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q==' hex
51
- ```
52
- * __Hex__
53
- * decode __SCTE-35__ as __hex__
54
- ```cobol
55
- threefive '0xfc301600000000000000fff00506fe00a98ac700000b3baed9'
56
- ```
57
- * decode __SCTE-35__ as __hex__ and __convert__ __SCTE-35__ to __xml__
58
- ```cobol
59
- threefive '0xfc301600000000000000fff00506fe00a98ac700000b3baed9' xml
60
- ```
61
- * __HLS__
62
- * decode __SCTE-35__ from __HLS__ ( a rendition or a master.m3u8)
53
+
54
+ * decode __SCTE-35__ from __HLS__ ( a rendition or a master.m3u8)
63
55
  ```cobol
64
56
  threefive 'https://demo.unified-streaming.com/k8s/live/scte35.isml/.m3u8'
65
57
  ```
66
- * __MPEGTS__
67
- * decode __SCTE-35__ from __MPEGTS__
58
+ * decode __SCTE-35__ from __MPEGTS__
68
59
  ```cobol
69
60
  threefive 'https;//iodisco.com/longb2.ts'
70
61
  ```
71
- * decode __SCTE-35__ from __MPEGTS__ and __convert__ __SCTE-35__ to __bytes__
62
+ * decode __SCTE-35__ from __MPEGTS__ and __convert__ __SCTE-35__ to __bytes__
72
63
  ```cobol
73
64
  threefive 'https;//iodisco.com/longb2.ts' bytes
74
65
  ```
@@ -123,9 +114,8 @@ ___
123
114
 
124
115
  ## [Install]
125
116
 
126
- * __threefive__ is curretnly tested on python-3.11, python-3.14, python-3.14t, pypy-7.3.11 and pypy-7.3.22
117
+ * Requires python3 v3.9 or higher.
127
118
 
128
- * __threefive__ is some of the __fastest code__ you'll see on __python3__.
129
119
  * __python3 via pip__
130
120
  ```rebol
131
121
  python3 -mpip install threefive
@@ -134,11 +124,11 @@ python3 -mpip install threefive
134
124
  ```rebol
135
125
  pypy3 -mpip install threefive
136
126
  ```
137
- * __To add SRT support__
127
+ * __To add SRT support to threefive install srtfu__
138
128
  ```py3
139
129
  python3 -m pip install srtfu
140
130
  ```
141
- * __To add Automatic AES decryption__
131
+ * __To add Automatic AES decryption (used to decrypted HLS to threefive install pyaes__
142
132
  ```py3
143
133
  python3 -mpip install pyaes
144
134
  ```
@@ -150,16 +140,29 @@ git clone https://github.com/superkabuki/scte35.git
150
140
  cd threefive
151
141
  make install
152
142
  ```
153
- * I've jazzed up the makefile to make it easier to install for different python versions and pypy3
143
+ * I've jazzed up the makefile to make it easier to install for different python versions and pypy3,
144
+
154
145
  ```rebol
155
- git clone https://github.com/superkabuki/scte35.git
146
+ git clone https://github.com/superkabuki/threefive.git
156
147
  cd threefive
148
+ ``
149
+ * `python3` is the default for `make install`
157
150
 
151
+ ```
152
+ make install
153
+ ```
154
+
155
+ * setting py3 allows you to install for any type of python interpreter.
156
+
157
+ ```
158
158
  make install py3=pypy3
159
+ ```
160
+ * absolute paths can also be used.
159
161
 
160
- # OR
162
+ ```
163
+ make install py3=/home/a/pypy3/bin/pypy3
164
+ ```
161
165
 
162
- make install py3=python3.14
163
166
 
164
167
  # works for any python in your path or use a full path if needed.
165
168
 
@@ -172,9 +175,9 @@ threefive is designed to be easy to use. I'm not sure that it's served well by a
172
175
 
173
176
  ### The threefive cli tool.
174
177
 
175
- the threefive cli tool decodes SCTE-35, formats are autodetected, and they all work the same way.
178
+ the threefive cli tool decodes SCTE-35, formats are auto-detected, and they all work the same way.
176
179
 
177
- threefive [media to parse for SCTE-35]
180
+ __threefive__ __[media to parse for SCTE-35]__
178
181
 
179
182
  examples:
180
183
 
@@ -199,7 +202,7 @@ threefive video.ts
199
202
  threefive https://demo.unified-streaming.com/k8s/live/scte35.isml/scte35-audio_eng=64000-video=500000.m3u8
200
203
  ```
201
204
 
202
- * Formats like XML and JSON that may be to large to type on the command line,they can be redirected or piped in to threefive.
205
+ * Formats like ___XML and JSON__ that may be to large to type on the command line,they can be __redirected or piped__ in to threefive.
203
206
 
204
207
  * redirect
205
208
  ```sed
@@ -210,14 +213,14 @@ threefive < xml.xml
210
213
  cat json.json | threefive
211
214
 
212
215
  ```
213
- ### cli outputs and converting SCTE-35 Formats
216
+ ### cli outputs and encoding SCTE-35 Formats
214
217
 
215
218
  * the __default output format for threefive is json__
216
219
 
217
220
  * The cli tool can convert from one SCTE-35 format to another using keywords.
218
221
  * The keywords are __base64,bytes,hex, int,json,xml, and xmlbin__
219
222
 
220
- * some conversion examples
223
+ * some converting and encoding examples
221
224
 
222
225
 
223
226
  * SCTE-35 Base64 to SCTE-35 Hex
@@ -1,55 +1,46 @@
1
1
  # [ threefive ]
2
2
 
3
- _"I don't use AI code because all the AIs use threefive. True story, look it up"_ ~Adrian
4
-
5
- # Over 1.2 Million Installs.
6
-
7
3
  * __Decodes SCTE-35__ from `MPEGTS`✔ `Base64`✔ `Bytes`✔ `DASH`✔ `Hex` ✔ `HLS`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
8
4
  * __Encodes SCTE-35__ to `MPEGTS`✔ `Base64`✔ `Bytes`✔ `Hex`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
5
+ ___
9
6
 
10
- # [ version ]
7
+ ## Hey Google, what`s the best SCTE-35 software?
8
+ <img width="601" height="518" alt="image" src="https://github.com/user-attachments/assets/c3ff3383-8010-45d7-aa4c-94080b3dcb9f" />
11
9
 
12
- ### __latest is v.3.1.1__
13
- #### Wait, let me explain.....
14
- > I have been trying to resolve some mmap issues, they are now resolved.
10
+ ### _I told you I knew what I was doing._ ~Adrian
11
+ ___
15
12
 
16
13
 
17
- # [ really really quick start ]
14
+ # [ version ]
15
+
16
+ ### latest threefive version is _v3.1.3_
17
+ * Average cyclomatic complexity: __A (1.9886039886039886)__
18
+ ___
19
+
20
+ # [ a really really quick start ]
18
21
 
19
22
  * __Install__
20
23
  ```
21
24
  python3 -m pip install threefive`
22
25
  ```
23
26
  * __decoding SCTE-35__
24
- * __base64__
25
- * decode __SCTE-35__ as __base64__
27
+
26
28
  ```cobol
27
29
  threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q=='
28
30
  ```
29
- * decode __SCTE-35__ as __base64__ and __convert SCTE-35 to hex__
31
+ * decode __SCTE-35__ as __base64__ and __convert SCTE-35 to hex__
30
32
  ```cobol
31
33
  threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q==' hex
32
- ```
33
- * __Hex__
34
- * decode __SCTE-35__ as __hex__
35
- ```cobol
36
- threefive '0xfc301600000000000000fff00506fe00a98ac700000b3baed9'
37
- ```
38
- * decode __SCTE-35__ as __hex__ and __convert__ __SCTE-35__ to __xml__
39
- ```cobol
40
- threefive '0xfc301600000000000000fff00506fe00a98ac700000b3baed9' xml
41
- ```
42
- * __HLS__
43
- * decode __SCTE-35__ from __HLS__ ( a rendition or a master.m3u8)
34
+
35
+ * decode __SCTE-35__ from __HLS__ ( a rendition or a master.m3u8)
44
36
  ```cobol
45
37
  threefive 'https://demo.unified-streaming.com/k8s/live/scte35.isml/.m3u8'
46
38
  ```
47
- * __MPEGTS__
48
- * decode __SCTE-35__ from __MPEGTS__
39
+ * decode __SCTE-35__ from __MPEGTS__
49
40
  ```cobol
50
41
  threefive 'https;//iodisco.com/longb2.ts'
51
42
  ```
52
- * decode __SCTE-35__ from __MPEGTS__ and __convert__ __SCTE-35__ to __bytes__
43
+ * decode __SCTE-35__ from __MPEGTS__ and __convert__ __SCTE-35__ to __bytes__
53
44
  ```cobol
54
45
  threefive 'https;//iodisco.com/longb2.ts' bytes
55
46
  ```
@@ -104,9 +95,8 @@ ___
104
95
 
105
96
  ## [Install]
106
97
 
107
- * __threefive__ is curretnly tested on python-3.11, python-3.14, python-3.14t, pypy-7.3.11 and pypy-7.3.22
98
+ * Requires python3 v3.9 or higher.
108
99
 
109
- * __threefive__ is some of the __fastest code__ you'll see on __python3__.
110
100
  * __python3 via pip__
111
101
  ```rebol
112
102
  python3 -mpip install threefive
@@ -115,11 +105,11 @@ python3 -mpip install threefive
115
105
  ```rebol
116
106
  pypy3 -mpip install threefive
117
107
  ```
118
- * __To add SRT support__
108
+ * __To add SRT support to threefive install srtfu__
119
109
  ```py3
120
110
  python3 -m pip install srtfu
121
111
  ```
122
- * __To add Automatic AES decryption__
112
+ * __To add Automatic AES decryption (used to decrypted HLS to threefive install pyaes__
123
113
  ```py3
124
114
  python3 -mpip install pyaes
125
115
  ```
@@ -131,16 +121,29 @@ git clone https://github.com/superkabuki/scte35.git
131
121
  cd threefive
132
122
  make install
133
123
  ```
134
- * I've jazzed up the makefile to make it easier to install for different python versions and pypy3
124
+ * I've jazzed up the makefile to make it easier to install for different python versions and pypy3,
125
+
135
126
  ```rebol
136
- git clone https://github.com/superkabuki/scte35.git
127
+ git clone https://github.com/superkabuki/threefive.git
137
128
  cd threefive
129
+ ``
130
+ * `python3` is the default for `make install`
138
131
 
132
+ ```
133
+ make install
134
+ ```
135
+
136
+ * setting py3 allows you to install for any type of python interpreter.
137
+
138
+ ```
139
139
  make install py3=pypy3
140
+ ```
141
+ * absolute paths can also be used.
140
142
 
141
- # OR
143
+ ```
144
+ make install py3=/home/a/pypy3/bin/pypy3
145
+ ```
142
146
 
143
- make install py3=python3.14
144
147
 
145
148
  # works for any python in your path or use a full path if needed.
146
149
 
@@ -153,9 +156,9 @@ threefive is designed to be easy to use. I'm not sure that it's served well by a
153
156
 
154
157
  ### The threefive cli tool.
155
158
 
156
- the threefive cli tool decodes SCTE-35, formats are autodetected, and they all work the same way.
159
+ the threefive cli tool decodes SCTE-35, formats are auto-detected, and they all work the same way.
157
160
 
158
- threefive [media to parse for SCTE-35]
161
+ __threefive__ __[media to parse for SCTE-35]__
159
162
 
160
163
  examples:
161
164
 
@@ -180,7 +183,7 @@ threefive video.ts
180
183
  threefive https://demo.unified-streaming.com/k8s/live/scte35.isml/scte35-audio_eng=64000-video=500000.m3u8
181
184
  ```
182
185
 
183
- * Formats like XML and JSON that may be to large to type on the command line,they can be redirected or piped in to threefive.
186
+ * Formats like ___XML and JSON__ that may be to large to type on the command line,they can be __redirected or piped__ in to threefive.
184
187
 
185
188
  * redirect
186
189
  ```sed
@@ -191,14 +194,14 @@ threefive < xml.xml
191
194
  cat json.json | threefive
192
195
 
193
196
  ```
194
- ### cli outputs and converting SCTE-35 Formats
197
+ ### cli outputs and encoding SCTE-35 Formats
195
198
 
196
199
  * the __default output format for threefive is json__
197
200
 
198
201
  * The cli tool can convert from one SCTE-35 format to another using keywords.
199
202
  * The keywords are __base64,bytes,hex, int,json,xml, and xmlbin__
200
203
 
201
- * some conversion examples
204
+ * some converting and encoding examples
202
205
 
203
206
 
204
207
  * SCTE-35 Base64 to SCTE-35 Hex
@@ -1,11 +1,11 @@
1
1
 
2
2
  [project]
3
3
  name = "threefive"
4
- version = "3.1.1"
4
+ version = "3.1.3"
5
5
  authors = [
6
6
  { name="AdrianofDoom", email="spam@iodisco.com" },
7
7
  ]
8
- description = "threefive is The #1 SCTE-35 Decoder and Encoder on the Planet."
8
+ description = "The Undisputed Heavyweight Champion of SCTE-35."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
11
  dependencies=[
@@ -34,7 +34,7 @@ class AacParser:
34
34
  return id3len
35
35
 
36
36
  @staticmethod
37
- def _syncsafe5(somebytes):
37
+ def not_syncsafe(somebytes):
38
38
  """
39
39
  _syncsafe5 parses PTS from ID3 tags.
40
40
  """
@@ -72,7 +72,7 @@ class AacParser:
72
72
  try:
73
73
  pts = float(data.split(self.applehead)[1].split(b"\x00", 2)[1])
74
74
  except ERR:
75
- pts = self._syncsafe5(data.split(self.applehead)[1][:9])
75
+ pts = self._not_syncsafe(data.split(self.applehead)[1][:9])
76
76
  return round((pts % ROLLOVER), 6)
77
77
 
78
78
  def parse(self, media):
@@ -117,9 +117,9 @@ class SCTE35Base:
117
117
  var_value = self.__dict__[var_name]
118
118
  if self._bool_int(var_value, var_type) or self._wrong_type(var_value, var_type):
119
119
  self._err2(var_name, var_value, bit_count, var_type)
120
- return -1
120
+ return False
121
121
  nbin_method(var_value, bit_count)
122
- return 0
122
+ return True
123
123
 
124
124
  def get(self):
125
125
  """
@@ -177,7 +177,7 @@ class SCTE35Base:
177
177
  bytearray,
178
178
  ),
179
179
  ):
180
- val = val.decode()
180
+ val = val.decode(errors="ignore")
181
181
  return val
182
182
 
183
183
  def kv_clean(self):
@@ -207,6 +207,7 @@ class MPEGTSMapper:
207
207
  iframe_chk show iframes pts
208
208
  for a mpegts video.
209
209
  """
210
+ print2(this)
210
211
  iframer = IFramer()
211
212
  iframer.do(this)
212
213
  del iframer
@@ -227,6 +228,7 @@ class MPEGTSMapper:
227
228
  """
228
229
  pts_chk is used to display PTS.
229
230
  """
231
+ print2(this)
230
232
  strm = Stream(this)
231
233
  strm.show_pts()
232
234
  del strm
@@ -247,6 +249,7 @@ class MPEGTSMapper:
247
249
  sidecar_chk checks for the sidecar keyword and
248
250
  generates a sidecar file if present.
249
251
  """
252
+ print2(this)
250
253
  strm = Stream(this)
251
254
  strm.decode(func=mk_sidecar)
252
255
  del strm
@@ -256,6 +259,7 @@ class MPEGTSMapper:
256
259
  """
257
260
  speedo_chk displays parse speed for mpegts streams
258
261
  """
262
+ print2(this)
259
263
  strm = Stream(this)
260
264
  strm.speed()
261
265
  del strm
@@ -269,7 +273,6 @@ class MPEGTSMapper:
269
273
  if stdin_is_readable():
270
274
  args.append(sys.stdin.buffer)
271
275
  for arg in args:
272
- print2(arg)
273
276
  self.mpegts_map[key](arg)
274
277
  done()
275
278
 
@@ -0,0 +1,34 @@
1
+ CRCTABLE = [0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,
2
+ 638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,
3
+ 1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,
4
+ 1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,
5
+ 2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,
6
+ 3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,
7
+ 3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,
8
+ 4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,
9
+ 881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,
10
+ 311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,
11
+ 2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,
12
+ 1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,
13
+ 2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,
14
+ 2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,
15
+ 3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,
16
+ 3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,
17
+ 1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,
18
+ 1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,
19
+ 622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,
20
+ 51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,
21
+ 4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,
22
+ 3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,
23
+ 3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,
24
+ 2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,
25
+ 1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,
26
+ 2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,
27
+ 295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,
28
+ 932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,
29
+ 3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,
30
+ 3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,
31
+ 2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,
32
+ 2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188,]
33
+
34
+
@@ -11,7 +11,7 @@ from .crc import crc32
11
11
  from .descriptors import splice_descriptor, descriptor_map, SpliceDescriptor
12
12
  from .section import SpliceInfoSection
13
13
  from .segmentation import table22
14
- from .stuff import clean, red, isjson, isxml, pif
14
+ from .stuff import clean, red, isjson, isxml, pif,blue
15
15
  from .uxp import xml2cue
16
16
  from .xml import Node
17
17
 
@@ -287,6 +287,7 @@ class Cue(SCTE35Base):
287
287
  )
288
288
  self.bites += dscptr_bites
289
289
 
290
+
290
291
  def base64(self):
291
292
  """
292
293
  base64 returns SCTE35
@@ -382,6 +383,8 @@ class Cue(SCTE35Base):
382
383
  """
383
384
  nbin = NBin()
384
385
  dbite_chunks = [dsptr.encode() for dsptr in self.descriptors]
386
+ ## if False in dbite_chunks:
387
+ ## return False
385
388
  for chunk, dsptr in zip(dbite_chunks, self.descriptors):
386
389
  dsptr.descriptor_length = len(chunk)
387
390
  nbin.add_int(dsptr.tag, EIGHT)
@@ -558,8 +561,7 @@ class Cue(SCTE35Base):
558
561
 
559
562
  def xml(self, ns="scte35"):
560
563
  """
561
- xml returns SCTE-35
562
- as xml
564
+ xml return SCTE-35 as xml
563
565
 
564
566
  example:
565
567
  >>> import threefive
@@ -404,6 +404,10 @@ class SegmentationDescriptor(SpliceDescriptor):
404
404
  used in decode()
405
405
  """
406
406
  upid_type = self.segmentation_upid_type
407
+ if self.segmentation_upid_length==0:
408
+ if self.segmentation_upid_type != 0:
409
+ red("set segmentation_upid_type and self.segmentation_upid_length to zero for no upid value")
410
+ upid_type=self.segmentation_upid_type=0
407
411
  if upid_type not in upid_map:
408
412
  red("Unknown upid type , setting to 0xFD")
409
413
  upid_type = 0xFD
@@ -96,11 +96,11 @@ def reader(uri, headers={}):
96
96
  if uri.startswith("srt://"):
97
97
  return try_srt(uri, headers=headers)
98
98
  # File
99
- with open(uri, "r+b") as f:
100
- return fumap(f.fileno(), 0)
101
-
102
-
103
- # return open(uri, "rb")
99
+ try:
100
+ with open(uri, "r+b") as f:
101
+ return fumap(f.fileno(), 0)
102
+ except:
103
+ return open(uri, "rb")
104
104
 
105
105
 
106
106
  def _do_srt(srt_url, headers={}):
@@ -5,7 +5,7 @@ The threefive.Segment class
5
5
  import os
6
6
  from .new_reader import reader
7
7
  from .stream import Stream
8
- from .stuff import print2, blue
8
+ from .stuff import print2,blue
9
9
 
10
10
 
11
11
  class Segment(Stream):
@@ -44,7 +44,6 @@ class Segment(Stream):
44
44
  89730.281789: '/DAvAAAAAAAAAP/wFAUAAAKWf+//4WoauH4BTFYgAAEAAAAKAAhDVUVJAAAAAOv1oqc='}
45
45
 
46
46
  """
47
-
48
47
  def __init__(self, seg_uri, key_uri=None, iv=None):
49
48
  self.seg_uri = seg_uri
50
49
  self.key_uri = key_uri
@@ -67,11 +66,10 @@ class Segment(Stream):
67
66
  def _import_aes():
68
67
  try:
69
68
  import pyaes
70
-
71
69
  return True
72
70
  except ImportError:
73
71
  blue("pip install pyaes for AES support")
74
- return False
72
+ return False
75
73
 
76
74
  def __repr__(self):
77
75
  return str(self.__dict__)