NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
1 2 3 4 5 … 433 Next »
NextPVR - EPG Setup - XML/XMLTV EPG - Zap2it & Zap2xml

NextPVR - EPG Setup - XML/XMLTV EPG - Zap2it & Zap2xml
phil0909
Offline

Member

Posts: 52
Threads: 6
Joined: Jan 2009
#51
2017-02-11, 11:50 PM
sub Wrote:What is failing exactly? Is zap2xml failing to download and make the xmltv file, or is NextPVR failing to load the listings from your file? If it's the former, you'll probably need to capture the output of zap2xml in the batch file, so you can see what errors it lists.

It appears that zap2xml fails to run succesfully, and the xml file does not update, when zap2xml run automatically by NextPVR using the scheduled epg update function. The same zap2xml batch file and exe file do run successfully and produce a new epg.xml file in the NextPVR Scripts directory when I run the batch file directly from Windows Explorer, or when I manually run them from inside NextPVR (Settings - Channels - Update EPG).

I am having some difficulty testing the scheduled epg update function, because I don't know how frequently NextPVR checks for a scheduled update time. In testing this issue, I have scheduled updates for 5 minutes in the future and seen the batch file run successfully, and I've scheduled updates for 30+ minutes in the future and it seems like NPVR did not even try to run the epg update. Normally, of course, I just have the update scheduled once a day in the early AM, but for testing I have tried a bunch of different update times.
WayneD
Offline

Junior Member

Posts: 30
Threads: 7
Joined: Sep 2015
#52
2017-02-12, 05:27 PM (This post was last modified: 2017-02-13, 07:16 AM by WayneD.)
How is your cache dir configured? For me, I have a "cd" in my UpdateEPG.bat file so that the default of "cache" finds the right dir in the current directory. Then, in my .zap2xmlrc file I set "days=14" and "ncsdays=2" so that it rechecks today and tomorrow (and grabs the new day 2 weeks in the future). Without the cd (or a configured cache in the options), the script might just be dying with a "Can't mkdir" error trying to create the cache dir. Oh yeah, I also set a sleeptime of 1 second (-S1), which might help it to succeed.

Another thing to keep in mind is that the scheduled update runs as a different user than your logged-in user. On my computer the cache files are created by user SYSTEM. This might affect both permissions and also the script's choice of HOME. I've got "set HOME=C:\SOME\DIR" in my UpdateEPG.bat file.
phil0909
Offline

Member

Posts: 52
Threads: 6
Joined: Jan 2009
#53
2017-02-14, 02:06 AM
WayneD Wrote:How is your cache dir configured? For me, I have a "cd" in my UpdateEPG.bat file so that the default of "cache" finds the right dir in the current directory. Then, in my .zap2xmlrc file I set "days=14" and "ncsdays=2" so that it rechecks today and tomorrow (and grabs the new day 2 weeks in the future). Without the cd (or a configured cache in the options), the script might just be dying with a "Can't mkdir" error trying to create the cache dir. Oh yeah, I also set a sleeptime of 1 second (-S1), which might help it to succeed.

Hello WayneD - I have no cd command in the batch file, but the cache seems to be working ok as it is showing up as a subdirectory under Scripts. I think it will just be written wherever the program's focus is, to the default directory name "cache", right? I can try adding the -c parameter, but I expect the result will be the same.

I don't have a ncdays or ncsdays parameter, but this seems like a good idea and I will try adding "-N 2" consistent with your approach. I did have the sleep second already, but have removed it for testing as it makes the xml update very slow.

I'm a little slow getting this figured out, because I don't know how/when npvr does or doesn't do the scheduled auto update of epg. But I have a few things to test, and I think you may be right about the issue being related to how the cache works. I see a note on the developer's site that if you have problems, you should first delete the cache. Thanks for the suggestions!
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#54
2017-02-14, 10:54 AM
phil0909 Wrote:I have no cd command in the batch file, but the cache seems to be working ok as it is showing up as a subdirectory under Scripts. I think it will just be written wherever the program's focus is, to the default directory name "cache", right?

Apologies if I am stating the obvious ... The NextPVR Recording Service runs using a "System" users account. If the Recording Service launches a batch file ... the batch file also runs under the "System" account. This affects things like permissions to access folders and also the folder that the batch file is "in" when it runs. A batch file that is started by the Recording Service will not be in the same folder as when the same batch file is run from the Command Prompt.

It is recommended that Update EPG batch files always begin with a CD command so that we can be sure that all subsequent access to files and folders is accessing the files and folders that we expect.

phil0909 Wrote:I'm a little slow getting this figured out, because I don't know how/when npvr does or doesn't do the scheduled auto update of epg.

NextPVR runs the batch files at the time specified in Settings --> Misc2 ... immediately after running the batch file, NextPVR updates the EPG using the EPG sources specified for each channel unders Setttings --> Channels --> Details.
phil0909
Offline

Member

Posts: 52
Threads: 6
Joined: Jan 2009
#55
2017-02-14, 04:28 PM
Graham Wrote:Apologies if I am stating the obvious ... The NextPVR Recording Service runs using a "System" users account. If the Recording Service launches a batch file ... the batch file also runs under the "System" account. This affects things like permissions to access folders and also the folder that the batch file is "in" when it runs. A batch file that is started by the Recording Service will not be in the same folder as when the same batch file is run from the Command Prompt.

It is recommended that Update EPG batch files always begin with a CD command so that we can be sure that all subsequent access to files and folders is accessing the files and folders that we expect.



NextPVR runs the batch files at the time specified in Settings --> Misc2 ... immediately after running the batch file, NextPVR updates the EPG using the EPG sources specified for each channel unders Setttings --> Channels --> Details.

1. Should that cd command be to the nextPVR Scripts directory, e.g.: "cd C:\Users\Public\NPVR\Scripts"?

2. I understand that NPVR is supposed to run the batch file and update its EPG at the scheduled time. My problem is that this sometimes happens, and sometimes does not. Suppose it is 6:57AM now, and I edit the Misc2 time setting to say 7:00AM. Will NPVR check this setting within ~3 minutes and execute the batch file on time? Or does it check that time setting, say, only once per hour? Or 2 times per day? If I close and re-open, or just close NextPVR at 6:58, would that force NextPVR to check the "EPG Update Hour" setting in Misc2? The reason I ask is that I am testing a few changes like the ones you and WayneD have suggested, and it goes a lot faster if I can set the test up in 3 minutes , rather than waiting till my regularly scheduled 1AM epg update time. My experience is that the batch update will usually NOT run, unless I give it many hours lead time in setting that Misc2 update hour. Any insights on this would be much appreciated.

Thanks for the suggestions, Graham!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,765
Threads: 769
Joined: Nov 2003
#56
2017-02-14, 04:54 PM
phil0909 Wrote:Will NPVR check this setting within ~3 minutes and execute the batch file on time? Or does it check that time setting, say, only once per hour? Or 2 times per day? If I close and re-open, or just close NextPVR at 6:58, would that force NextPVR to check the "EPG Update Hour" setting in Misc2?
You probably need to restart the recording service for the changed time to be picked up.
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#57
2017-02-14, 04:56 PM
phil0909 Wrote:1. Should that cd command be to the nextPVR Scripts directory, e.g.: "cd C:\Users\Public\NPVR\Scripts"?

I don't use zap2xml so I can't help but I have just re-read this ...

WayneD Wrote:How is your cache dir configured? For me, I have a "cd" in my UpdateEPG.bat file so that the default of "cache" finds the right dir in the current directory. Then, in my .zap2xmlrc file I set "days=14" and "ncsdays=2" so that it rechecks today and tomorrow (and grabs the new day 2 weeks in the future). Without the cd (or a configured cache in the options), the script might just be dying with a "Can't mkdir" error trying to create the cache dir. Oh yeah, I also set a sleeptime of 1 second (-S1), which might help it to succeed.

Another thing to keep in mind is that the scheduled update runs as a different user than your logged-in user. On my computer the cache files are created by user SYSTEM. This might affect both permissions and also the script's choice of HOME. I've got "set HOME=C:\SOME\DIR" in my UpdateEPG.bat file.

phil0909 Wrote:2. I understand that NPVR is supposed to run the batch file and update its EPG at the scheduled time. My problem is that this sometimes happens, and sometimes does not.

NextPVR should have Start and Stop Recording Serice items in the Start Menu. I suggest that you try stop and start the Recording Service after each change to the Update EPG time in Settings.
TeleFragger
Offline

Member

Posts: 109
Threads: 13
Joined: Mar 2016
#58
2017-03-21, 11:19 AM
well i do this a bit differently...

i originally was using plex for live tv and followed a tutorial. the tutorial (http://hdhrviewer.zynine.net/hdhrviewerv...v-zap2xml/)
said to create a folder C:\HDHRViewer\
create a batch file - zap2xml.bat ==> zap2xml -u email@example.com -p MyPassword

I also pulled the duhhhh moment and in my youtube channel video I didnt show inside my bat or run it as pwd is in clear txt..BUT.. you can put this in your batch file...
@echo off
zap2xml -u email@example.com -p MyPassword

now it wont show your username and pwd every time it runs.

next do a windows scheduled task...
step 6

then you do the typical in NextPVR chose that xml to pull from for epg data...

this has worked SOLID for me with 0 issues....

appologize if I shouldnt of added a link to that guys page - just showing another way this could work...
WayneD
Offline

Junior Member

Posts: 30
Threads: 7
Joined: Sep 2015
#59
2017-03-21, 10:17 PM
Note that you can avoid command-line user & password args altogether if you use a config file. By default it reads .zap2xmlrc out of the $HOME dir (which defaults to the current directory if HOME isn't in the environment), but you can override that using -C FILENAME. Just FYI.
deanhatescoffee
Offline

Junior Member

Posts: 5
Threads: 0
Joined: Nov 2017
#60
2017-11-11, 11:43 AM
Just wanted to say thanks to the OP for an excellently written and super useful tutorial! I was able to follow the super clear directions and it worked great; the guide is now loaded with info for the next 14 days.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (13): « Previous 1 … 4 5 6 7 8 … 13 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  NextPVR VOD through Kodi unmich 2 1,295 2023-06-18, 03:54 AM
Last Post: sub
  uray encoder setup with ir change 105 3 1,391 2023-03-20, 12:30 PM
Last Post: mvallevand
  zap2it import tv logo MaxOne72 2 1,485 2021-11-14, 05:56 PM
Last Post: sub
  Can NextPVR switch graphics mode to best match content ? madbrain 2 2,190 2021-09-25, 02:25 AM
Last Post: madbrain
Photo How to setup Multidec with HDHomeRun HDHR4-2DT spin35 7 2,538 2021-09-18, 02:12 AM
Last Post: sub
  NextPVR and Remote viewing MaxiBelas 2 1,705 2021-09-07, 05:29 PM
Last Post: sub
  Help with NextPVR evinahmad86 1 1,452 2021-07-23, 07:01 PM
Last Post: sub
  ZAP2XML no longer loading TV Guide Schedule skoonz_sr@hotmail.com 33 20,907 2021-03-27, 06:45 AM
Last Post: Jean0987654321
  Epg setting SD token NextPvr 4.2.4 casimir@zyxu.ca 1 1,595 2021-03-05, 01:38 PM
Last Post: mvallevand
  NextPVR hangs when tuning to offline channel? CormacBaptiste 2 1,956 2021-02-03, 01:29 PM
Last Post: Graham

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode