tellytv / telly

An IPTV proxy
MIT License
760 stars 104 forks source link

How to I run as a service in Linux #175

Closed ikolsteren closed 6 years ago

ikolsteren commented 6 years ago

Want to run Telly as a service on my raspberry pi Using the config file and working fine Currently both are in /home/pi/telly folder I have tried a few different things from reading on the web but no success

I made this /lib/systemd/system/telly.service

[Unit] Description=TELLY IPTV service After=network.target StartLimitIntervalSec=0

[Service] Type=simple Restart=always RestartSec=1800 User=pi ExecStart=/home/pi/telly/telly

[Install] WantedBy=multi-user.target

used the systemctl start telly and no luck

tombowditch commented 6 years ago

Please provide logs and errors

ikolsteren commented 6 years ago

Looks like I am getting further.
Moved the config file to /etc/telly Service is working but some weird message. I am getting that at the command prompt too so could be a issue with Vader’s at the moment. Will try again in a bit

Aug 29 07:15:34 homebridge telly[835]: time="2018-08-29T07:15:34-04:00" level=info msg="Loading M3U from http://api.vaders.tv/vget?username=REDACTED&password=REDACTED$&vod=false&format=ts" Aug 29 07:15:36 homebridge telly[835]: time="2018-08-29T07:15:36-04:00" level=info msg="Loading XMLTV from http://vaders.tv/p2.xml.gz" Aug 29 07:15:37 homebridge telly[835]: time="2018-08-29T07:15:37-04:00" level=info msg="File (http://vaders.tv/p2.xml.gz) is gzipp'ed, ungzipping now, this might take a while" Aug 29 07:15:54 homebridge telly[835]: time="2018-08-29T07:15:54-04:00" level=error msg="Could not decode xmltv programme" error="the type Date field of date is not a time, value is: 1991|2001" Aug 29 07:15:54 homebridge telly[835]: time="2018-08-29T07:15:54-04:00" level=error msg="error when parsing EPG" error="the type Date field of date is not a time, value is: 1991|2001" Aug 29 07:15:54 homebridge telly[835]: time="2018-08-29T07:15:54-04:00" level=error msg="error when preparing provider" error="the type Date field of date is not a time, value is: 1991|2001" Aug 29 07:15:54 homebridge telly[835]: time="2018-08-29T07:15:54-04:00" level=error msg="error when processing provider" error="the type Date field of date is not a time, value is: 1991|2001" Aug 29 07:15:54 homebridge telly[835]: time="2018-08-29T07:15:54-04:00" level=info msg="telly is live and on the air!" Aug 29 07:15:54 homebridge telly[835]: time="2018-08-29T07:15:54-04:00" level=info msg="Broadcasting from http://192.168.86.33:6077/" Aug 29 07:15:54 homebridge telly[835]: time="2018-08-29T07:15:54-04:00" level=info msg="EPG URL: http://192.168.86.33:6077/epg.xml"

ikolsteren commented 6 years ago

Might be a problem with Vaders files as it is failing on another Telly instance I am running on a windows box "Could not decode xmltv programme" error="the type Date field of date is not a time, value is: 1991|2001"

vaski666 commented 6 years ago

Hi ikolsteren Not to highjack your issue, but i see that same error message today on both vaders EPG list and IPTV-EPG list.

ikolsteren commented 6 years ago

I think that is the issue now and no longer how to run as a service. Looks like I figured out the service from the log as my config file wasn’t readable it seems.

puzl commented 6 years ago

It seems the BT Sport2 has a bad date. Probably best to fix this in tellytv

vaski666 commented 6 years ago

Hi puzl, i can confirm that removing BT sports 2 from my EPG fixed the bad date issue

ikolsteren commented 6 years ago

How did you remove? I took out United Kingdom from the filter list and not working. Is there a better way?

vaski666 commented 6 years ago

Here is the faulty EPG listing:

<programme channel="BTSport2.uk" start="20180904030000 +0000" stop="20180904033000 +0000">
    <title lang="en">Leicester City v Watford 1984/85</title>
    <desc lang="en">We delve into the Match of the Day archives to revisit highlights of the 1984/85 First Division clash between Leicester City and Graham Taylor's Watford at Filbert Street</desc>
    <category lang="en">Sport</category>
    <icon src="https://images.metadata.sky.com/pd-image/52a8b52e-4211-475d-b95c-767fa64ce935/16-9" />
    <episode-num system="xmltv_ns">.33.</episode-num>
    </programme>
<programme channel="BTSport2.uk" start="20180904033000 +0000" stop="20180904040000 +0000">
    <title lang="en">Arsenal Classics</title>
    <desc lang="en">Classic Arsenal matches from the football archives, featuring a memorable league clash with Aston Villa (1991) and a League Cup third round win over Manchester United . 3/8</desc>
    <date>1991|2001</date>
    <category lang="en">Sport</category>
    <icon src="https://images.metadata.sky.com/pd-image/b24bc05c-92cd-42b6-be67-45f90c60b521/16-9" />
    <episode-num system="xmltv_ns">.24.</episode-num>
    </programme>
ikolsteren commented 6 years ago

I am using the new config file and pulling in the XML and EPG automatically so don’t have a local copy. Can I filter?

vaski666 commented 6 years ago

ikolsteren, you will need to somehow remove the channel from the EPG list. I have the possibility to manually remove channels from my m3u and EPG list using iptv-epg.com as an inbetween. I'm not sure how to do this directly

puzl commented 6 years ago

@vaski666 how do you get telly to load the xml from iptv-epg.com? Are you using the dev branch or master?

vaski666 commented 6 years ago

I am using the DEV branch. Reading you post closer i saw that you were referring to the XML not the m3u... :-)

ikolsteren commented 6 years ago

Hmmm, not using iptv-epg. Got the guide pulling from Telly the night before and all being pulled from Telly Might have to wait for the game to air to run again as I think it pulls everything regardless if it is my channel list is filtered. I don't want to pay for a service like iptv-epg yet as I think I had working well now

chazlarson commented 6 years ago

The dev branch telly loads EPG XML; see the readme for examples which include IPTV_EPG. If you're using the master branch, enter your iptv-epg link when Plex asks for your EPG source.

chazlarson commented 6 years ago

Also, anywhere you enter an M3U or XML URL you can also use a path to a file.

[[Source]]
  Provider = "Custom"
  M3U = "http://myprovider.com/playlist.m3u"  # These can be either URLs or fully-qualified paths.
  EPG = "http://myprovider.com/epg.xml"

OR

[[Source]]
  Provider = "Custom"
  M3U = "/opt/bing/bang/boing/playlist.m3u"  # These can be either URLs or fully-qualified paths.
  EPG = "/opt/zing/zang/zoing/epg.xml"
ikolsteren commented 6 years ago

how do i filter out that channel from the loaded epg xml? Love that added feature as made the integration to plex great

chazlarson commented 6 years ago

There isn't any built-in EPG filtering yet.

chazlarson commented 6 years ago

Please take further questions to the support channel on discord so we can keep this issue targeted.

Are you having any continuing problems with running telly as a service under Linux?

ikolsteren commented 6 years ago

No issue with the service I don't think. But due to the EPG issue and the way I have setup using the new beta and config file I can't get telly to run with any channels. Since it has the error no channels load and nothing is working. Using vaders XMLTV and EPG listings. Telly pulls in no channels as a result

chazlarson commented 6 years ago

What's in the config file? [remember to redact credentials] This is almost certainly a filtering issue.

ikolsteren commented 6 years ago

Telly config here:

[Discovery] # most likely you won't need to change anything here
  Device-Auth = "telly123" # These settings are all related to how telly identifies
  Device-ID = 12345678 # itself to Plex.
  Device-UUID = ""
  Device-Firmware-Name = "hdhomeruntc_atsc"
  Device-Firmware-Version = "20150826"
  Device-Friendly-Name = "telly"
  Device-Manufacturer = "Silicondust"
  Device-Model-Number = "HDTC-2US"
  SSDP = true

[IPTV]
  Streams = 5 # number of simultaneous streams that the telly virtual DVR will provide
                            # This is often 1, but is set by your iptv provider; for example,
                            # Vaders provides 5
  Starting-Channel = 1 # When telly assigns channel numbers it will start here
  XMLTV-Channels = true # if true, any channel numbers specified in your M3U file will be used.
  FFMpeg = true # if true, streams are buffered through ffmpeg; ffmpeg must be on your $PATH
                            # if you want to use this with Docker, be sure you use the correct
                            # docker image

[Log]
  Level = "info" # Only log messages at or above the given level. [debug, info, warn, error, fatal]
  Requests = true # Log HTTP requests made to telly
[Web]
  Base-Address = "192.168.XX.XX:6077" # Set this to the IP address of the machine telly runs on
  Listen-Address = "192.168.XX.XX:6077" # this can stay as-is
#[SchedulesDirect] # If you have a Schedules Direct account, fill in details and then
# UNCOMMENT THIS SECTION
#  Username = "" # This is under construction; Vader is the only provider Password = "" # that
#  works with it fully at this time
[[Source]]
Name = "Vaders" # Name is optional and is used mostly for logging purposes
 Provider = "Vaders" # named providers currently supported are "Vaders", "area51", "Iris"
 Username = "XXXXX"
 Password = "XXXXXX"
 Filter = "Premium Movies|Canada|United States|Ireland"
 FilterKey = "group-title" # FilterKey normally defaults to whatever the provider file says is best,
                            # otherwise you must set this.
# FilterRaw = false # FilterRaw will run your regex on the entire line instead of just specific keys.
 Sort = "group-title" # Sort will alphabetically sort your channels by the M3U key provided
#[[Source]]
# Name = ""
#Provider = "Custom"
# Username = "M3U-Identifier" # From http://iptv-epg.com/[M3U-Identifier].m3u
# Password = "XML-Identifier" # From http://iptv-epg.com/[XML-Identifier].xml [[Source]]
# Provider = "Custom"
# M3U = "/home/pi/telly/vaders.m3u" # These can be either URLs or fully-qualified paths.
# EPG = "http://myprovider.com/epg.xml"
chazlarson commented 6 years ago

When you start telly, what does it say in the logs?

chazlarson commented 6 years ago

If I edit that config to include my vader credentials and my IP, I get this:

➜  telly-1.1.0.2.darwin-amd64 ./telly
INFO[2018-08-30T15:58:01-05:00] telly is preparing to go live (version=1.1.0.2, branch=dev, revision=f1de7f04430f9f6d35ad7caf55d4d5360a1d681c)
INFO[2018-08-30T15:58:01-05:00] Loading M3U from http://api.vaders.tv/vget?username=REDACTED&password=REDACTED&vod=false&format=ts
INFO[2018-08-30T15:58:04-05:00] Loading XMLTV from http://vaders.tv/p2.xml.gz
INFO[2018-08-30T15:58:05-05:00] File (http://vaders.tv/p2.xml.gz) is gzipp'ed, ungzipping now, this might take a while
ERRO[2018-08-30T15:58:13-05:00] Could not decode xmltv programme              error="the type Date field of date is not a time, value is: 1991|2001"
ERRO[2018-08-30T15:58:13-05:00] error when parsing EPG                        error="the type Date field of date is not a time, value is: 1991|2001"
ERRO[2018-08-30T15:58:13-05:00] error when preparing provider                 error="the type Date field of date is not a time, value is: 1991|2001"
ERRO[2018-08-30T15:58:13-05:00] error when processing provider                error="the type Date field of date is not a time, value is: 1991|2001"
INFO[2018-08-30T15:58:13-05:00] telly is live and on the air!
INFO[2018-08-30T15:58:13-05:00] Broadcasting from http://192.168.1.61:6077/
INFO[2018-08-30T15:58:13-05:00] EPG URL: http://192.168.1.61:6077/epg.xml

It looks like the Vader EPG is broken somehow.

ikolsteren commented 6 years ago

Yes appears that way. From others it’s solved by removing the soccer rematch from BT sport on IPTV-EPG.
Don’t seem to have that option with doing it natively and even removing the United Kingdom channels doesn’t seem to help as the guide includes everything

chazlarson commented 6 years ago

For the time being you could get around it by downloading the XML and M3U files, removing the one problem element from the XML file, and then configuring the source as a Custom source pointing to those two files instead of the Vader URLs.

I'm closing this issue because the original problem appears to have been sorted.