diff --git a/README.md b/README.md index 6a056ec..b04cf61 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,12 @@ You need to enter your IPTV provider's details to Settings. When you save, if yo -## Future Work +## Disclaimer + +This application bundles [a list of publicly available IPTV channels](https://github.com/iptv-org/iptv) from around the world. The channels are not hosted by this application or respective repository. The application simply creates a convenient way to browse a publicly available media database. The developer of this application has no affiliation with the content providers. The content provided can be removed at any time and we have no control over it. The developer assumes no liability and is not responsible for any legal issues caused by the misuse of this application. + +No video files are stored in this repository, the application bundles open-sourced [iptv-org](https://github.com/iptv-org/iptv) playlist for quick startup, users can delete that playlist entry if they want to from their computer. If any links/channels in this application infringe on your rights as a copyright holder, they may be removed by sending a [pull request](https://github.com/iptv-org/iptv/pulls) or opening an [issue](https://github.com/iptv-org/iptv/issues/new?assignees=freearhey&labels=removal+request&template=--removal-request.yml&title=Remove%3A+). However, note that we have **no control** over the destination of the link, and just removing the link from the playlist will not remove its contents from the web. Note that linking does not directly infringe copyright because no copy is made on the site providing the link, and thus this is **not** a valid reason to send a DMCA notice to GitHub. To remove this content from the web, you should contact the web host that's actually hosting the content (**not** GitHub, nor the maintainers of this repository). -- UI work will be done -- Need to check Linux HWAccels ## Contributing diff --git a/package.json b/package.json index a022859..465fa18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "PiTV", - "version": "1.0.3-beta1", + "version": "1.1.0", "description": "A cross-platform STB (IPTV) player client.", "main": ".webpack/main", "scripts": { @@ -43,12 +43,12 @@ "bulma-prefers-dark": "^0.1.0-beta.1", "classic-level": "^1.2.0", "cors": "^2.8.5", + "electron-squirrel-startup": "^1.0.0", "express": "^4.18.2", "ffmpeg-static": "^5.1.0", "fluent-ffmpeg": "^2.1.2", "react": "^18.2.0", "react-dom": "^18.2.0", - "electron-squirrel-startup": "^1.0.0", "sass": "^1.56.1", "through2": "^4.0.2", "video.js": "^7.20.3" diff --git a/src/App.jsx b/src/App.jsx index dbb6e5d..29db73a 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,24 +6,21 @@ import './App.scss'; const App = () => { // stb or m3u => if true it is stb, else it is m3u - const [stb, setStb] = useState(false) const [modalState, setModalState] = useState(false) // take json state as account for the server url and mac address - const [currentStbAccount, setCurrentStbAccount] = useState({ url: "", mac: "" }) - const [stbAccounts, setStbAccounts] = useState([]) - + let [config, setConfig] = useState(undefined) + const [selected, setSelected] = useState(0) + const [reload, setReload] = useState(false) // get selected channel from channelList - const [selectedChannel, setSelectedChannel] = useState(undefined) - - const [serverUrl, setServerUrl] = useState("") - const [macAddress, setMacAddress] = useState("") - const [fullScreen, setFullScreen] = useState(true) - const [reload, setReload] = useState(true) const toggleModal = () => { setModalState(!modalState) } + useEffect(() => { + loadData(); + }, [modalState]) + useEffect(() => { loadData(); }, []) @@ -31,8 +28,8 @@ const App = () => { const loadData = async () => { const response = await fetch("http://localhost:8000/config") const data = await response.json() - setMacAddress(data.data[0].mac) - setServerUrl(data.data[0].url) + setConfig(data) + setSelected(data.selected) } const saveData = async () => { @@ -41,17 +38,9 @@ const App = () => { headers: { 'Content-Type': 'application/json', }, - body: JSON.stringify({ - "selected": 1, - "data": [ - { "type": "STB", "url": serverUrl, "mac": macAddress }, - { "type": "STB", "url": "", "mac": "00:1A:79:xx:xx:xx", "channel_list": [] }, - { "type": "M3U8", "url": "" } - ] - }) + body: JSON.stringify(config), }) const data = await response.json() - setReload(!reload) setModalState(!modalState) } @@ -59,11 +48,14 @@ const App = () => {
Server URL (http://example.com:1234):
- { - setServerUrl(e.target.value) - }}> -MAC Address (00:1A:79:xx:xx:xx):
- { - setMacAddress(e.target.value) - }}> -Server URL (http://example.com:1234):
+ { + let configx = JSON.parse(JSON.stringify(config)); + configx.data[selected].url = e.target.value; + setConfig(configx); + } + }> +MAC Address (00:1A:79:xx:xx:xx):
+ { + let configx = JSON.parse(JSON.stringify(config)); + configx.data[selected].mac = e.target.value; + setConfig(configx); + } + }> +File:
+ { + let configx = JSON.parse(JSON.stringify(config)) + configx.data[selected].url = e.target.files[0].name; + setConfig(configx); + }}> +