Git Product home page Git Product logo

Comments (2)

garbled1 avatar garbled1 commented on June 17, 2024

It works on a VM, here is what I learned:

  1. I couldn't get it to work sanely without specifying both CONFIG_PATH and HOST_IP on the commandline.
  2. When you go to plex to bind a device, immediately go back to the bind page, and click the check linked box.
  3. Once you do that, you should now see a data.json file in the config path. Now when you restart this service, it will remember the bindings, and everything just works.
  4. Yes, you need to run this at all times you want to proxy DLNA.
  5. Yes, it works fine on a VM, I have only ever tried it on a VM.

My setup was to build a venv for it, in it's own directory somewhere, and then a quick service file. I also created a local user to run it.

[Unit]
Description=PlexDLNAPlayer
Documentation=https://github.com/songchenwen/plexdlnaplayer
After=network-online.target

[Service]
User=plexdlna
Type=simple
Environment=HOST_IP=xxxxxx
Environment=CONFIG_PATH=/home/plexdlna/config
WorkingDirectory=/opt/plexdlnaplayer
ExecStart=/opt/plexdlnaplayer/venv/bin/python3 /opt/plexdlnaplayer/main.py
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target

from plexdlnaplayer.

FrankSausF avatar FrankSausF commented on June 17, 2024

Cheers garbled1,

I'm not gone; I'm still chewing on it...

It does not work out, and I don't yet understand why.
I had been trapped to run int from the command prompt before running it as a service.
And it seems to recognise all my players, adding them to the settings file it produces.
But it is not able to make reliable contact, though registration looks OK in plex.tv.
And stopping the script will break the web service at the port given in config ("Error 500"), so I will have to edit config with another port and fire it up again...
Probably, I'll have to get deeper into the question of configuration parameters as a service like you did.

I'm still fiddling with the procedure which - discontinued at this time of Christmas leftovers dinner preparations - looks like the follwing:
1.) Install pip for Python 3:
sudo apt install python3-pip
Check the installation:
pip3 -V
2.) Create and use a virtual environment for the Python application:
sudo apt install python3-venv
sudo python3 -m venv /opt/plexdlna
cd /opt/
3.) Get rid of the sudo stuff, assuming, the currently loggen-on user is member of group www-data:
sudo chgrp -c -R www-data /opt/plexdlna
sudo chmod g+w plexdlna/
4.) Clone the github to the directory of the new application:
source plexdlna/bin/activate
cd plexdlna
git clone https://github.com/songchenwen/plexdlnaplayer.git
mkdir config
cd plexdlnaplayer
4.) Install the required pip modules:
sudo pip install -r requirements.txt
5.) Edit the configuration file:
nano /opt/plexdlna/plexdlnaplayer/settings/init.py
--> Edit line config_path = "/opt/plexdlna/config/"
--> Edit line host_ip = "192.68.2.71"
6.) Fire everything up initially:
cd /opt/plexdlna/plexdlnaplayer
sudo python3 main.py
7.) Quickly register the players and check them as registered.

Result is that I can register my player, they even appear in the web interface from time to time.
I can read their status entries coming through the console, so they are talking to the python.
But they don't play what they should...

from plexdlnaplayer.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.