https://github.com/futzu/new_reader
The hottest tool nobody is using,Read multicast, udp, http(s), and stdin just like a file. All Hail new_reader!
https://github.com/futzu/new_reader
adrianofdoom boobs https iheartbegode multicast plan9 python3 reader udp
Last synced: 5 months ago
JSON representation
The hottest tool nobody is using,Read multicast, udp, http(s), and stdin just like a file. All Hail new_reader!
- Host: GitHub
- URL: https://github.com/futzu/new_reader
- Owner: futzu
- Created: 2022-06-29T11:48:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-16T08:59:54.000Z (about 1 year ago)
- Last Synced: 2025-07-26T19:44:36.103Z (6 months ago)
- Topics: adrianofdoom, boobs, https, iheartbegode, multicast, plan9, python3, reader, udp
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `new_reader`
## Read `stdin`, `files`, `multicast`, `udp`, and `http(s)` URIs the same way.
```python3
from new_reader import reader
rdr = reader('udp://@235.35.3.5:3535')
rdr.read()
```
## latest version is `0`.`1`.`11`
* Critical Fix for Multicast

## new_reader is used by [`threefive`](https://github.com/futzu/threefive), [`x9k3`](https://github.com/futzu/x9k3), [`gumd`](https://github.com/futzu/gumd), [`m3ufu`](https://github.com/futzu/m3ufu), [`superkabuki`](https://github.com/futzu/superkabuki), [`iframes`](https://github.com/futzu/iframes) , [`umzz`](https://github.com/futzu/umzz),[`showcues`](https://github.com/futzu/showcues),[`six2scte35`](https://github.com/futzu/six2scte35)and [`sideways`](https://github.com/futzu/sideways).
## How is `new_reader.reader` used?
```js
# print a mpegts packet header via https
>>>> from new_reader import reader
>>>> with reader('https://so.slo.me/longb.ts') as rdr:
.... packet = rdr.read(188)
.... print(packet[:4])
....
b'G@\x11\x10'
```
#### | more
- [x] `Files`
```js
from new_reader import reader
with reader("/home/you/video.ts") as data:
fu = data.read()
```
- [x] `HTTP(S)`
```js
from new_reader import reader
with reader('http://iodisco.com/') as disco:
disco.read()
# Add http headers like this
with reader('http://iodisco.com/',headers={"myHeader":"DOOM"}) as doom:
doom.read()
```
- [x] `Multicast`
```smalltalk
from new_reader import reader
with reader("udp://@227.1.3.10:4310") as data:
data.read(8192)
```
- [x] `UDP`
```lua
from new_reader import reader
udp_data =reader("udp://1.2.3.4:5555")
chunks = [udp_data.read(188) for i in range(0,1024)]
udp_data.close()
```
### `UDP` and `Multicast`
* reader will set `socket.SO_RCVBUF` to the maximum value allowed by the OS for `UDP` and `Multicast`.
* `socket.SO_RCVBUF` can also be set like this:
* On `OpenBSD`
```js
sysctl net.inet.udp.recvspace
```
* On `Linux`
```js
sysctl -w net.core.rmem_max=6815744
```
* On `Windows`
```js
I.have.no.idea
```